-
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.
Merge pull request #60 from digitalaidseattle/sprint-6
Sprint 6
- Loading branch information
Showing
21 changed files
with
708 additions
and
600 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<!doctype html> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import { useContext } from "react"; | ||
import { DonationContext } from "../context/DonationContext"; | ||
import { Backdrop, Box, Theme } from "@mui/material"; | ||
import DialogCloseButton from "../styles/DialogCloseButton"; | ||
import { DonationHospitalContext } from "../context/SelectedHospitalContext"; | ||
|
||
const FUNDRAISEUP_CAMPAIGN_CODE = import.meta.env | ||
.VITE_FUNDRAISEUP_CAMPAIGN_CODE; | ||
|
||
if (!FUNDRAISEUP_CAMPAIGN_CODE) { | ||
throw new Error( | ||
"FUNDRAISEUP_CAMPAIGN_CODE is not set. Application cannot start." | ||
); | ||
} | ||
|
||
const FUNDRAISEUP_SELECTED_HOSPITAL_CAMPAIGN_CODE = import.meta.env | ||
.VITE_FUNDRAISEUP_SELECTED_HOSPITAL_CAMPAIGN_CODE; | ||
|
||
if (!FUNDRAISEUP_SELECTED_HOSPITAL_CAMPAIGN_CODE) { | ||
throw new Error( | ||
"FUNDRAISEUP_SELECTED_HOSPITAL_CAMPAIGN_CODEE is not set. Application cannot start." | ||
); | ||
} | ||
|
||
export const DonateOverlay = () => { | ||
const { donateOverlayOpen, setDonateOverlayOpen } = | ||
useContext(DonationContext); | ||
|
||
const { hospital } = useContext(DonationHospitalContext); | ||
|
||
const handleClose = () => { | ||
setDonateOverlayOpen(false); | ||
}; | ||
|
||
return ( | ||
donateOverlayOpen && ( | ||
<Backdrop | ||
sx={(theme) => ({ | ||
zIndex: theme.zIndex.drawer + 1, | ||
overflowY: "auto", | ||
display: "flex", | ||
justifyContent: "center", | ||
alignItems: "center", | ||
})} | ||
open={donateOverlayOpen} | ||
> | ||
<DialogCloseButton | ||
onClick={handleClose} | ||
sx={{ | ||
backgroundColor: (theme: Theme) => theme.palette.grey[700], | ||
color: "white", | ||
}} | ||
/> | ||
|
||
{hospital ? ( | ||
<Box | ||
display="flex" | ||
flexDirection="column" | ||
alignItems="center" | ||
gap={2} | ||
minHeight={50} | ||
> | ||
<h2>Donate to {hospital.name}</h2> | ||
<a | ||
href={FUNDRAISEUP_SELECTED_HOSPITAL_CAMPAIGN_CODE} | ||
style={{ display: "none" }} | ||
id="fundraise-link" | ||
></a> | ||
</Box> | ||
) : ( | ||
<a | ||
href={FUNDRAISEUP_CAMPAIGN_CODE} | ||
style={{ display: "none" }} | ||
id="fundraise-link" | ||
></a> | ||
)} | ||
</Backdrop> | ||
) | ||
); | ||
}; |
Oops, something went wrong.