From dca5a541a357b22ec0ab7104a69654a129b8993e Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Tue, 24 Jan 2023 21:22:49 -0800 Subject: [PATCH] Refined base toast styles --- components/Toast/index.scss | 35 +++++++++++++++++++++++++++++++++++ components/Toast/index.tsx | 20 ++++++++++++++------ 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/components/Toast/index.scss b/components/Toast/index.scss index e69de29b..b89923ae 100644 --- a/components/Toast/index.scss +++ b/components/Toast/index.scss @@ -0,0 +1,35 @@ +.Toast { + background: var(--dialog-bg); + border-radius: $card-corner; + box-shadow: 0 1px 12px rgba(0, 0, 0, 0.18); + display: flex; + flex-direction: column; + gap: $unit-2x; + padding: $unit-3x; + + .Header { + align-items: center; + display: flex; + justify-content: space-between; + + h3 { + font-size: $font-regular; + font-weight: $medium; + } + + button { + background: none; + border: none; + font-size: $font-regular; + font-weight: $bold; + + &:hover { + cursor: pointer; + } + } + } + + p { + line-height: 1.3; + } +} diff --git a/components/Toast/index.tsx b/components/Toast/index.tsx index 3e485ffc..95878f2f 100644 --- a/components/Toast/index.tsx +++ b/components/Toast/index.tsx @@ -4,7 +4,7 @@ import classNames from 'classnames' import * as ToastPrimitive from '@radix-ui/react-toast' import './index.scss' -interface Props { +interface Props extends ToastPrimitive.ToastProps { className?: string title?: string content: string @@ -22,16 +22,24 @@ const Toast = ({ return ( - {title && {title}} - {content} +
+ {title && ( + +

{title}

+
+ )} + + × + +
+ +

{content}

+
{children && ( {children} )} - - × -
) }