Skip to content

Commit

Permalink
Added page header
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-1010 committed Feb 17, 2025
1 parent ce36b7c commit 1da1a6f
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/views/CampusSafety/components/ItemForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,31 @@ import { DatePicker, DateValidationError, LocalizationProvider } from '@mui/x-da
import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline';
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3';

const ItemForm = ({ formType }: { formType: any }) => {
const pageHeader = (formType: string) => {
if (formType == 'create') {
return (
<>
<CardHeader
title={
<b>
Report a <u>Lost</u> Item
</b>
}
titleTypographyProps={{ align: 'center' }}
className="gc360_header"
/>
</>
);
} else if (formType == 'edit') {
return (
<>
<CardHeader title="Edit Missing Item" className="gc360_header" />
</>
);
}
};

const ItemForm = ({ formType }: { formType: string }) => {
const navigate = useNavigate();
const { itemId } = useParams<{ itemId: string }>();
const [loading, setLoading] = useState<boolean>(true);
Expand Down Expand Up @@ -420,6 +444,7 @@ const ItemForm = ({ formType }: { formType: any }) => {
/>
) : (
<Card className={styles.form_card}>
{pageHeader(formType)}
<Grid container justifyContent="center">
<Grid item sm={5} xs={12}>
{/* Item Category */}
Expand Down

0 comments on commit 1da1a6f

Please sign in to comment.