Fixed airport responses

This commit is contained in:
2023-12-01 17:30:29 -05:00
parent 1feb713a47
commit 91d8e6c910
7 changed files with 68 additions and 23 deletions

View File

@@ -37,7 +37,7 @@ export interface Metar {
sky_condition: SkyCondition[];
flight_category: 'VFR' | 'MVFR' | 'LIFR' | 'IFR' | 'UNKN';
three_hr_pressure_tendency_mb: number;
maxT_c: number;
minT_c: number;
max_t_c: number;
min_t_c: number;
precip_in: number;
}

View File

@@ -70,7 +70,7 @@ export default function MapTiles() {
}
function metarIcon(airport: Airport) {
function innerIcon({ tag, color, size = 'sm' }: { tag: string; color: string; size?: string }) {
function innerIcon({ tag, color, size = 'xs' }: { tag: string; color: string; size?: string }) {
return new DivIcon({
html: ReactDOMServer.renderToString(
<MantineProvider>

View File

@@ -48,7 +48,13 @@ export default function MetarModal({ airport, isOpen, onClose }: MetarModalProps
}
return (
<Modal opened={isOpen} onClose={onClose} withCloseButton={false} size={'50%'} className='modal'>
<Modal
opened={isOpen}
onClose={onClose}
withCloseButton={false}
size={'50%'}
className='modal'
>
<span className='title'>
<Link href={`/airport/${airport.icao}`}>
{airport.icao} {airport.full_name}
@@ -163,13 +169,14 @@ function MetarInfo({ metar }: { metar: Metar }) {
</Grid>
</Grid.Col>
<Grid.Col className='gutter-row' span={12}>
<Grid style={{ paddingTop: '1em', paddingBottom: '1em' }} gutter={48}>
{metar.weather_phenomena &&
metar.weather_phenomena.map((wx) => (
<Grid.Col span={1}>
<MetarIcon wx={wx} />
</Grid.Col>
))}
<Grid gutter={18}>
<Grid.Col className='gutter-row' span={12}>
<Card shadow='sm' padding='sm' radius='md' style={{ textAlign: 'center' }}>
<Card.Section>
</Card.Section>
</Card>
</Grid.Col>
</Grid>
</Grid.Col>
</Grid.Col>

View File

@@ -15,4 +15,4 @@
.modal .star {
cursor: pointer;
}
}