feat(BOOK-743): Replaced deprecated Button component
Approved-by: Bianca Widstam
This commit is contained in:
@@ -1,65 +1,7 @@
|
||||
import {
|
||||
type ButtonProps as _ButtonProps,
|
||||
OldDSButton as Button,
|
||||
} from "@scandic-hotels/design-system/OldDSButton"
|
||||
|
||||
import styles from "./footer.module.css"
|
||||
|
||||
import type { ButtonHTMLAttributes, PropsWithChildren } from "react"
|
||||
import type { ButtonProps as ReactAriaButtonProps } from "react-aria-components"
|
||||
import type { PropsWithChildren } from "react"
|
||||
|
||||
export default function Footer({ children }: PropsWithChildren) {
|
||||
return <footer className={styles.footer}>{children}</footer>
|
||||
}
|
||||
|
||||
interface ButtonProps extends PropsWithChildren {
|
||||
intent?: _ButtonProps["intent"]
|
||||
onClick?: ReactAriaButtonProps["onPress"]
|
||||
type?: ButtonHTMLAttributes<HTMLButtonElement>["type"]
|
||||
}
|
||||
|
||||
interface PrimaryButtonProps extends ButtonProps {
|
||||
disabled?: boolean
|
||||
form?: string
|
||||
}
|
||||
|
||||
Footer.Primary = function PrimaryButton({
|
||||
children,
|
||||
disabled = false,
|
||||
form,
|
||||
intent = "primary",
|
||||
onClick,
|
||||
type = "button",
|
||||
}: PrimaryButtonProps) {
|
||||
return (
|
||||
<Button
|
||||
disabled={disabled}
|
||||
form={form}
|
||||
intent={intent}
|
||||
onClick={onClick}
|
||||
theme="base"
|
||||
type={type}
|
||||
>
|
||||
{children}
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
Footer.Secondary = function SecondaryButton({
|
||||
children,
|
||||
intent = "text",
|
||||
onClick,
|
||||
type = "button",
|
||||
}: ButtonProps) {
|
||||
return (
|
||||
<Button
|
||||
color="burgundy"
|
||||
intent={intent}
|
||||
onClick={onClick}
|
||||
theme="base"
|
||||
type={type}
|
||||
>
|
||||
{children}
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user