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,36 +307,18 @@ export default function Flight() {
</Group>
</CollapsibleFieldset>
) : 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%">
<Group grow>
<VerticalLogItem
label="Day"
content={log.landings_day}
/>
<VerticalLogItem
label="Night"
content={log.landings_night}
/>
</Group>
</CollapsibleFieldset>
</Grid.Col>
</Grid>
<CollapsibleFieldset legend="Landings" w="100%">
<Group grow>
<VerticalLogItem
label="Day"
content={log.landings_day}
/>
<VerticalLogItem
label="Night"
content={log.landings_night}
/>
</Group>
</CollapsibleFieldset>
{log.time_instrument ||
log.time_sim_instrument ||
log.holds_instrument ? (

View File

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

View File

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

View File

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

View File

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