Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add hours warning to resource page #479

Merged
merged 4 commits into from
Jul 14, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/common/src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ export default {
address: "Address",
phoneNumber: "Phone Number",
website: "Website",
covidWarning: "COVID-19 may affect normal business hours and operations.",
checkWebsite: "Please check their website for up-to-date info.",
hoursOfOperation: "Hours of Operation",
reportAProblem: "Report a Problem",
services: "Services",
Expand Down
3 changes: 3 additions & 0 deletions packages/common/src/i18n/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ export default {
address: "Dirección",
phoneNumber: "Número de Teléfono",
website: "Sitio Web",
covidWarning:
"COVID-19 puede afectar el horario comercial y las operaciones normales.",
checkWebsite: "Consulte su sitio web para obtener información actualizada.",
hoursOfOperation: "Horas de Operación",
reportAProblem: "Reportar un Problema",
services: "Servicios",
Expand Down
34 changes: 23 additions & 11 deletions packages/web/src/components/Resource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { TCategoryDefinition, categories } from "./Categories";

import BannerColorContext from "./BannerColorContext";
import Button from "@material-ui/core/Button/Button";
import Card from "@material-ui/core/Card";
import Container from "@material-ui/core/Container";
import FavoriteResourceFAB from "./FavoriteResourceFAB";
import Image from "material-ui-image";
Expand All @@ -25,6 +26,7 @@ import Services from "./Services";
import { TResource } from "@upswyng/types";
import { Theme } from "@material-ui/core/styles/createMuiTheme";
import Typography from "@material-ui/core/Typography";
import WarningIcon from "@material-ui/icons/Warning";
import { colors } from "@upswyng/common";
import makeStyles from "@material-ui/core/styles/makeStyles";
import { useHistory } from "react-router";
Expand Down Expand Up @@ -110,6 +112,14 @@ export const Resource = () => {
/>
)}
<List component="div">
<ListItem component={Card}>
<ListItemIcon classes={listIconClasses}>
<WarningIcon color="secondary" />
</ListItemIcon>
<ListItemText>{`${t("covidWarning")} ${
!!resource.website ? t("checkWebsite") : ""
}`}</ListItemText>
</ListItem>
{resource.address && (
<ListItem component="div">
<ListItemIcon classes={listIconClasses}>
Expand Down Expand Up @@ -162,17 +172,19 @@ export const Resource = () => {
</ListItem>
)}
{!!resource.schedule._items.length && (
<ListItem component="div">
<ListItemIcon classes={listIconClasses}>
<ScheduleIcon titleAccess={t("hoursOfOperation")} />
</ListItemIcon>
<ListItemText>
<Typography component="h2" variant="srOnly">
{t("hoursOfOperation")}
</Typography>
<Schedule schedule={resource.schedule} />
</ListItemText>
</ListItem>
<>
<ListItem component="div">
<ListItemIcon classes={listIconClasses}>
<ScheduleIcon titleAccess={t("hoursOfOperation")} />
</ListItemIcon>
<ListItemText>
<Typography component="h2" variant="srOnly">
{t("hoursOfOperation")}
</Typography>
<Schedule schedule={resource.schedule} />
</ListItemText>
</ListItem>
</>
)}
<ListItem component="div">
<Typography variant="srOnly">{t("services")}</Typography>
Expand Down