Skip to content

Commit

Permalink
fix: add charte url to partner card
Browse files Browse the repository at this point in the history
  • Loading branch information
MaGOs92 committed Dec 12, 2023
1 parent ba02616 commit 72a04fa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion components/bases-locales/charte/partner.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {getMairie} from '@/lib/api-etablissements-public'

import MairieContact from '@/components/mairie/mairie-contact'
import ActionButtonNeutral from '@/components/action-button-neutral'
import ButtonLink from '@/components/button-link'

const StyledActionButtonNeutral = styled(ActionButtonNeutral)`
display: flex;
Expand All @@ -33,7 +34,7 @@ function Partner({partnerInfos, isCommune}) {
const [isDisplay, setIsDisplay] = useState(false)
const [mairieContact, setMairieContact] = useState(null)

const {name, link, infos, perimeter, codeCommune, services, testimonyURL, isCompany, picture} = partnerInfos
const {name, link, infos, perimeter, codeCommune, services, testimonyURL, isCompany, picture, charteURL} = partnerInfos
const Chevron = isDisplay ? ChevronUp : ChevronDown

const getMairieInfos = useCallback(async () => {
Expand Down Expand Up @@ -104,6 +105,11 @@ function Partner({partnerInfos, isCommune}) {
<a className='temoignage'>Voir le témoignage</a>
</Link>
)}
{charteURL && (
<ButtonLink href={charteURL} isExternal target='_blank' label={`Voir la charte de ${name}`} style={{marginTop: '10px'}}>
Voir la charte
</ButtonLink>
)}
</div>
)}

Expand Down Expand Up @@ -225,6 +231,7 @@ Partner.propTypes = {
perimeter: PropTypes.string,
services: PropTypes.array,
testimonyURL: PropTypes.string,
charteURL: PropTypes.string,
picture: PropTypes.string.isRequired,
isCompany: PropTypes.bool
}).isRequired,
Expand Down

0 comments on commit 72a04fa

Please sign in to comment.