Skip to content

Commit

Permalink
style : use dsfr button
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierJp committed Apr 9, 2024
1 parent 1a80d70 commit ddb94bb
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 122 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,25 @@ export function RequestState({ hidePersonalDataRequest }: IProps) {
) : (
throwUnreachableCaseError(hidePersonalDataRequest)
)}
<p role="list" className="fr-mt-3w layout-left">
<ButtonLink
role="listitem"
to="/formulaire/supprimer-donnees-personnelles-entreprise"
>
Faire une autre demande
</ButtonLink>
&nbsp;
<ButtonLink
role="listitem"
to="/api/auth/france-connect/logout?pathFrom=%2Fformulaire%2Fsupprimer-donnees-personnelles-entreprise"
alt
>
Me déconnecter
</ButtonLink>
</p>
<ul className="fr-btns-group fr-btns-group--inline-md fr-btns-group--center">
<li>
<ButtonLink
role="listitem"
to="/formulaire/supprimer-donnees-personnelles-entreprise"
>
Faire une autre demande
</ButtonLink>
</li>
<li>
<ButtonLink
role="listitem"
to="/api/auth/france-connect/logout?pathFrom=%2Fformulaire%2Fsupprimer-donnees-personnelles-entreprise"
alt
>
Me déconnecter
</ButtonLink>
</li>
</ul>
</>
);
}
22 changes: 13 additions & 9 deletions components-ui/button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use client';

import React, { MouseEventHandler, PropsWithChildren } from 'react';
import styles from './style.module.css';
type IProps = {
role?: string;
small?: boolean;
Expand All @@ -23,13 +22,16 @@ const ButtonLink: React.FC<PropsWithChildren<IProps>> = ({
nofollow = false,
onClick = () => {},
}) => (
<div
className={`${styles['button-link']} ${alt ? styles.alt : ''} ${
small ? styles.small : ''
}`}
>
<>
{!to ? (
<button role={role} type="submit" onClick={onClick}>
<button
role={role}
type="submit"
onClick={onClick}
className={`fr-btn ${alt ? ' fr-btn--secondary ' : ''} ${
small ? ' fr-btn--sm ' : ''
}`}
>
{children}
</button>
) : (
Expand All @@ -41,12 +43,14 @@ const ButtonLink: React.FC<PropsWithChildren<IProps>> = ({
(nofollow ? 'nofollow' : '')
}
href={to}
className="no-style-link"
className={`fr-btn ${alt ? ' fr-btn--secondary ' : ''} ${
small ? ' fr-btn--sm ' : ''
}`}
>
{children}
</a>
)}
</div>
</>
);

export default ButtonLink;
50 changes: 0 additions & 50 deletions components-ui/button/style.module.css

This file was deleted.

18 changes: 11 additions & 7 deletions components/error-explanations/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ const ErrorTemplate: React.FC<PropsWithChildren<{}>> = ({ children }) => (
nous puissions trouver la panne 🕵️‍♀️.
</p>
<p>En attendant, vous pouvez toujours :</p>
<div className="layout-left">
<ButtonLink to="/faq" alt>
Consulter notre page d’aide
</ButtonLink>
<span>&nbsp;</span>
<ButtonLink to="/">Retourner à la page d’accueil</ButtonLink>
</div>
<ul className="fr-btns-group fr-btns-group--inline-md">
<li>
<ButtonLink to="/faq" alt>
Consulter notre page d’aide
</ButtonLink>
</li>
<li>
<span>&nbsp;</span>
<ButtonLink to="/">Retourner à la page d’accueil</ButtonLink>
</li>
</ul>
</div>
);

Expand Down
50 changes: 24 additions & 26 deletions components/immatriculations/rne.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,33 +58,31 @@ const ImmatriculationLinks = ({
<INPI />
&nbsp;:
</p>
<div className="layout-center">
<ButtonLink
nofollow={true}
to={`/justificatif-immatriculation-pdf/${uniteLegale.siren}`}
>
<Icon slug="download">
Télécharger le justificatif d’immatriculation
</Icon>
</ButtonLink>
<div className="separator" />
<ButtonLink
target="_blank"
to={
siteLink || `${routes.rne.portail.entreprise}${uniteLegale.siren}`
}
alt
>
⇢ Voir la fiche sur le site de l’INPI
</ButtonLink>
</div>
<ul className="fr-btns-group fr-btns-group--inline-md fr-btns-group--center">
<li>
<ButtonLink
nofollow={true}
to={`/justificatif-immatriculation-pdf/${uniteLegale.siren}`}
>
<Icon slug="download">
Télécharger le justificatif d’immatriculation
</Icon>
</ButtonLink>
</li>
<li>
<ButtonLink
target="_blank"
to={
siteLink ||
`${routes.rne.portail.entreprise}${uniteLegale.siren}`
}
alt
>
⇢ Voir la fiche sur le site de l’INPI
</ButtonLink>
</li>
</ul>
</PrintNever>
<style jsx>{`
.separator {
width: 10px;
height: 10px;
}
`}</style>
</>
);
};
Expand Down
17 changes: 10 additions & 7 deletions pages/erreur/acces-refuse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ const Forbidden: NextPageWithLayout = () => {
robot et que le problème se reproduit, vous pouvez nous contacter via
notre FAQ.
</p>
<div className="layout-left">
<ButtonLink to="/faq" alt>
Accéder à la FAQ
</ButtonLink>
<span>&nbsp;</span>
<ButtonLink to="/">Retourner à la page d’accueil</ButtonLink>
</div>
<ul className="fr-btns-group fr-btns-group--inline-md">
<li>
<ButtonLink to="/faq" alt>
Accéder à la FAQ
</ButtonLink>
</li>
<li>
<ButtonLink to="/">Retourner à la page d’accueil</ButtonLink>
</li>
</ul>
</>
);
};
Expand Down
17 changes: 10 additions & 7 deletions pages/erreur/trop-de-demandes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ const TooManyRequest: NextPageWithLayout = () => {
<p>
Si le problème se reproduit, vous pouvez nous contacter via notre FAQ.
</p>
<div className="layout-left">
<ButtonLink to="/faq" alt>
Accéder à la FAQ
</ButtonLink>
<span>&nbsp;</span>
<ButtonLink to="/">Retourner à la page d’accueil</ButtonLink>
</div>
<ul className="fr-btns-group fr-btns-group--inline-md">
<li>
<ButtonLink to="/faq" alt>
Accéder à la FAQ
</ButtonLink>
</li>
<li>
<ButtonLink to="/">Retourner à la page d’accueil</ButtonLink>
</li>
</ul>
</>
);
};
Expand Down

0 comments on commit ddb94bb

Please sign in to comment.