Skip to content

Commit

Permalink
Feat/stories button (#159)
Browse files Browse the repository at this point in the history
* feat(stories-button): add button and story selector mode

* feat(stories-button): add position for button and multiple languages

* feat(stories-button): add translations

* refactor(stories-button): remove typo
  • Loading branch information
KatvonRivia authored Oct 16, 2019
1 parent d981b7c commit 03da065
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 6 deletions.
7 changes: 5 additions & 2 deletions i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
"layerSelector.main": "Haupt",
"layerSelector.compare": "Vergleich",
"language.en": "Englisch",
"language.de": "Deutsch"
}
"language.de": "Deutsch",
"stories": "Geschichten",
"goBack": "Zurück",
"storymode": "Geschichtsmodus"
}
7 changes: 5 additions & 2 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
"layerSelector.main": "Main",
"layerSelector.compare": "Compare",
"language.en": "English",
"language.de": "German"
}
"language.de": "German",
"stories": "Stories",
"goBack": "Go back",
"storymode": "Story Mode"
}
8 changes: 7 additions & 1 deletion src/scripts/components/app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ import Menu from '../menu/menu';
import ProjectionMenu from '../projection-menu/projection-menu';
import PresentationSelector from '../presentation-selector/presentation-selector';
import ShowcaseSelector from '../showcase-selector/showcase-selector';
import StoriesSelector from '../stories-selector/stories-selector';
import StoriesButton from '../stories-button/stories-button';
import UrlSync from '../url-sync/url-sync';

import translations from '../../i18n';

import styles from './app.styl';

const store = createStore(
Expand All @@ -41,6 +42,7 @@ const TranslatedApp: FunctionComponent<{}> = () => {
<Switch>
<Route path="/" exact>
<Globes />
<StoriesButton />

<div className={styles.layoutContainer}>
<Menu />
Expand All @@ -57,6 +59,10 @@ const TranslatedApp: FunctionComponent<{}> = () => {
<Route path="/showcase">
<ShowcaseSelector />
</Route>

<Route path="/stories">
<StoriesSelector />
</Route>
</Switch>
</div>
</IntlProvider>
Expand Down
1 change: 0 additions & 1 deletion src/scripts/components/menu/menu.styl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.menuContainer
position: relative
align-self: left
margin: 20px

.menuButton
Expand Down
10 changes: 10 additions & 0 deletions src/scripts/components/stories-button/stories-button.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.storiesButton
position: absolute
top: 15px
right: 15px
padding: 10px
border-radius: 5px
background-color: #ccc
color: #000
text-decoration: none
cursor: pointer
13 changes: 13 additions & 0 deletions src/scripts/components/stories-button/stories-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React, {FunctionComponent} from 'react';
import {Link} from 'react-router-dom';
import {FormattedMessage} from 'react-intl';

import styles from './stories-button.styl';

const StoriesButton: FunctionComponent<{}> = () => (
<Link to={'/stories'} className={styles.storiesButton}>
<FormattedMessage id="stories" />
</Link>
);

export default StoriesButton;
12 changes: 12 additions & 0 deletions src/scripts/components/stories-selector/stories-selector.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.storiesSelector
width: 100%
height: 100%

.title
text-align: center
font-size: 1.7em

.backButton
display: block
padding: 20px 0 0 20px
cursor: pointer
21 changes: 21 additions & 0 deletions src/scripts/components/stories-selector/stories-selector.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React, {FunctionComponent} from 'react';
import {Link} from 'react-router-dom';
import {FormattedMessage} from 'react-intl';

import StoryList from '../story-list/story-list';

import styles from './stories-selector.styl';

const StoriesSelector: FunctionComponent<{}> = () => (
<div className={styles.storiesSelector}>
<Link to="/" className={styles.backButton}>
<FormattedMessage id="goBack" />
</Link>
<h1 className={styles.title}>
<FormattedMessage id="storymode" />
</h1>
<StoryList />
</div>
);

export default StoriesSelector;

0 comments on commit 03da065

Please sign in to comment.