From 2b0a562ac4113d450b3f1aa1563c706fe10a6fab Mon Sep 17 00:00:00 2001 From: Aapeli Date: Tue, 26 Nov 2024 23:24:58 -0500 Subject: [PATCH] Allow messaging past requests --- app/web/features/messages/locales/en.json | 3 ++- .../messages/requests/HostRequestGuideLinks.tsx | 13 ++++++++++++- .../messages/requests/HostRequestSendField.tsx | 1 - 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/web/features/messages/locales/en.json b/app/web/features/messages/locales/en.json index 1f16062a69..0812e6d17b 100644 --- a/app/web/features/messages/locales/en.json +++ b/app/web/features/messages/locales/en.json @@ -1,6 +1,6 @@ { "mark_all_read_button_text": "Mark all as read", - "request_closed_message": "This host request is closed or in the past. To continue chatting, send the other person a normal message.", + "request_closed_message": "This host request is closed. To continue chatting, send the other person a normal message.", "write_reference_button_text": "Write a Reference", "close_request_dialog_title": "Are you done messaging?", "close_request_dialog_host": "Please make sure you are done chatting before you decline their request.", @@ -9,6 +9,7 @@ "confirm_request_button_text": "Confirm", "host_pending_request_help_text": "<0>Things to consider before responding.", "surfer_declined_request_help_text": "<0>Read our guide on how to write a request that will get accepted.", + "past_request_help_text": "This request is in the past, you can still send messages but cannot otherwise modify it.", "messages_page": { "title": "Messages", "tabs": { diff --git a/app/web/features/messages/requests/HostRequestGuideLinks.tsx b/app/web/features/messages/requests/HostRequestGuideLinks.tsx index 8aa4c695f8..29b43786f0 100644 --- a/app/web/features/messages/requests/HostRequestGuideLinks.tsx +++ b/app/web/features/messages/requests/HostRequestGuideLinks.tsx @@ -1,6 +1,7 @@ import { styled, Typography } from "@mui/material"; import StyledLink from "components/StyledLink"; -import { Trans } from "i18n"; +import { Trans, useTranslation } from "i18n"; +import { MESSAGES } from "i18n/namespaces"; import { HostRequestStatus } from "proto/conversations_pb"; import React from "react"; import { howToRespondRequestGuideUrl, howToWriteRequestGuideUrl } from "routes"; @@ -21,6 +22,8 @@ export default function HostRequestGuideLinks({ isHost: boolean; status: HostRequestStatus; }) { + const { t } = useTranslation([MESSAGES]); + const isHostPending = !isPast && isHost && @@ -55,6 +58,14 @@ export default function HostRequestGuideLinks({ ); + } else if (isPast) { + return ( + + + {t("messages:past_request_help_text")} + + + ); } else { return null; } diff --git a/app/web/features/messages/requests/HostRequestSendField.tsx b/app/web/features/messages/requests/HostRequestSendField.tsx index b88783b876..ba5cb5327d 100644 --- a/app/web/features/messages/requests/HostRequestSendField.tsx +++ b/app/web/features/messages/requests/HostRequestSendField.tsx @@ -99,7 +99,6 @@ export default function HostRequestSendField({ const isPast = hostRequest.toDate < new Date().toISOString().split("T")[0]; const isRequestClosed = - isPast || hostRequest.status === HostRequestStatus.HOST_REQUEST_STATUS_CANCELLED || hostRequest.status === HostRequestStatus.HOST_REQUEST_STATUS_REJECTED;