♻️(react) update Button component props and refactor related components
This commit modifies the Button component to switch the `variant` and `color` props, ensuring consistency across various components that utilize the Button. The changes include updates in the Alert, Modal, Tooltip, and other components to reflect this new prop structure. Additionally, several test and story files have been adjusted to accommodate these changes, enhancing the overall component architecture.
This commit is contained in:
committed by
NathanVss
parent
f93a83655c
commit
748d070bd9
@@ -97,7 +97,7 @@ describe("<Toast />", () => {
|
||||
<Button
|
||||
onClick={() =>
|
||||
toast("Toast content", VariantType.NEUTRAL, {
|
||||
actions: <Button color="tertiary">Tertiary</Button>,
|
||||
actions: <Button variant="tertiary">Tertiary</Button>,
|
||||
})
|
||||
}
|
||||
>
|
||||
|
||||
@@ -78,8 +78,8 @@ export const InfoCustom: Story = {
|
||||
type: VariantType.INFO,
|
||||
actions: (
|
||||
<>
|
||||
<Button color="primary">Primary</Button>
|
||||
<Button color="secondary">Secondary</Button>
|
||||
<Button variant="primary">Primary</Button>
|
||||
<Button variant="secondary">Secondary</Button>
|
||||
</>
|
||||
),
|
||||
},
|
||||
|
||||
@@ -45,7 +45,7 @@ export const Toast = (props: ToastProps) => {
|
||||
|
||||
const removeAfterAnimation = async () => {
|
||||
await Promise.allSettled(
|
||||
container.current!.getAnimations().map((animation) => animation.finished),
|
||||
container.current!.getAnimations().map((animation) => animation.finished)
|
||||
);
|
||||
props.onDelete?.();
|
||||
};
|
||||
@@ -71,7 +71,7 @@ export const Toast = (props: ToastProps) => {
|
||||
{props.primaryLabel && (
|
||||
<div className="c__toast__content__buttons">
|
||||
<Button
|
||||
color="primary"
|
||||
variant="primary"
|
||||
onClick={props.primaryOnClick}
|
||||
{...props.primaryProps}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user