-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jackson
authored and
jackson
committed
Nov 19, 2024
1 parent
c3dd252
commit daba6fc
Showing
38 changed files
with
17,250 additions
and
15,965 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import * as React from 'react'; | ||
import { PaxCard as PaxCardComponent } from './PaxCard'; | ||
import { PaxTimeRange } from './PaxCard'; | ||
|
||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { Stack } from '@mui/material'; | ||
|
||
const meta: Meta<typeof PaxCardComponent> = { | ||
title: "DRT Components/Features/Pax/PaxCard", | ||
component: PaxCardComponent, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof PaxCardComponent>; | ||
|
||
var startTime1 = new Date(); | ||
var startTime2 = new Date(); | ||
var startTime3 = new Date(); | ||
var endTime1 = new Date(); | ||
var endTime2 = new Date(); | ||
var endTime3 = new Date(); | ||
|
||
|
||
startTime1.setHours(11, 26); | ||
endTime1.setHours(11, 26); | ||
|
||
startTime2.setHours(11, 26); | ||
endTime2.setHours(11, 31); | ||
|
||
startTime3.setHours(11, 31); | ||
endTime3.setHours(11, 36); | ||
|
||
export const PaxCardSingle:Story = { | ||
args: { | ||
EEA: 77, | ||
nonEEA: 128, | ||
eGates: 213, | ||
timeRange: PaxTimeRange.Next5Mins, | ||
startTime: startTime1, | ||
endTime: endTime1 | ||
} | ||
} | ||
|
||
export const PaxCardGroup: Story = { | ||
render: () => { | ||
return ( | ||
<Stack | ||
spacing={2} | ||
direction={'row'} | ||
display="inline-flex" | ||
sx={(theme) => ({ | ||
p:2, | ||
backgroundColor: theme.palette.secondary.light || theme.palette.grey[200] | ||
})}> | ||
<PaxCardComponent | ||
EEA={77} | ||
nonEEA={128} | ||
eGates={213} | ||
timeRange={PaxTimeRange.Next5Mins} | ||
startTime={startTime1} | ||
endTime={endTime1} | ||
/> | ||
<PaxCardComponent | ||
EEA={45} | ||
nonEEA={456} | ||
eGates={987} | ||
timeRange={PaxTimeRange.Next5to10Mins} | ||
startTime={startTime2} | ||
endTime={endTime2} | ||
/> | ||
<PaxCardComponent | ||
EEA={431} | ||
nonEEA={12} | ||
eGates={5} | ||
timeRange={PaxTimeRange.Next10to15Mins} | ||
startTime={startTime3} | ||
endTime={endTime3} | ||
/> | ||
</Stack> | ||
) | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import { BorderBottom } from '@mui/icons-material'; | ||
import { Paper, styled, Theme, Typography, Table, TableHead, TableRow, TableCell, TableBody } from '@mui/material'; | ||
import * as React from 'react'; | ||
|
||
|
||
export enum PaxTimeRange { | ||
Next5Mins = 'Next 5 Mins', | ||
Next5to10Mins = 'Next 5 to 10 Mins', | ||
Next10to15Mins = 'Next 10 to 15 Mins', | ||
} | ||
|
||
export interface IPaxCard { | ||
EEA: number, | ||
nonEEA: number, | ||
eGates: number, | ||
timeRange: PaxTimeRange, | ||
startTime: Date, | ||
endTime: Date, | ||
} | ||
|
||
const StyledPaxCard = styled(Paper)(({theme} : {theme: Theme}) => ({ | ||
display: 'inline-block', | ||
padding: theme.spacing(2), | ||
backgroundColor: theme.palette.grey[100], | ||
'.MuiTableCell-root': { | ||
backgroundColor: theme.palette.background.default, | ||
color: theme.palette.common.black, | ||
padding: `${theme.spacing(1)} ${theme.spacing(0)}` | ||
}, | ||
'& .MuiTableRow-root :first-child': { | ||
paddingRight: theme.spacing(1) | ||
}, | ||
'& .MuiTableCell-head': { | ||
borderBottom: `1px solid ${theme.palette.common.black}`, | ||
}, | ||
'& .MuiTableBody-root .MuiTableCell-root': { | ||
borderBottom: 'none !important', | ||
} | ||
})); | ||
|
||
const formatTime = (datetime:Date) => { | ||
return `${datetime.getHours()}:${datetime.getMinutes()}` | ||
} | ||
|
||
export const PaxCard = ({EEA = 0, nonEEA = 0, eGates = 0, timeRange, startTime, endTime}: IPaxCard) => { | ||
return ( | ||
<StyledPaxCard elevation={0}> | ||
<Typography variant='h5'>{timeRange}</Typography> | ||
<Typography variant='body1'> | ||
{`(${formatTime(startTime)} to ${formatTime(endTime)})`} | ||
</Typography> | ||
<Paper elevation={0} sx={{mt: 1, px: 1}}> | ||
<Table> | ||
<TableHead> | ||
<TableRow> | ||
<TableCell>Estimated pax:</TableCell> | ||
<TableCell align='right'>{ EEA + nonEEA + eGates}</TableCell> | ||
</TableRow> | ||
</TableHead> | ||
<TableBody> | ||
<TableRow> | ||
<TableCell>EEA:</TableCell> | ||
<TableCell align='right'>{ EEA }</TableCell> | ||
</TableRow> | ||
<TableRow> | ||
<TableCell>Non-EEA:</TableCell> | ||
<TableCell align='right'>{ nonEEA }</TableCell> | ||
</TableRow> | ||
<TableRow> | ||
<TableCell>e-gates:</TableCell> | ||
<TableCell align='right'>{ eGates }</TableCell> | ||
</TableRow> | ||
</TableBody> | ||
</Table> | ||
</Paper> | ||
</StyledPaxCard> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { PaxCard } from "./PaxCard"; | ||
export type { IPaxCard, PaxTimeRange } from "./PaxCard"; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 62 additions & 0 deletions
62
src/components/Pax/PaxDatasourceIcon/PaxDatasourceIcon.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import * as React from 'react'; | ||
import { PaxDatasource } from './PaxDatasourceIcon'; | ||
import { DatasourceStatus } from '../PaxUtils'; | ||
|
||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
const meta: Meta<typeof PaxDatasource> = { | ||
title: "DRT Components/Features/Pax/PaxDatasource", | ||
component: PaxDatasource, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof PaxDatasource>; | ||
|
||
export const Estimate: Story = { | ||
args: { | ||
status: DatasourceStatus.Estimate, | ||
}, | ||
}; | ||
|
||
export const PortForecast: Story = { | ||
args: { | ||
status: DatasourceStatus.PortForecast, | ||
}, | ||
}; | ||
|
||
export const DRTForecast: Story = { | ||
args: { | ||
status: DatasourceStatus.DRTForecast, | ||
}, | ||
}; | ||
|
||
export const PortLiveData: Story = { | ||
args: { | ||
status: DatasourceStatus.PortLiveData, | ||
}, | ||
}; | ||
|
||
export const CarrierData: Story = { | ||
args: { | ||
status: DatasourceStatus.CarrierData, | ||
}, | ||
}; | ||
|
||
export const TerminalAverageData: Story = { | ||
args: { | ||
status: DatasourceStatus.TerminalAverageData, | ||
}, | ||
}; | ||
|
||
export const PastCarrierData: Story = { | ||
args: { | ||
status: DatasourceStatus.PastCarrierData, | ||
}, | ||
}; | ||
|
||
export const VerifiedCarrierData: Story = { | ||
args: { | ||
status: DatasourceStatus.VerifiedCarrierData, | ||
}, | ||
}; | ||
|
Oops, something went wrong.