-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* data for shift hours * fixed bar * fixed time conversions * fixed scroll issue
- Loading branch information
1 parent
e86fa9c
commit 41e2514
Showing
5 changed files
with
113 additions
and
47 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React, { useState, useEffect } from "react"; | ||
import ArrowForwardIcon from "@mui/icons-material/ArrowForwardIos"; | ||
import dayjs from "dayjs"; | ||
|
||
export default function CheckInCard({ shift }) { | ||
const currentDate = dayjs(); | ||
const shiftDay = dayjs(shift.shift_date).format("YYYY-MM-DD"); | ||
const shiftStart = dayjs(`${shiftDay} ${shift.start_time}`); | ||
const checkIn = dayjs(shift.shift_date).isSame(currentDate, "day"); | ||
|
||
return checkIn ? ( | ||
<div className="dash-check-in"> | ||
<div className="dash-check-in-content"> | ||
<div className="dash-check-in-title">Check In</div> | ||
<div className="dash-check-in-content">{shift.class_name}</div> | ||
</div> | ||
<ArrowForwardIcon sx={{ fontSize: 30 }} /> | ||
</div> | ||
) : ( | ||
<div className="dash-next-check-in"> | ||
<div className="dash-next-title">Next Check-In in</div> | ||
<div className="dash-next-time"> | ||
<span className="dash-next-time-num"> | ||
{shiftStart.diff(currentDate, "d")} | ||
</span>{" "} | ||
days{" "} | ||
<span className="dash-next-time-num"> | ||
{shiftStart.diff(currentDate, "h") % 24} | ||
</span>{" "} | ||
hours{" "} | ||
<span className="dash-next-time-num"> | ||
{shiftStart.diff(currentDate, "m") % 60} | ||
</span>{" "} | ||
minutes | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters