Remove takeoffs field, add dashboard route

This commit is contained in:
april 2024-01-08 14:59:07 -06:00
parent 921a3be6b2
commit b446ac93eb
6 changed files with 25 additions and 66 deletions

View File

@ -0,0 +1,3 @@
export default function Dashboard() {
return;
}

View File

@ -307,22 +307,6 @@ export default function Flight() {
</Group> </Group>
</CollapsibleFieldset> </CollapsibleFieldset>
) : null} ) : null}
<Grid w="100%" mt="sm">
<Grid.Col span={6}>
<CollapsibleFieldset legend="Takeoffs" w="100%">
<Group grow>
<VerticalLogItem
label="Day"
content={log.takeoffs_day}
/>
<VerticalLogItem
label="Night"
content={log.takeoffs_night}
/>
</Group>
</CollapsibleFieldset>
</Grid.Col>
<Grid.Col span={6}>
<CollapsibleFieldset legend="Landings" w="100%"> <CollapsibleFieldset legend="Landings" w="100%">
<Group grow> <Group grow>
<VerticalLogItem <VerticalLogItem
@ -335,8 +319,6 @@ export default function Flight() {
/> />
</Group> </Group>
</CollapsibleFieldset> </CollapsibleFieldset>
</Grid.Col>
</Grid>
{log.time_instrument || {log.time_instrument ||
log.time_sim_instrument || log.time_sim_instrument ||
log.holds_instrument ? ( log.holds_instrument ? (

View File

@ -25,6 +25,8 @@ export default function Index() {
useEffect(() => { useEffect(() => {
if (!loading && !user) { if (!loading && !user) {
navigate("/login"); navigate("/login");
} else {
navigate("/logbook/dashboard");
} }
}, [user, loading, navigate]); }, [user, loading, navigate]);

View File

@ -67,9 +67,7 @@ export default function FlightForm({
time_xc: 0.0, time_xc: 0.0,
dist_xc: 0.0, dist_xc: 0.0,
takeoffs_day: 0,
landings_day: 0, landings_day: 0,
takeoffs_night: 0,
landings_night: 0, landings_night: 0,
time_instrument: 0.0, time_instrument: 0.0,
@ -171,13 +169,9 @@ export default function FlightForm({
<Fieldset legend="Cross-Country" mt="md"> <Fieldset legend="Cross-Country" mt="md">
<Group justify="center" grow> <Group justify="center" grow>
<ZeroHourInput <ZeroHourInput form={form} field="time_xc" label="Hours" />
form={form}
field="time_xc"
label="Time Cross-Country"
/>
<NumberInput <NumberInput
label="Distance Cross-Country" label="Distance"
decimalScale={1} decimalScale={1}
min={0} min={0}
fixedDecimalScale fixedDecimalScale
@ -198,32 +192,12 @@ export default function FlightForm({
</Group> </Group>
</Fieldset> </Fieldset>
{/* Takeoffs and Landings */} {/* Landings */}
<Fieldset legend="Takeoffs and Landings" mt="md"> <Fieldset legend="Landings" mt="md">
<Group justify="center" grow> <Group justify="center" grow>
<ZeroIntInput <ZeroIntInput form={form} field="landings_day" label="Day" />
form={form} <ZeroIntInput form={form} field="landings_night" label="Night" />
field="takeoffs_day"
label="Day Takeoffs"
/>
<ZeroIntInput
form={form}
field="landings_day"
label="Day Landings"
/>
</Group>
<Group justify="center" grow mt="md">
<ZeroIntInput
form={form}
field="takeoffs_night"
label="Night Takeoffs"
/>
<ZeroIntInput
form={form}
field="landings_night"
label="Night Landings"
/>
</Group> </Group>
</Fieldset> </Fieldset>

View File

@ -26,10 +26,10 @@ export default function Navbar({
<NavLink <NavLink
p="md" p="md"
component={Link} component={Link}
to="/logbook" to="/logbook/dashboard"
label="Dashboard" label="Dashboard"
leftSection={<IconPlaneDeparture />} leftSection={<IconPlaneDeparture />}
active={page == null} active={page == "dashboard"}
onClick={() => (opened ? toggle() : null)} onClick={() => (opened ? toggle() : null)}
/> />
<NavLink <NavLink

View File

@ -23,9 +23,7 @@ type FlightBaseSchema = {
time_xc: number; time_xc: number;
dist_xc: number; dist_xc: number;
takeoffs_day: number;
landings_day: number; landings_day: number;
takeoffs_night: number;
landings_night: number; landings_night: number;
time_instrument: number; time_instrument: number;