From 102c86161729557f59b0c35d91f6a6ac703e7168 Mon Sep 17 00:00:00 2001 From: Wahyu Kurniawan Date: Thu, 14 Mar 2024 21:49:13 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20style:=20adjust=20modal=20theme?= =?UTF-8?q?=20and=20add=20wavy=20border=20on=20the=20header?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/shared/Modal/Modal.theme.ts | 54 ++++++++++--------- .../shared/Modal/ModalHeader/ModalHeader.tsx | 54 ++++++++++--------- 2 files changed, 59 insertions(+), 49 deletions(-) diff --git a/packages/frontend/src/components/shared/Modal/Modal.theme.ts b/packages/frontend/src/components/shared/Modal/Modal.theme.ts index 81dec838..4552ff70 100644 --- a/packages/frontend/src/components/shared/Modal/Modal.theme.ts +++ b/packages/frontend/src/components/shared/Modal/Modal.theme.ts @@ -7,30 +7,40 @@ export const modalTheme = tv({ 'z-modal', 'fixed', 'inset-0', - 'bg-bg-base/90', + 'bg-black/80', 'backdrop-blur-sm', 'overflow-y-auto', 'flex', 'justify-center', - 'items-center', - 'p-6', + 'items-end', + 'sm:items-center', + 'p-0', 'sm:p-10', 'data-[state=closed]:animate-[dialog-overlay-hide_200ms]', 'data-[state=open]:animate-[dialog-overlay-show_200ms]', 'data-[state=closed]:hidden', // Fix overlay not close when modal is closed ], - close: [ - 'absolute', - 'right-6', - 'top-5', - 'sm:right-10', - 'sm:top-[38px]', - 'z-[1]', + close: ['absolute', 'right-4', 'top-2', 'sm:right-6', 'sm:top-3', 'z-[1]'], + header: [ + 'flex', + 'flex-col', + 'gap-4', + 'items-start', + 'px-4', + 'py-4', + 'sm:px-6', + 'sm:py-5', + 'bg-base-bg-alternate', ], - header: ['flex', 'flex-col', 'gap-2', 'items-start', 'px-6', 'sm:px-10'], - headerTitle: ['text-lg', 'sm:text-xl', 'text-text-em-high'], - headerDescription: ['text-sm', 'text-text-em-low'], - footer: ['flex', 'justify-end', 'gap-3', 'sm:gap-4', 'px-6', 'sm:px-10'], + headerTitle: [ + 'text-base', + 'sm:text-lg', + 'tracking-[0.011em]', + 'sm:tracking-normal', + 'text-elements-high-em', + ], + headerDescription: ['text-sm', 'text-elements-low-em'], + footer: ['flex', 'gap-3', 'px-4', 'pb-4', 'pt-7', 'sm:pb-6', 'sm:px-6'], content: [ 'h-fit', 'sm:min-h-0', @@ -38,19 +48,15 @@ export const modalTheme = tv({ 'relative', 'flex', 'flex-col', - 'gap-y-8', - 'py-6', - 'sm:py-10', 'overflow-hidden', 'w-full', - 'max-w-[560px]', - 'rounded-xl', - 'bg-surface-base', - 'border', - 'border-border-base', - 'text-text-em-high', + 'sm:max-w-[562px]', + 'rounded-2xl', + 'bg-base-bg', + 'shadow-card', + 'text-elements-high-em', ], - body: ['flex-1', 'px-6', 'sm:px-10'], + body: ['flex-1', 'px-4', 'pt-4', 'sm:pt-6', 'sm:px-6'], }, variants: { fullPage: { diff --git a/packages/frontend/src/components/shared/Modal/ModalHeader/ModalHeader.tsx b/packages/frontend/src/components/shared/Modal/ModalHeader/ModalHeader.tsx index ca588db9..c0783847 100644 --- a/packages/frontend/src/components/shared/Modal/ModalHeader/ModalHeader.tsx +++ b/packages/frontend/src/components/shared/Modal/ModalHeader/ModalHeader.tsx @@ -4,6 +4,7 @@ import { Description, Title } from '@radix-ui/react-dialog'; import type { ComponentPropsWithoutRef, PropsWithChildren } from 'react'; import { Heading } from 'components/shared/Heading'; import { modalTheme } from 'components/shared/Modal/Modal.theme'; +import { WavyBorder } from 'components/shared/WavyBorder'; type ModalHeaderProps = ComponentPropsWithoutRef<'div'> & { className?: string; @@ -23,30 +24,33 @@ export const ModalHeader = ({ const { header, headerDescription, headerTitle } = modalTheme(); return ( -
- - <Heading - {...headingProps} - className={headerTitle({ className: headingProps?.className })} - > - {children} - </Heading> - - {description && ( - - {description} - - )} -
+ <> +
+ + <Heading + {...headingProps} + className={headerTitle({ className: headingProps?.className })} + > + {children} + </Heading> + + {description && ( + + {description} + + )} +
+ + ); };