-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
127 changed files
with
4,168 additions
and
1,419 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
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,62 @@ | ||
import { Col, Row } from '@dataesr/react-dsfr'; | ||
import PropTypes from 'prop-types'; | ||
import { FormattedMessage, useIntl } from 'react-intl'; | ||
import { useLocation } from 'react-router-dom'; | ||
|
||
import useLang from '../../utils/Hooks/useLang'; | ||
import Banner from '../Banner'; | ||
import Chip from '../Chip'; | ||
import Icon from '../Icon'; | ||
|
||
function BannerNational({ selected, title, iconId }) { | ||
const intl = useIntl(); | ||
const { lang, urls } = useLang(); | ||
const { search } = useLocation(); | ||
|
||
const renderIcons = ( | ||
<Row justifyContent='center' alignItems='middle' gutters className='mb-32'> | ||
<Col n='12'> | ||
<Icon name={iconId} color1='blue-soft-125' color2='publication-25' /> | ||
</Col> | ||
</Row> | ||
); | ||
|
||
return ( | ||
<Banner | ||
backgroundColor='blue-soft-150' | ||
homeLink={urls.national[lang] + search} | ||
supTitle={<FormattedMessage id='app.header.title-national' />} | ||
title={<FormattedMessage id={title} />} | ||
chip={<Chip />} | ||
icons={renderIcons} | ||
selectNavigation={{ | ||
title: intl.formatMessage({ | ||
id: 'app.navigation.objet-recherche', | ||
}), | ||
selected: intl.formatMessage({ id: selected }), | ||
options: [ | ||
{ | ||
label: intl.formatMessage({ | ||
id: 'app.baro-national.data.title.beta', | ||
}), | ||
value: intl.formatMessage({ id: 'url.data.general' }), | ||
}, | ||
{ | ||
label: intl.formatMessage({ | ||
id: 'app.baro-national.software.title.beta', | ||
}), | ||
value: intl.formatMessage({ id: 'url.software.general' }), | ||
}, | ||
], | ||
}} | ||
/> | ||
); | ||
} | ||
|
||
BannerNational.propTypes = { | ||
iconId: PropTypes.string.isRequired, | ||
selected: PropTypes.string.isRequired, | ||
title: PropTypes.string.isRequired, | ||
}; | ||
|
||
export default BannerNational; |
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
Oops, something went wrong.