Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
feat(page): render ForwardedDestinations chart on main page
Browse files Browse the repository at this point in the history
  ## what
  - Render ForwardedDestinations chart

  ## how
  - use Grid to set the width
    - use 50% space when on a medium size screen
    - use 100% space when on a extra-small size screen
  - render ForwardedDestinations component
    - pass prop `isLoading`
    - pass prop `data`

  ## why

  ## where
  - ./src/pages/index.tsx

  ## usage
  • Loading branch information
Clumsy-Coder committed Nov 7, 2022
1 parent 64cb0a7 commit fdff8da
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import Grid from '@mui/material/Unstable_Grid2';
import type { NextPage } from 'next';
import Head from 'next/head';

import ForwardedDestinations from '@components/Charts/ForwardDestinations';
import Summary from '@components/Summary';
import { useGetSummaryQuery } from '@redux/Summary';
import { useGetForwardedDestinationsQuery } from '@redux/ForwardedDestinations';
import { useGetSummaryQuery } from '@redux/Summary';

const Home: NextPage = () => {
const { data: summaryData, isLoading: summaryIsLoading } = useGetSummaryQuery(undefined, {
Expand All @@ -28,6 +29,12 @@ const Home: NextPage = () => {
<Grid xs={12}>
<Summary data={summaryData} isLoading={summaryIsLoading} />
</Grid>
<Grid xs={12} md={6}>
<ForwardedDestinations
data={forwardedDestinationData}
isLoading={forwardedDestinationsIsLoading}
/>
</Grid>
</Grid>
</Box>
);
Expand Down

0 comments on commit fdff8da

Please sign in to comment.