Skip to content

Commit fb5bc69

Browse files
committed
#1310: Created Toast
1 parent fe470b2 commit fb5bc69

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

src/frontend/src/pages/FinancePage/ReimbursementRequestForm/ReimbursementFormView.tsx

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ import {
44
FormHelperText,
55
FormLabel,
66
Grid,
7-
IconButton,
87
Link,
8+
IconButton,
99
MenuItem,
1010
Select,
1111
TextField,
12-
Typography
12+
Typography,
13+
Snackbar,
14+
Alert
1315
} from '@mui/material';
1416
import { Box, Stack } from '@mui/system';
1517
import { Control, Controller, FieldErrors, UseFormHandleSubmit, UseFormSetValue, UseFormWatch } from 'react-hook-form';
@@ -85,7 +87,6 @@ const ReimbursementRequestFormView: React.FC<ReimbursementRequestFormViewProps>
8587

8688
useEffect(() => {
8789
if (!hasSecureSettingsSet) {
88-
//<Link component={RouterLink} to={routes.SETTINGS}> </Link>
8990
toast.warning('Your secure settings must be set to create a reimbursement request, you can set them here.', Infinity);
9091
}
9192
}, []);
@@ -120,6 +121,18 @@ const ReimbursementRequestFormView: React.FC<ReimbursementRequestFormViewProps>
120121
handleSubmit(onSubmit)(e);
121122
}}
122123
>
124+
{!hasSecureSettingsSet && (
125+
<Snackbar anchorOrigin={{ vertical: 'top', horizontal: 'center' }} open={true}>
126+
<Alert variant="filled" severity="warning">
127+
Your secure settings must be set to create a reimbursement request, you can set them
128+
<Link component={RouterLink} to={routes.SETTINGS}>
129+
{' '}
130+
here
131+
</Link>
132+
.
133+
</Alert>
134+
</Snackbar>
135+
)}
123136
<Grid container spacing={2}>
124137
<Grid item container spacing={2} md={6} xs={12}>
125138
<Grid item xs={12}>

0 commit comments

Comments
 (0)