-
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(story-header): move story header to own component
- Loading branch information
1 parent
86153c8
commit babb362
Showing
8 changed files
with
73 additions
and
59 deletions.
There are no files selected for viewing
File renamed without changes.
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,26 @@ | ||
.header | ||
position: absolute | ||
right: 500px | ||
left: 0 | ||
z-index: 1 | ||
display: flex | ||
flex-direction: row | ||
justify-content: space-between | ||
align-items: flex-start | ||
padding: 15px | ||
|
||
> * | ||
color: #fff | ||
|
||
.title | ||
margin: 0 | ||
|
||
.present | ||
.title | ||
font-size: 2em | ||
|
||
.subtitle | ||
font-size: 1.3em | ||
|
||
.backButton | ||
font-size: 1.3em |
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,41 @@ | ||
import React, {FunctionComponent} from 'react'; | ||
import {FormattedMessage} from 'react-intl'; | ||
import {Link} from 'react-router-dom'; | ||
import cx from 'classnames'; | ||
|
||
import styles from './story-header.styl'; | ||
|
||
import {StoryListItem} from '../../types/story-list'; | ||
|
||
interface Props { | ||
mode: string; | ||
story: StoryListItem; | ||
} | ||
|
||
const StoryHeader: FunctionComponent<Props> = ({story, mode}) => { | ||
const Present = mode === 'present'; | ||
const Showcase = mode === 'showcase'; | ||
|
||
const storyClasses = cx( | ||
styles.header, | ||
Present && styles.present, | ||
Showcase && styles.showcase | ||
); | ||
|
||
return ( | ||
<div className={storyClasses}> | ||
<Link to={`/${mode}`} className={styles.backButton}> | ||
<FormattedMessage id="goBack" /> | ||
</Link> | ||
<div> | ||
<h2 className={styles.title}>{story && story.title}</h2> | ||
{Showcase && ( | ||
<h3 className={styles.subtitle}>{story && story.description}</h3> | ||
)} | ||
{Present && <h3 className={styles.subtitle}>Pagination?</h3>} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default StoryHeader; |
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
This file was deleted.
Oops, something went wrong.