# All files / src/routes index.tsx

62.5% Statements 20/32
100% Branches 2/2
10% Functions 2/20
94.44% Lines 17/18

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    1x
    1x
    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    8x

    8x
     import type { FC } from 'react';
    import loadable from '@loadable/component';
    import * as Urls from 'src/urls';
    import { Route, Switch } from 'react-router';
    import type { Page } from '@cutting/util';
    import { ContactMe } from 'src/components/ContactMe';

    const fallback = <div>loading....</div>;

    const Home = loadable(() => import('src/components/Home'), {
      fallback,
    });

    const OSS = loadable(() => import('src/components/OSS'), {
      fallback,
    });

    const Blog = loadable(() => import('src/components/Blog'), {
      fallback,
    });

    const CV = loadable(() => import('src/components/cv'), {
      fallback,
    });

    const PrivacyPolicy = loadable(() => import('src/components/PrivacyPolicy'), {
      fallback,
    });

    const TermsOfService = loadable(() => import('src/components/TermsOfService'), {
      fallback,
    });

    const Graphs = loadable(() => import(/* webpackPrefetch: true */ 'src/components/Graphs/Landing'), {
      fallback,
    });

    const Viz = loadable(() => import('src/containers/Viz/Viz'), {
      fallback,
    });

    /* eslint-disable react/display-name */
    export const routable: Page[] = [
      {
        heading: 'Home',
        path: Urls.Home,
        component: Home,
        exact: true,
      },
      {
        heading: 'OSS',
        path: Urls.OSS,
        component: OSS,
        exact: true,
      },
      {
        heading: 'Blog',
        path: Urls.Blog,
        component: Blog,
        exact: true,
      },
      {
        heading: 'CV',
        path: Urls.CV,
        component: CV,
        exact: true,
      },
      {
        heading: 'Privacy Policy',
        path: Urls.PrivacyPolicy,
        component: PrivacyPolicy,
        exact: true,
        footerPage: true,
      },
      {
        heading: 'Terms of Service',
        path: Urls.TermsOfService,
        component: TermsOfService,
        exact: true,
        footerPage: true,
      },
      {
        heading: 'COVID-19',
        path: Urls.Covid19,
        component: Graphs,
        exact: false,
        footerPage: false,
      },
      {
        heading: 'Viz',
        path: Urls.Viz,
        component: Viz,
        exact: false,
        footerPage: false,
      },
    ];

    export const Routes: FC = () => (
      <Switch>
        {routable.map(({ path, ...rest }) => (
          <Route key={path} path={path} {...rest} />
        ))}
        <Route path={Urls.ContactMe} component={ContactMe} exact />
      </Switch>
    );

    export const bannerPages = routable.filter((p) => !p.footerPage && p.path !== Urls.Home);

    export const footerPages = routable.filter((p) => p.footerPage);