Skip to content

Commit

Permalink
Merge branch 'master' into nd433/redesignStudentModal
Browse files Browse the repository at this point in the history
  • Loading branch information
namanhboi committed Sep 28, 2024
2 parents 103be4e + 929c82c commit 44a0a82
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
8 changes: 8 additions & 0 deletions frontend/src/components/EmployeeCards/EmployeeCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ const EmployeeCard = ({
const netId = email.split('@')[0];
const fmtPhone = formatPhone(phoneNumber);

/**
* Formats availability, represented by an object that maps available days to
* start and end times, into a printable string with availabilities formatted as '[day]: [start] - [end]'.
* Ignores malformed availabilities, e.g. missing start or end times, from being printed.
*
* @param availability the driver's availability, represented as an object map of days to start and end times
* @returns a string representation of a driver's availibility
*/
const formatAvail = (availability: {
[key: string]: { startTime: string; endTime: string };
}) => {
Expand Down
26 changes: 11 additions & 15 deletions frontend/src/components/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,15 @@ const Modal = ({
<>
{isOpen &&
createPortal(
<FocusTrap
focusTrapOptions={{
onDeactivate: onClose,
returnFocusOnDeactivate: true,
}}
>
<div className={styles.background}>
<div
className={styles.modal}
role="dialog"
aria-modal="true"
aria-labelledby={arialabelledby ?? id}
>
<div className={styles.background}>
<FocusTrap
focusTrapOptions={{
onDeactivate: onClose,
returnFocusOnDeactivate: true,
clickOutsideDeactivates: true,
}}
>
<div className={styles.modal}>
<div className={styles.topContainer}>
{isRider ? (
<h1 className={styles.title} id={id}>
Expand All @@ -101,8 +97,8 @@ const Modal = ({
</div>
<div className={styles.page}>{pages[currentPage]}</div>
</div>
</div>
</FocusTrap>,
</FocusTrap>
</div>,
document.body
)}
</>
Expand Down

0 comments on commit 44a0a82

Please sign in to comment.