Skip to content

Commit

Permalink
feat(about): add route for about component
Browse files Browse the repository at this point in the history
  • Loading branch information
mrMetalWood committed Apr 13, 2021
1 parent 86c1c78 commit 3422e5a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React, {FunctionComponent} from 'react';
import {useHistory} from 'react-router-dom';
import AboutProject from '../about-project/about-project';
import Overlay from '../overlay/overlay';

const AboutProjectStandalone: FunctionComponent = () => {
const history = useHistory();

return (
<Overlay onClose={() => history.push('/')}>{<AboutProject />}</Overlay>
);
};

export default AboutProjectStandalone;
5 changes: 3 additions & 2 deletions src/scripts/components/main/app/app.styl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
font-family: NotesEsaBold
src: url('../../../../../assets/fonts/NotesEsaBol.otf')

:global(html), :global(body), :global(#app)
:global(html),
:global(body),
:global(#app)
overflow: hidden
margin: 0
height: 100%
Expand All @@ -37,7 +39,6 @@
top: emCalc(19px)
left: emCalc(22px)
z-index: 4
pointer-events: none
fill: $textWhite

@media screen and (max-width: 480px)
Expand Down
19 changes: 15 additions & 4 deletions src/scripts/components/main/app/app.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, {FunctionComponent} from 'react';
import {Provider as StoreProvider, useSelector} from 'react-redux';
import {IntlProvider} from 'react-intl';
import {HashRouter as Router, Switch, Route} from 'react-router-dom';
import {HashRouter as Router, Switch, Route, Link} from 'react-router-dom';
import {MatomoProvider, createInstance} from '@datapunt/matomo-tracker-react';

import {languageSelector} from '../../../selectors/language';
Expand All @@ -21,6 +21,7 @@ import PresentationSelector from '../../stories/presentation-selector/presentati
import ShowcaseSelector from '../../stories/showcase-selector/showcase-selector';
import DataViewer from '../data-viewer/data-viewer';
import Tracking from '../tracking/tracking';
import AboutProjectStandalone from '../about-project-standalone/about-project';

import translations from '../../../i18n';
import {useStoryMarkers} from '../../../hooks/use-story-markers';
Expand Down Expand Up @@ -50,20 +51,30 @@ const TranslatedApp: FunctionComponent = () => {
const markers = useStoryMarkers();
const language = useSelector(languageSelector);

const logo = (
<Link to="/about">
<div className={styles.logo}>
<EsaLogo />
</div>
</Link>
);

return (
<Router>
<IntlProvider locale={language} messages={translations[language]}>
<Switch>
<Route path="/" exact>
<div className={styles.logo}>
<EsaLogo />
</div>
{logo}
<DataViewer markers={markers} backgroundColor={'#10161A'} />
<Navigation />
<TimeSlider />
<DataSetInfo />
<LayerSelector />
</Route>
<Route path="/about" exact>
{logo}
<AboutProjectStandalone />
</Route>
<Route path="/stories" exact>
<StoriesSelector />
</Route>
Expand Down

0 comments on commit 3422e5a

Please sign in to comment.