Skip to content

Commit

Permalink
Strictly check attributes in button wrappers (#44869)
Browse files Browse the repository at this point in the history
  • Loading branch information
bl-nero authored Aug 5, 2024
1 parent ef9c519 commit 02b0440
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 16 deletions.
12 changes: 6 additions & 6 deletions web/packages/design/src/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -393,21 +393,21 @@ const StyledButton = styled.button`
${themedStyles}
`;

export const ButtonPrimary = <E extends React.ElementType>(
export const ButtonPrimary = <E extends React.ElementType = 'button'>(
props: ButtonProps<E>
) => <Button fill="filled" intent="primary" {...props} />;
export const ButtonSecondary = <E extends React.ElementType>(
export const ButtonSecondary = <E extends React.ElementType = 'button'>(
props: ButtonProps<E>
) => <Button fill="filled" intent="neutral" {...props} />;
export const ButtonBorder = <E extends React.ElementType>(
export const ButtonBorder = <E extends React.ElementType = 'button'>(
props: ButtonProps<E>
) => <Button fill="border" intent="neutral" {...props} />;
export const ButtonWarning = <E extends React.ElementType>(
export const ButtonWarning = <E extends React.ElementType = 'button'>(
props: ButtonProps<E>
) => <Button fill="filled" intent="danger" {...props} />;
export const ButtonWarningBorder = <E extends React.ElementType>(
export const ButtonWarningBorder = <E extends React.ElementType = 'button'>(
props: ButtonProps<E>
) => <Button fill="border" intent="danger" {...props} />;
export const ButtonText = <E extends React.ElementType>(
export const ButtonText = <E extends React.ElementType = 'button'>(
props: ButtonProps<E>
) => <Button fill="minimal" intent="neutral" {...props} />;
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ type SortMenuProps = {
sortType: string;
sortDir: SortDir;
onChange: (value: string) => void;
onDirChange: (dir: SortDir) => void;
onDirChange: () => void;
};

const SortMenu: React.FC<SortMenuProps> = props => {
Expand Down
2 changes: 1 addition & 1 deletion web/packages/teleport/src/JoinTokens/JoinTokens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ function TokenDelete({
attempt,
}: {
token: JoinToken;
onDelete: (token: string) => Promise<any>;
onDelete: () => void;
onClose: () => void;
attempt: Attempt<void>;
}) {
Expand Down
8 changes: 1 addition & 7 deletions web/packages/teleport/src/Login/Motd/Motd.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ export function Motd({ message, onClick }: Props) {
<StyledText typography="body1" mb={3} textAlign="left">
{message}
</StyledText>
<ButtonPrimary
width="100%"
mt={3}
size="large"
onClick={onClick}
align="center"
>
<ButtonPrimary width="100%" mt={3} size="large" onClick={onClick}>
Acknowledge
</ButtonPrimary>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ export function TraitsEditor({
<Box mt={5}>
<ButtonBorder
onClick={addNewTraitPair}
label={addLabelText}
css={`
padding-left: 12px;
&:disabled {
Expand Down

0 comments on commit 02b0440

Please sign in to comment.