Skip to content

Commit 715c605

Browse files
committed
improve class type safety
1 parent 62b4e01 commit 715c605

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

src/Display/Display.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function Display() {
4242

4343
return (
4444
<modal.Component title={t("display settings")} size="small">
45-
<div /*id="fr-display"*/ className="fr-display">
45+
<div /*id="fr-display"*/ className={"fr-display"}>
4646
<div className={fr.cx("fr-form-group" as any)}>
4747
<fieldset className={fr.cx("fr-fieldset")}>
4848
<legend
@@ -63,7 +63,10 @@ export function Display() {
6363
id={getInputId(theme)}
6464
name="fr-radios-theme"
6565
/>
66-
<label className="fr-label" htmlFor={getInputId(theme)}>
66+
<label
67+
className={fr.cx("fr-label")}
68+
htmlFor={getInputId(theme)}
69+
>
6770
{t(`${theme} theme`)}
6871
{theme === "system" && (
6972
<span className={fr.cx("fr-hint-text")}>

src/Download.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const Download = memo(
5454
className={cx(fr.cx("fr-download__link"), classes.link)}
5555
>
5656
{label}
57-
<span className="fr-download__detail">{details}</span>
57+
<span className={fr.cx("fr-download__detail")}>{details}</span>
5858
</Link>
5959
</p>
6060
</div>

src/Input.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,9 @@ export const Input = memo(
152152
{...(nativeLabelProps as {})}
153153
>
154154
{label}
155-
{hintText !== undefined && <span className="fr-hint-text">{hintText}</span>}
155+
{hintText !== undefined && (
156+
<span className={fr.cx("fr-hint-text")}>{hintText}</span>
157+
)}
156158
</label>
157159
)}
158160
{(() => {

src/blocks/PasswordInput.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ export const PasswordInput = memo(
142142
htmlFor={inputId}
143143
>
144144
{label}
145-
{hintText !== undefined && <span className="fr-hint-text">{hintText}</span>}
145+
{hintText !== undefined && (
146+
<span className={fr.cx("fr-hint-text")}>{hintText}</span>
147+
)}
146148
</label>
147149
)}
148150
<div className={fr.cx("fr-input-wrap")} ref={setInputWrapperElement}>

src/consentManagement/ConsentBannerAndConsentManagement/ConsentManagement.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ export function createConsentManagement<
320320
};
321321
})()}
322322
/>
323-
<label className="fr-label" htmlFor={acceptInputId}>
323+
<label className={fr.cx("fr-label")} htmlFor={acceptInputId}>
324324
{t("accept")}
325325
</label>
326326
</div>
@@ -421,8 +421,8 @@ export function createConsentManagement<
421421
<div className={fr.cx("fr-consent-service")}>
422422
<fieldset className={fr.cx("fr-fieldset", "fr-fieldset--inline")}>
423423
<legend className={fr.cx("fr-consent-service__title")}>{title}</legend>
424-
<div className="fr-consent-service__radios fr-fieldset--inline">
425-
<div className="fr-radio-group">
424+
<div className={fr.cx("fr-consent-service__radios", "fr-fieldset--inline")}>
425+
<div className={fr.cx("fr-radio-group")}>
426426
<input
427427
type="radio"
428428
id={acceptInputId}

0 commit comments

Comments
 (0)