-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Upgrade to react-router-dom@v4.2.2 - Add OffCanvasPanel styleguide component - Update styleguide with some basic screens
- Loading branch information
Richard Palmer
committed
Sep 12, 2017
1 parent
72843c3
commit 024c453
Showing
28 changed files
with
668 additions
and
66 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 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.
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,57 @@ | ||
.root { | ||
position: relative; | ||
} | ||
|
||
.navigationSm { | ||
padding-top: var(--size-lg-ii); | ||
padding-bottom: var(--size-lg-i); | ||
} | ||
|
||
.navigationLg { | ||
display: none; | ||
} | ||
|
||
.body { | ||
padding-top: calc(3 * var(--size-regular)); | ||
padding-left: var(--size-regular); | ||
padding-right: var(--size-regular); | ||
width: 100%; | ||
} | ||
|
||
.menuBtn { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
padding: var(--size-regular); | ||
color: var(--color-greyDarker); | ||
} | ||
|
||
@media(min-width: 56.25rem) { | ||
.root { | ||
display: flex; | ||
} | ||
|
||
.menuBtn { | ||
display: none; | ||
} | ||
|
||
.navigationSm { | ||
display: none; | ||
} | ||
|
||
.navigationLg { | ||
display: block; | ||
padding-top: var(--size-lg-ii); | ||
padding-left: var(--size-lg-i); | ||
padding-right: var(--size-lg-i); | ||
transform: translate3d(0, 0, 0); | ||
flex-basis: 30%; | ||
position: relative; | ||
} | ||
|
||
.body { | ||
flex-basis: 70%; | ||
margin-top: 0; | ||
padding: var(--size-lg-ii); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,27 +1,82 @@ | ||
import React from 'react'; | ||
import { BrowserRouter, Match, Miss, Link } from 'react-router'; | ||
import React, { Component } from 'react'; | ||
import { BrowserRouter, Switch, Route } from 'react-router-dom'; | ||
|
||
import SiteHeader from './components/SiteHeader/SiteHeader'; | ||
import Navigation from './components/Navigation/Navigation'; | ||
import OffCanvasPanel from './components/OffCanvasPanel/OffCanvasPanel'; | ||
|
||
import BtnContainer from '../components/BtnContainer/BtnContainer'; | ||
import Icon from '../components/Icon/Icon'; | ||
import ScreenReadable from '../components/ScreenReadable/ScreenReadable'; | ||
|
||
/* Pages */ | ||
import Introduction from './screens/Overview/Introduction'; | ||
import Goals from './screens/Overview/Goals'; | ||
import Faq from './screens/Overview/Faq'; | ||
|
||
import Introduction from './Introduction'; | ||
import Example from './Example'; | ||
import FourOhFour from './404'; | ||
|
||
export default () => ( | ||
<BrowserRouter> | ||
<div> | ||
<nav> | ||
<ul> | ||
<li><Link to="/">Home</Link></li> | ||
<li><Link to="/example">Example</Link></li> | ||
</ul> | ||
</nav> | ||
<div> | ||
<h1>Bloom</h1> | ||
<p>v{ `${process.env.npm_package_version}` }</p> | ||
<Match exactly pattern="/" component={ Introduction } /> | ||
<Match pattern="/example" component={ Example } /> | ||
|
||
<Miss component={ FourOhFour } /> | ||
</div> | ||
</div> | ||
</BrowserRouter> | ||
); | ||
import css from './Styleguide.css'; | ||
|
||
export default class Styleguide extends Component { | ||
state = { | ||
showNavigation: true, | ||
}; | ||
|
||
toggleNavigation = () => { | ||
this.setState(({ showNavigation }) => ({ | ||
showNavigation: !showNavigation, | ||
})); | ||
}; | ||
|
||
openNavigation = () => { | ||
this.setState({ showNavigation: true }); | ||
}; | ||
|
||
closeNavigation = () => { | ||
this.setState({ showNavigation: false }); | ||
}; | ||
|
||
render() { | ||
const { showNavigation } = this.state; | ||
|
||
return ( | ||
<BrowserRouter> | ||
<div className={ css.root }> | ||
<BtnContainer className={ css.menuBtn } onClick={ this.openNavigation }> | ||
<Icon className={ css.menuIcon } name="menu" /> | ||
<ScreenReadable>Open menu</ScreenReadable> | ||
</BtnContainer> | ||
<OffCanvasPanel | ||
className={ css.navigationSm } | ||
activeClassName={ css.navigationActive } | ||
active={ showNavigation } | ||
onClose={ this.closeNavigation } | ||
> | ||
<SiteHeader | ||
version={ process.env.npm_package_version } | ||
onLinkClick={ this.closeMenu } | ||
/> | ||
<Navigation onLinkClick={ this.closeNavigation } /> | ||
</OffCanvasPanel> | ||
<div className={ css.navigationLg }> | ||
<SiteHeader | ||
version={ process.env.npm_package_version } | ||
onLinkClick={ this.closeMenu } | ||
/> | ||
<Navigation onLinkClick={ this.closeNavigation } /> | ||
</div> | ||
<div className={ css.body }> | ||
<Switch> | ||
<Route exact path="/" component={ Introduction } /> | ||
<Route path="/goals" component={ Goals } /> | ||
<Route path="/faq" component={ Faq } /> | ||
|
||
<Route component={ FourOhFour } /> | ||
</Switch> | ||
</div> | ||
</div> | ||
</BrowserRouter> | ||
); | ||
} | ||
} |
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,42 @@ | ||
.section + .section { | ||
margin-top: var(--size-lg-ii); | ||
} | ||
|
||
.title { | ||
composes: fontLargeI from '../../../globals/typography.css'; | ||
color: var(--color-greyDarkest); | ||
padding-left: var(--size-lg-i); | ||
padding-right: var(--size-lg-i); | ||
} | ||
|
||
.linkList { | ||
list-style-type: none; | ||
margin-top: var(--size-sm-i); | ||
margin-left: 0; | ||
margin-left: 0; | ||
margin-bottom: 0; | ||
padding: 0; | ||
} | ||
|
||
.link { | ||
display: block; | ||
composes: fontRegular from '../../../globals/typography.css'; | ||
color: var(--color-greyDark); | ||
padding-top: var(--size-sm-iii); | ||
padding-bottom: var(--size-sm-iii); | ||
padding-left: var(--size-lg-ii); | ||
padding-right: var(--size-lg-ii); | ||
text-decoration: none; | ||
} | ||
|
||
.link:hover { | ||
color: var(--color-grey); | ||
} | ||
|
||
.linkActive { | ||
font-weight: var(--fontweight-demi); | ||
} | ||
|
||
.linkListItem + .linkListItem .link { | ||
margin-top: var(--size-sm-ii); | ||
} |
Oops, something went wrong.