Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add link to reports from detection submit modal #379

Merged
merged 11 commits into from
Apr 1, 2024
69 changes: 61 additions & 8 deletions ui/src/components/Player/DetectionDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import CloseIcon from "@mui/icons-material/Close";
import {
Box,
Button,
Dialog,
DialogActions,
DialogContent,
DialogTitle,
IconButton,
Paper,
TextField,
ToggleButton,
ToggleButtonGroup,
Typography,
useMediaQuery,
} from "@mui/material";
import { useTheme } from "@mui/material/styles";
mrose15 marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -126,9 +129,43 @@ export default function DetectionDialog({
onClose={handleClose}
aria-labelledby="form-dialog-title"
>
<DialogTitle id="form-dialog-title">
{!submitted ? "Report what you heard" : "Thanks for submitting!"}
</DialogTitle>
<IconButton
aria-label="close"
onClick={handleClose}
sx={{
position: "absolute",
right: 8,
top: 8,
color: (theme) => theme.palette.grey[500],
mrose15 marked this conversation as resolved.
Show resolved Hide resolved
}}
>
<CloseIcon />
</IconButton>

{!submitted ? (
<DialogTitle id="form-dialog-title">
Report what you heard
</DialogTitle>
) : (
<>
<DialogTitle
id="form-dialog-title"
variant="h4"
mt={8}
align="center"
sx={{
color: (theme) => theme.palette.primary.main,
mrose15 marked this conversation as resolved.
Show resolved Hide resolved
}}
>
Thank you for reporting
</DialogTitle>
<Typography variant="body1" mb={2} mx={8} align="center">
Check out our reports to see how your support contributed to our
mission for marine conservation.
</Typography>
</>
)}

{!submitted && (
<DialogContent>
<ToggleButtonGroup
Expand Down Expand Up @@ -200,11 +237,27 @@ export default function DetectionDialog({
</Button>
</DialogActions>
) : (
<DialogActions>
<Button onClick={handleClose} color="primary">
CLOSE
</Button>
</DialogActions>
<>
<DialogActions sx={{ justifyContent: "center", mb: 10 }}>
<Button
onClick={handleClose}
color="primary"
variant="outlined"
sx={{ py: 2, px: [3, 6], mx: 2 }}
>
BACK
</Button>
<Button
href="/reports"
target="_blank"
color="primary"
variant="contained"
sx={{ py: 2, px: [3, 6], mx: 2 }}
>
SEE REPORTS
</Button>
</DialogActions>
</>
)}
</Dialog>
</>
Expand Down
Loading