diff --git a/app/package.json b/app/package.json index dc98955..4a56710 100644 --- a/app/package.json +++ b/app/package.json @@ -13,7 +13,7 @@ "dependencies": { "@azure/msal-browser": "^4.0.1", "@azure/msal-react": "^3.0.1", - "@noahspan/noahspan-components": "^1.4.0", + "@noahspan/noahspan-components": "^1.5.1", "axios": "^1.7.2", "dotenv": "^16.4.7", "react": "^18.3.1", diff --git a/app/src/components/logForm/LogForm.tsx b/app/src/components/logForm/LogForm.tsx index ed99327..5d4e569 100644 --- a/app/src/components/logForm/LogForm.tsx +++ b/app/src/components/logForm/LogForm.tsx @@ -13,7 +13,9 @@ import { IconName, Select, TextField, + theme, Typography, + useMediaQuery } from '@noahspan/noahspan-components'; import { useForm, Controller, FormProvider } from 'react-hook-form'; import { ILogFormProps } from './ILogFormProps'; @@ -63,6 +65,7 @@ const LogForm: React.FC = ({ }; const methods = useForm(); const { pilots } = usePilots(); + const isMedium = useMediaQuery(theme.breakpoints.up('md')); const onCancel = () => { methods.reset(defaultValues); @@ -166,7 +169,7 @@ const LogForm: React.FC = ({ PaperProps={{ sx: { padding: '30px', - width: '33%' + width: isMedium ? '33%' : '75%' } }} > @@ -194,10 +197,10 @@ const LogForm: React.FC = ({ )} - + Pilot * - + = ({ }} /> - + Date * - + = ({ )} /> - + Aircraft Make and Model * - + = ({ )} /> - - Aircraft Identity * - - - ( - + + Aircraft Identity * + + + ( + + )} /> - )} - /> - - + + + } + Route From - + = ({ )} /> - + Route To - + = ({ )} /> - + Duration Of Flight - + = ({ )} /> - - Single Engine Land - - - ( - + + Single Engine Land + + + ( + + )} /> - )} - /> - - - Simulator or ATD - - - ( - + + } + {isAuthenticated && + <> + + Simulator or ATD + + + ( + + )} /> - )} - /> - - - - }> - Landings - - - - - Day - - - ( - + + } + {isAuthenticated && + + + }> + Landings + + + + + Day + + + ( + - )} - /> - - - Night - - - ( - - )} - /> - - - - - - - - }> - Instrument - - - - - Actual - - - ( - + )} + /> + + + Night + + + ( + - )} - /> - - - Simulated - - - ( - - )} - /> + onChange={onChange} + slotProps={{ + htmlInput: { + step: 1 + } + }} + type="number" + value={value} + /> + )} + /> + - - - Instrument Approaches - - - - ( - + + + } + {isAuthenticated && + + + }> + Instrument + + + + + Actual + + + ( + - )} - /> - - - Holds - - - ( - - )} - /> - - - Nav / Track - - - ( - + )} + /> + + + Simulated + + + ( + - )} - /> - - - - - - - - }> - Type of Pilot Experience or Training - - - - - - Ground Training Received - - - - ( - - )} - /> - - - - Flight Training Received - - - - ( - + )} + /> + + + + Instrument Approaches + + + + ( + - )} - /> - - - Cross Country - - - ( - - )} - /> - - - Night - - - ( - + )} + /> + + + Holds + + + ( + - )} - /> - - - Solo - - - ( - - )} - /> - - - Pilot in Command - - - ( - + )} + /> + + + Nav / Track + + + ( + - )} - /> + fullWidth + helperText={ + methods.formState.errors.address + ? methods.formState.errors.address.message?.toString() + : undefined + } + onChange={onChange} + slotProps={{ + htmlInput: { + step: 1 + } + }} + type="number" + value={value} + /> + )} + /> + - - - - - + + + + } + {isAuthenticated && + + + }> + Type of Pilot Experience or Training + + + + + + Ground Training Received + + + + ( + + )} + /> + + + + Flight Training Received + + + + ( + + )} + /> + + + Cross Country + + + ( + + )} + /> + + + Night + + + ( + + )} + /> + + + Solo + + + ( + + )} + /> + + + Pilot in Command + + + ( + + )} + /> + + + + + + } + Notes - + = () => { const [state, dispatch] = useReducer(reducer, initialState); const httpClient: AxiosInstance = useHttpClient(); const isAuthenticated = useIsAuthenticated(); const { getAccessToken } = useAccessToken(); + const isMedium = useMediaQuery(theme.breakpoints.up('md')); const getLogbookEntries = async () => { try { @@ -405,10 +409,10 @@ const Logbook: React.FC = () => { return ( - + Logbook - + {isAuthenticated &&