-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #500 from devinit/development
release/v3.5.2
- Loading branch information
Showing
7 changed files
with
88 additions
and
13 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,69 @@ | ||
import * as React from 'react'; | ||
import { css } from 'glamor'; | ||
import { Container, Grid, Message } from 'semantic-ui-react'; | ||
import * as localforage from 'localforage'; | ||
|
||
const messageStyles = css({ | ||
textAlign: 'center', | ||
marginBottom: '0 !important', | ||
backgroundColor: '#fee7c1 !important', | ||
color: '#794b02 !important' | ||
}); | ||
const textStyle = css({ | ||
fontWeight: 'bold', | ||
paddingRight: '3rem !important' | ||
}); | ||
const closeButtonStyles = css({ | ||
position: 'absolute', | ||
top: '38px', | ||
right: '16px', | ||
cursor: 'pointer' | ||
}); | ||
|
||
class Banner extends React.Component { | ||
state = { showBanner: false }; | ||
|
||
render() { | ||
if (this.state.showBanner) { | ||
return ( | ||
<Container style={ { padding: '1rem' } }> | ||
<Message warning { ...messageStyles } floating size="large"> | ||
<Grid columns={ 2 } container stackable> | ||
<Grid.Row> | ||
<Grid.Column width={ 1 }> | ||
<i aria-hidden="true" className="icon warning sign big"/> | ||
</Grid.Column> | ||
<Grid.Column width={ 15 } { ...textStyle }> | ||
The Development Data Hub is not currently displaying the most up-to-date data, | ||
as it is soon to undergo redevelopment. | ||
If you have any data-related questions please email info@devinit.org | ||
</Grid.Column> | ||
</Grid.Row> | ||
<i aria-hidden="true" className="icon close" { ...closeButtonStyles } onClick={ this.onClose }/> | ||
</Grid> | ||
</Message> | ||
</Container> | ||
); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
componentDidMount() { | ||
localforage.getItem('showBanner').then(showBanner => { | ||
if (showBanner === null) { | ||
this.setState({ showBanner: true }); | ||
localforage.setItem('showBanner', true); | ||
} else { | ||
this.setState({ showBanner }); | ||
} | ||
}); | ||
} | ||
|
||
private onClose = () => { | ||
this.setState({ showBanner: false }); | ||
localforage.setItem('showBanner', false); | ||
} | ||
} | ||
|
||
export default Banner; |
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 @@ | ||
export * from './Banner'; |
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