feat: fe mobile responsive next (#1609)

This commit is contained in:
Yuhao
2023-11-27 11:47:48 +08:00
committed by GitHub
parent 3cc697832a
commit a9c1c7d239
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}
</>