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(ts/diversionPage): remove timestamp from diversion page headers #2924

Merged
merged 1 commit into from
Jan 22, 2025
Merged
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
26 changes: 15 additions & 11 deletions assets/src/components/detours/diversionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ export const DiversionPage = ({
const routes = useContext(RoutesContext)
const epochNowInSeconds = useCurrentTimeSeconds()

const timestampLabelFromMachineState = (): string => {
const detourStatus = (() => {
if (snapshot.matches({ "Detour Drawing": "Active" })) {
return timestampLabelFromStatus(DetourStatus.Active)
return DetourStatus.Active
} else if (snapshot.matches({ "Detour Drawing": "Past" })) {
return timestampLabelFromStatus(DetourStatus.Closed)
return DetourStatus.Closed
} else {
return timestampLabelFromStatus(DetourStatus.Draft)
return DetourStatus.Draft
}
}
})()

const detourPanel = () => {
if (snapshot.matches({ "Detour Drawing": "Pick Route Pattern" })) {
Expand Down Expand Up @@ -491,12 +491,16 @@ export const DiversionPage = ({
>
{"snapshot" in useDetourProps && !isMobile(displayType) ? (
<>
<span className="l-diversion-page__header-details">
<strong className="font-m-semi me-2">
{timestampLabelFromMachineState()}
</strong>
{timeAgoLabel(epochNowInSeconds, useDetourProps.updatedAt)}
</span>
{detourStatus !== DetourStatus.Active && (
<>
<span className="l-diversion-page__header-details">
<strong className="font-m-semi me-2">
{timestampLabelFromStatus(detourStatus)}
</strong>
{timeAgoLabel(epochNowInSeconds, useDetourProps.updatedAt)}
</span>
</>
)}
<span className="l-diversion-page__header-details">
<strong className="font-m-semi me-2">Created by</strong>
{useDetourProps.author}
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.