feat: new booking confirmation page
This commit is contained in:
@@ -32,7 +32,7 @@ function getIcon(variant: ToastsProps["variant"]) {
|
||||
}
|
||||
}
|
||||
|
||||
export function Toast({ message, onClose, variant }: ToastsProps) {
|
||||
export function Toast({ children, message, onClose, variant }: ToastsProps) {
|
||||
const className = toastVariants({ variant })
|
||||
const Icon = getIcon(variant)
|
||||
return (
|
||||
@@ -40,10 +40,16 @@ export function Toast({ message, onClose, variant }: ToastsProps) {
|
||||
<div className={styles.iconContainer}>
|
||||
{Icon && <Icon color="white" height={24} width={24} />}
|
||||
</div>
|
||||
<Body className={styles.message}>{message}</Body>
|
||||
<Button onClick={onClose} variant="icon" intent="text">
|
||||
<CloseLargeIcon />
|
||||
</Button>
|
||||
{message ? (
|
||||
<Body className={styles.message}>{message}</Body>
|
||||
) : (
|
||||
<div className={styles.content}>{children}</div>
|
||||
)}
|
||||
{onClose ? (
|
||||
<Button onClick={onClose} variant="icon" intent="text">
|
||||
<CloseLargeIcon />
|
||||
</Button>
|
||||
) : null}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -8,6 +8,11 @@
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: var(--Spacing-x-one-and-half) var(--Spacing-x3)
|
||||
var(--Spacing-x-one-and-half) var(--Spacing-x2);
|
||||
}
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
.toast {
|
||||
width: var(--width);
|
||||
|
||||
@@ -2,9 +2,16 @@ import { toastVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
export interface ToastsProps
|
||||
extends Omit<React.AnchorHTMLAttributes<HTMLDivElement>, "color">,
|
||||
VariantProps<typeof toastVariants> {
|
||||
message: React.ReactNode
|
||||
onClose: () => void
|
||||
}
|
||||
export type ToastsProps = Omit<React.HTMLAttributes<HTMLDivElement>, "color"> &
|
||||
VariantProps<typeof toastVariants> & {
|
||||
onClose?: () => void
|
||||
} & (
|
||||
| {
|
||||
children: React.ReactNode
|
||||
message?: never
|
||||
}
|
||||
| {
|
||||
children?: never
|
||||
message: React.ReactNode
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user