Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 5 additions & 1 deletion app/web/features/dashboard/ReminderItem.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ describe("ReminderItem", () => {
);

expect(
screen.getByText(t("dashboard:reminder.respond_to_host_request.title")),
screen.getByText(
t("dashboard:reminder.respond_to_host_request.title", {
name: surferUser.name,
}),
),
).toBeVisible();
expect(
screen.getByText(
Expand Down
15 changes: 5 additions & 10 deletions app/web/features/dashboard/ReminderItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Typography, useColorScheme } from "@mui/material";
import { alpha, Box, Typography } from "@mui/material";
import { useMediaQuery } from "@mui/system";
import Button from "components/Button";
import { useTranslation } from "i18n";
Expand All @@ -21,24 +21,19 @@ export default function ReminderItem({
reminder: Reminder.AsObject;
}) {
const { t } = useTranslation([DASHBOARD]);
const { mode, systemMode } = useColorScheme();

const isMobile = useMediaQuery(theme.breakpoints.down("md"));

const resolvedMode = mode === "system" ? systemMode : mode;
const isDark = resolvedMode === "dark";

let title: string;
let description: string;
let buttonText: string;
let href: string;

if (reminder.respondToHostRequestReminder) {
const { hostRequestId, surferUser } = reminder.respondToHostRequestReminder;
title = t("reminder.respond_to_host_request.title");
description = t("reminder.respond_to_host_request.description", {
name: surferUser?.name ?? "",
});
const name = surferUser?.name ?? "";
title = t("reminder.respond_to_host_request.title", { name });
description = t("reminder.respond_to_host_request.description", { name });
buttonText = t("reminder.respond_to_host_request.button");
href = routeToHostRequest(hostRequestId);
} else if (reminder.writeReferenceReminder?.otherUser) {
Expand Down Expand Up @@ -71,7 +66,7 @@ export default function ReminderItem({
return (
<Box
sx={(theme) => ({
backgroundColor: isDark ? "#716317" : "#fff5e4",
backgroundColor: alpha(theme.palette.secondary.main, 0.08),
padding: isMobile ? "20px" : "24px",
display: "flex",
flexDirection: "column",
Expand Down
4 changes: 2 additions & 2 deletions app/web/features/dashboard/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
},
"reminder": {
"respond_to_host_request": {
"title": "Respond to host request",
"description": "Don't forget to respond to {{name}} about their stay.",
"title": "Respond to {{name}}",
"description": "Don't forget to respond to the host request by {{name}}.",
"button": "View request"
},
"write_reference": {
Expand Down
Loading