Skip to content

Commit

Permalink
Merge pull request #113 from InseeFr/develop
Browse files Browse the repository at this point in the history
fix: roundabout unnecessary and wrong for on suggester
  • Loading branch information
jdirand authored Oct 18, 2023
2 parents a08e2eb + 2fb105e commit a87d34b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@inseefr/lunatic-dsfr",
"version": "1.0.1",
"version": "1.0.2",
"description": "Couche graphique pour Lunatic reposant sur le Système de Design de l'État (DSFR)",
"repository": {
"type": "git",
Expand Down
16 changes: 2 additions & 14 deletions src/Roundabout/roundabout-it-title.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
import classnames from "classnames";
import { useColors } from "@codegouvfr/react-dsfr/useColors";
import { useStyles } from "tss-react/dsfr";
import { fr } from "@codegouvfr/react-dsfr";

function UnnecessaryText({ unnecessary }: { unnecessary?: string | boolean }) {
const theme = useColors();

if (unnecessary) {
return (
<div className={fr.cx("fr-col-12", "fr-mt-1w")}>
<p
className={fr.cx("fr-mb-0")}
style={{ color: theme.decisions.text.disabled.grey.default }}
>
{unnecessary}
</p>
<p className={fr.cx("fr-mb-0")}>{unnecessary}</p>
</div>
);
}
Expand All @@ -28,7 +20,6 @@ export function RoundaboutItTitle({
label: string;
unnecessary?: string | boolean;
}) {
const theme = useColors();
const { css } = useStyles();

return (
Expand All @@ -46,10 +37,7 @@ export function RoundaboutItTitle({
>
<div className={fr.cx("fr-grid-row")}>
<div className={fr.cx("fr-col-12")}>
<h2
className={classnames("roundabout-it-title", fr.cx("fr-h4", "fr-mb-0"))}
style={unnecessary ? { color: theme.decisions.text.disabled.grey.default } : {}}
>
<h2 className={classnames("roundabout-it-title", fr.cx("fr-h4", "fr-mb-0"))}>
{label}
</h2>
</div>
Expand Down
4 changes: 1 addition & 3 deletions src/Suggester/elements/Label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { fr } from "@codegouvfr/react-dsfr";

type Props = PropsWithChildren<{
id?: string;
htmlFor?: string;
className?: string;
style?: CSSProperties;
description?: ReactNode | Array<{ label: ReactNode; declarationType: string }>;
Expand Down Expand Up @@ -45,11 +44,10 @@ function Description({ value, className }: DescriptionProps) {
return <OneDescription value={value} className={classnames(className)} />;
}

export function Label({ children, id, htmlFor, className, style, description }: Props) {
export function Label({ children, id, className, style, description }: Props) {
if (children) {
return (
<label
htmlFor={htmlFor}
id={id}
className={classnames("lunatic-dsfr-label", fr.cx("fr-label", "fr-mb-1w"), className)}
style={style}
Expand Down

0 comments on commit a87d34b

Please sign in to comment.