Skip to content

Commit 637497f

Browse files
committed
Merge branch 'connect-buttons'
2 parents cbc47f4 + bd6ee97 commit 637497f

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

.storybook/preview.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ const { getHardCodedWeight } = (() => {
108108
"components/Tabs",
109109
"components/Stepper",
110110
"components/Button",
111+
"components/FranceConnectButton",
112+
"components/AgentConnectButton",
111113
];
112114

113115
function getHardCodedWeight(kind) {

src/AgentConnectButton.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ import { getAssetUrl } from "./tools/getAssetUrl";
1414

1515
export type AgentConnectButtonProps = {
1616
className?: string;
17-
redirectUrl: string;
17+
url: string;
1818
style?: CSSProperties;
1919
};
2020

2121
/** @see <https://react-dsfr-components.etalab.studio/?path=/docs/components-franceconnectbutton> */
2222
export const AgentConnectButton = memo(
2323
forwardRef<HTMLDivElement, AgentConnectButtonProps>((props, ref) => {
24-
const { className, redirectUrl, style, ...rest } = props;
24+
const { className, url, style, ...rest } = props;
2525

2626
assert<Equals<keyof typeof rest, never>>();
2727

@@ -35,7 +35,7 @@ export const AgentConnectButton = memo(
3535
return (
3636
<div className={className} style={style} ref={ref}>
3737
<a
38-
href={redirectUrl}
38+
href={url}
3939
style={{
4040
"display": "block",
4141
"backgroundImage": "unset"

src/FranceConnectButton.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { cx } from "./tools/cx";
77

88
export type FranceConnectButtonProps = {
99
className?: string;
10-
redirectUrl: string;
10+
url: string;
1111
/** Default: false */
1212
plus?: boolean;
1313
classes?: Partial<Record<"root" | "login" | "brand", string>>;
@@ -17,7 +17,7 @@ export type FranceConnectButtonProps = {
1717
/** @see <https://react-dsfr-components.etalab.studio/?path=/docs/components-franceconnectbutton> */
1818
export const FranceConnectButton = memo(
1919
forwardRef<HTMLDivElement, FranceConnectButtonProps>((props, ref) => {
20-
const { classes = {}, className, redirectUrl, plus = false, style, ...rest } = props;
20+
const { classes = {}, className, url, plus = false, style, ...rest } = props;
2121

2222
assert<Equals<keyof typeof rest, never>>();
2323

@@ -29,7 +29,7 @@ export const FranceConnectButton = memo(
2929
style={style}
3030
ref={ref}
3131
>
32-
<a className={fr.cx("fr-btn", "fr-connect")} href={redirectUrl}>
32+
<a className={fr.cx("fr-btn", "fr-connect")} href={url}>
3333
<span className={cx(fr.cx("fr-connect__login"), classes.login)}>
3434
S’identifier avec
3535
</span>

stories/AgentConnectButton.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ const { meta, getStory } = getStoryFactory({
1313
export default meta;
1414

1515
export const Default = getStory({
16-
"redirectUrl": "https://example.com"
16+
"url": "https://example.com"
1717
});
1818

1919
export const Centered = getStory({
2020
"style": {
2121
"textAlign": "center"
2222
},
23-
"redirectUrl": "https://example.com"
23+
"url": "https://example.com"
2424
});

stories/FranceConnectButton.stories.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ const { meta, getStory } = getStoryFactory({
1313
export default meta;
1414

1515
export const Default = getStory({
16-
"redirectUrl": "https://example.com"
16+
"url": "https://example.com"
1717
});
1818

1919
export const Plus = getStory({
20-
"redirectUrl": "https://example.com",
20+
"url": "https://example.com",
2121
"plus": true
2222
});
2323

2424
export const Centered = getStory({
2525
"style": {
2626
"textAlign": "center"
2727
},
28-
"redirectUrl": "https://example.com"
28+
"url": "https://example.com"
2929
});

0 commit comments

Comments
 (0)