-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deals with the absence of data on the selected date
- Loading branch information
Showing
8 changed files
with
91 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import React, {useContext} from 'react' | ||
import PropTypes from 'prop-types' | ||
import {Info} from 'react-feather' | ||
|
||
import colors from '../styles/colors' | ||
|
||
import {formatDate} from '../lib/date' | ||
|
||
import {ThemeContext} from '../pages' | ||
|
||
import theme from '../styles/theme' | ||
|
||
const DateWarning = ({date}) => { | ||
const themeContext = useContext(ThemeContext) | ||
return ( | ||
<div className='date-warning'> | ||
<div><Info /></div> | ||
<div>Les données du jour sélectionné ne sont pas encore disponibles. Les données affichées sont celles du <b>{formatDate(date)}</b>.</div> | ||
|
||
<style jsx>{` | ||
.date-warning { | ||
display: flex; | ||
color: #fff; | ||
justify-content: center; | ||
align-items: center; | ||
padding: 0.4em; | ||
background-color: ${themeContext.secondary}; | ||
box-shadow: 0 1px 4px ${colors.lightGrey}; | ||
} | ||
.date-warning b { | ||
text-decoration: underline; | ||
} | ||
.date-warning > div { | ||
margin: 0 0.2em; | ||
} | ||
@media (max-width: ${theme.mobileDisplay}) { | ||
.date-warning { | ||
font-size: 0.8em; | ||
box-shadow: ’’; | ||
} | ||
} | ||
`}</style> | ||
</div> | ||
) | ||
} | ||
|
||
DateWarning.propTypes = { | ||
date: PropTypes.string.isRequired | ||
} | ||
|
||
export default DateWarning |
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 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