Skip to content

Commit 77a20f3

Browse files
foxishdavixcky
authored andcommitted
show the plate after driver arrives as well
1 parent b473e04 commit 77a20f3

File tree

1 file changed

+8
-2
lines changed
  • services/frontend/react_app/src/pages

1 file changed

+8
-2
lines changed

services/frontend/react_app/src/pages/home.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,17 @@ import {useGetRequestArrival} from "../hooks/useGetRequestArrival.tsx";
2929
import Countdown, {CountdownRenderProps} from "react-countdown";
3030

3131
const countdownRenderer = ({minutes, seconds, driverName, driverPlate, props }: CountdownRenderProps & { driverName: string, driverPlate: string }) => {
32+
const PlateDisplay = () => (
33+
<Badge colorScheme="purple" px={2} py={1} borderRadius="md" fontSize="0.9em">{driverPlate}</Badge>
34+
);
35+
3236
if (minutes === 0 && seconds === 0) {
33-
return <Text>{driverName} arrived</Text>;
37+
return <Text as="b">
38+
The driver {driverName} <PlateDisplay/> arrived
39+
</Text>;
3440
} else {
3541
return <Text as="b">
36-
The driver {driverName} <Badge colorScheme="purple" px={2} py={1} borderRadius="md" fontSize="0.9em">{driverPlate}</Badge> will arrive in {props.overtime ? "-" : ""}{minutes.toString().padStart(2, "0")}:{seconds.toString().padStart(2, "0")}
42+
The driver {driverName} <PlateDisplay/> will arrive in {props.overtime ? "-" : ""}{minutes.toString().padStart(2, "0")}:{seconds.toString().padStart(2, "0")}
3743
</Text>;
3844
}
3945
};

0 commit comments

Comments
 (0)