-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(showcase-title): add title slide in showcase mode (#314)
* feat(showcase-title): add title slide in showcase mode * feat(showcase-title): add exact to presenter route
- Loading branch information
1 parent
88d7767
commit 431778f
Showing
5 changed files
with
68 additions
and
13 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@require '../../../variables.styl' | ||
|
||
.storyTitle | ||
display: flex | ||
flex-direction: column | ||
justify-content: center | ||
align-items: center | ||
height: 60% | ||
font-family: NotesEsa | ||
|
||
.title | ||
color: $main | ||
font-weight: bold | ||
font-size: emCalc(36px) | ||
|
||
.description | ||
margin: 0 | ||
color: $textDefault | ||
font-weight: normal | ||
font-size: emCalc(36px) | ||
font-family: Arial, Helvetica, sans-serif |
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,27 @@ | ||
import React, {FunctionComponent} from 'react'; | ||
import {useHistory} from 'react-router-dom'; | ||
|
||
import {useStoryParams} from '../../hooks/use-story-params'; | ||
import {useInterval} from '../../hooks/use-interval'; | ||
|
||
import styles from './story-title.styl'; | ||
|
||
const StoryTitle: FunctionComponent = () => { | ||
const {storyIds, storyIndex, storyListItem} = useStoryParams(); | ||
const history = useHistory(); | ||
const showcaseStoryIds = storyIds.join('&'); | ||
const nextLink = `/showcase/${showcaseStoryIds}/${storyIndex}/0`; | ||
|
||
useInterval(() => { | ||
history.replace(nextLink); | ||
}, 3000); | ||
|
||
return ( | ||
<div className={styles.storyTitle}> | ||
<h1 className={styles.title}>{storyListItem?.title}</h1> | ||
<h2 className={styles.description}>{storyListItem?.description}</h2> | ||
</div> | ||
); | ||
}; | ||
|
||
export default StoryTitle; |
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