Skip to content

Commit bc9eda3

Browse files
committed
#135: Common should be applied to the variant
1 parent 485df56 commit bc9eda3

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

src/AgentConnectButton.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@ import { assert, type Equals } from "tsafe/assert";
66
import "./assets/agentconnect.css";
77
import { cx } from "./tools/cx";
88

9-
export type AgentConnectButtonProps = AgentConnectButtonProps.Common &
10-
(AgentConnectButtonProps.WithUrl | AgentConnectButtonProps.WithOnClick);
9+
export type AgentConnectButtonProps =
10+
| AgentConnectButtonProps.WithUrl
11+
| AgentConnectButtonProps.WithOnClick;
1112

1213
export namespace AgentConnectButtonProps {
13-
export type Common = {
14+
type Common = {
1415
className?: string;
1516
style?: CSSProperties;
1617
};
17-
export type WithUrl = {
18+
export type WithUrl = Common & {
1819
url: string;
1920
onClick?: never;
2021
};
21-
export type WithOnClick = {
22+
export type WithOnClick = Common & {
2223
url?: never;
2324
onClick: React.MouseEventHandler<HTMLButtonElement>;
2425
};

src/FranceConnectButton.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,23 @@ import { fr } from "./fr";
55
import { assert, type Equals } from "tsafe/assert";
66
import { cx } from "./tools/cx";
77

8-
export type FranceConnectButtonProps = FranceConnectButtonProps.Common &
9-
(FranceConnectButtonProps.WithUrl | FranceConnectButtonProps.WithOnClick);
8+
export type FranceConnectButtonProps =
9+
| FranceConnectButtonProps.WithUrl
10+
| FranceConnectButtonProps.WithOnClick;
1011

1112
export namespace FranceConnectButtonProps {
12-
export type Common = {
13+
type Common = {
1314
className?: string;
1415
/** Default: false */
1516
plus?: boolean;
1617
classes?: Partial<Record<"root" | "login" | "brand", string>>;
1718
style?: CSSProperties;
1819
};
19-
export type WithUrl = {
20+
export type WithUrl = Common & {
2021
url: string;
2122
onClick?: never;
2223
};
23-
export type WithOnClick = {
24+
export type WithOnClick = Common & {
2425
url?: never;
2526
onClick: React.MouseEventHandler<HTMLButtonElement>;
2627
};

src/MonCompteProButton.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,21 @@ import { assert, type Equals } from "tsafe/assert";
66
import { cx } from "./tools/cx";
77
import "./assets/moncomptepro.css";
88

9-
export type FranceConnectButtonProps = FranceConnectButtonProps.Common &
10-
(FranceConnectButtonProps.WithUrl | FranceConnectButtonProps.WithOnClick);
9+
export type FranceConnectButtonProps =
10+
| FranceConnectButtonProps.WithUrl
11+
| FranceConnectButtonProps.WithOnClick;
1112

1213
export namespace FranceConnectButtonProps {
13-
export type Common = {
14+
type Common = {
1415
className?: string;
1516
classes?: Partial<Record<"root" | "login" | "brand", string>>;
1617
style?: CSSProperties;
1718
};
18-
export type WithUrl = {
19+
export type WithUrl = Common & {
1920
url: string;
2021
onClick?: never;
2122
};
22-
export type WithOnClick = {
23+
export type WithOnClick = Common & {
2324
url?: never;
2425
onClick: React.MouseEventHandler<HTMLButtonElement>;
2526
};

0 commit comments

Comments
 (0)