Skip to content

Commit

Permalink
chore(match): more minor fixups (#350)
Browse files Browse the repository at this point in the history
* chore(MeetingInfo): add icon beside meeting location

* chore(MeetingInfo): change stand time to within opening hours

* fix(match): format time with Europe/Oslo-timezone

* chore(ScannerTutorial): add blid-finding help
  • Loading branch information
LarsSelbekk authored Jun 19, 2023
1 parent b51899f commit 6cf4637
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
12 changes: 8 additions & 4 deletions src/components/matches/MeetingInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Box, Typography } from "@mui/material";
import ScheduleIcon from "@mui/icons-material/Schedule";
import { formatDatetime } from "./matchesList/helper";
import React from "react";
import PlaceIcon from "@mui/icons-material/Place";
import { MatchWithDetails } from "@boklisten/bl-model";

const MeetingInfo = ({ match }: { match: MatchWithDetails }) => {
Expand All @@ -10,9 +11,12 @@ const MeetingInfo = ({ match }: { match: MatchWithDetails }) => {

return (
<Box sx={{ display: "flex", flexDirection: "column", alignItems: "left" }}>
<Typography fontWeight="bold" variant={"subtitle1"}>
{meetingLocation}
</Typography>
<Box sx={{ display: "flex", marginTop: ".2rem", alignItems: "center" }}>
<PlaceIcon sx={{ marginRight: ".2rem" }} />
<Typography fontWeight="bold" variant={"subtitle1"}>
{meetingLocation}
</Typography>
</Box>
<Box sx={{ display: "flex", marginTop: ".2rem", alignItems: "center" }}>
<ScheduleIcon sx={{ marginRight: ".2rem" }} />
{(meetingTime && (
Expand All @@ -21,7 +25,7 @@ const MeetingInfo = ({ match }: { match: MatchWithDetails }) => {
{formatDatetime(new Date(meetingTime))}
</Typography>
</>
)) || <>Du kan møte opp når som helst i løpet av dagen</>}
)) || <>Du kan møte opp når som helst i skolens åpningstider</>}
</Box>
</Box>
);
Expand Down
4 changes: 4 additions & 0 deletions src/components/matches/Scanner/ScannerTutorial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ const ScannerTutorial = () => {
width={300}
height={150}
/>
<Typography sx={{ mb: ".4rem", mt: "1rem" }}>
Sliter du med å finne IDen? Sjekk innsiden av boka, eller be om
hjelp fra kontaktelev eller stand
</Typography>
</Card>

<Card
Expand Down
7 changes: 5 additions & 2 deletions src/components/matches/matchesList/helper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ export function getSortedMatchGroups<T extends MatchWithDetails>(
}

export function formatDatetime(date: Date): string {
const dateString = date.toLocaleDateString("no");
const timeString = date.toLocaleTimeString("no", { timeStyle: "short" });
const dateString = date.toLocaleDateString("no", { timeZone: "Europe/Oslo" });
const timeString = date.toLocaleTimeString("no", {
timeZone: "Europe/Oslo",
timeStyle: "short",
});
return `${dateString} ${timeString}`;
}

1 comment on commit 6cf4637

@vercel
Copy link

@vercel vercel bot commented on 6cf4637 Jun 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

bl-next – ./

bl-next-boklisten.vercel.app
bl-next-git-main-boklisten.vercel.app
next.boklisten.no

Please sign in to comment.