feat: fe mobile responsive next (#1609)

This commit is contained in:
Yuhao 2023-11-27 11:47:48 +08:00 • committed by GitHub
commit a9c1c7d239
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
89 changed files with 768 additions and 485 deletions

View file

@ -1,9 +1,10 @@
'use client'
import { Dialog } from '@headlessui/react'
import { useTranslation } from 'react-i18next'
import { XMarkIcon } from '@heroicons/react/24/outline'
import Button from '../button'
type DrawerProps = {
export type IDrawerProps = {
title?: string
description?: string
panelClassname?: string
@ -12,6 +13,7 @@ type DrawerProps = {
mask?: boolean
isOpen: boolean
// closable: boolean
showClose?: boolean
onClose: () => void
onCancel?: () => void
onOk?: () => void
@ -24,11 +26,12 @@ export default function Drawer({
children,
footer,
mask = true,
showClose = false,
isOpen,
onClose,
onCancel,
onOk,
}: DrawerProps) {
}: IDrawerProps) {
const { t } = useTranslation()
return (
<Dialog
@ -52,6 +55,9 @@ export default function Drawer({
>
{title}
</Dialog.Title>}
{showClose && <Dialog.Title className="flex items-center mb-4" as="div">
<XMarkIcon className='w-4 h-4 text-gray-500' onClick={onClose} />
</Dialog.Title>}
{description && <Dialog.Description className='text-gray-500 text-xs font-normal mt-2'>{description}</Dialog.Description>}
{children}
</>