refactor: unified cn utils (#29916)
Co-authored-by: yyh <yuanyouhuilyz@gmail.com> Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { ReactNode } from 'react'
|
||||
import { Transition, TransitionChild } from '@headlessui/react'
|
||||
import classNames from '@/utils/classnames'
|
||||
import { cn } from '@/utils/classnames'
|
||||
|
||||
type ContentDialogProps = {
|
||||
className?: string
|
||||
@@ -23,24 +23,20 @@ const ContentDialog = ({
|
||||
>
|
||||
<TransitionChild>
|
||||
<div
|
||||
className={classNames(
|
||||
'absolute inset-0 left-0 w-full bg-app-detail-overlay-bg',
|
||||
className={cn('absolute inset-0 left-0 w-full bg-app-detail-overlay-bg',
|
||||
'duration-300 ease-in data-[closed]:opacity-0',
|
||||
'data-[enter]:opacity-100',
|
||||
'data-[leave]:opacity-0',
|
||||
)}
|
||||
'data-[leave]:opacity-0')}
|
||||
onClick={onClose}
|
||||
/>
|
||||
</TransitionChild>
|
||||
|
||||
<TransitionChild>
|
||||
<div className={classNames(
|
||||
'absolute left-0 w-full border-r border-divider-burn bg-app-detail-bg',
|
||||
<div className={cn('absolute left-0 w-full border-r border-divider-burn bg-app-detail-bg',
|
||||
'duration-100 ease-in data-[closed]:-translate-x-full',
|
||||
'data-[enter]:translate-x-0 data-[enter]:duration-300 data-[enter]:ease-out',
|
||||
'data-[leave]:-translate-x-full data-[leave]:duration-200 data-[leave]:ease-in',
|
||||
className,
|
||||
)}>
|
||||
className)}>
|
||||
{children}
|
||||
</div>
|
||||
</TransitionChild>
|
||||
|
||||
Reference in New Issue
Block a user