修复手机端菜单展开遮罩没有关闭的问题;修复并增强 alert 组件展示效果

This commit is contained in:
2025-06-16 11:27:34 +08:00
parent e2d559d4e0
commit 4344a2985d
5 changed files with 21 additions and 18 deletions

View File

@@ -1,6 +1,10 @@
## TODO ## TODO
window.matchMedia 问题,需要其他方式在布局绘制前得到屏幕宽度 后台首页
- banner 拉伸问题
- 图表组件高度和查询按钮越界问题
- 磁贴组件手机视图竖排,删除“套餐”,“数量”
- 公告查看更多跳转实现
手机端支付页面样式调整为类似电商的底部支付栏 手机端支付页面样式调整为类似电商的底部支付栏
@@ -11,7 +15,7 @@ MDX code 块语法高亮
全局修改断点命名 全局修改断点命名
页头链接完善跳转地址 页头链接完善跳转地址
W
树组件优化 树组件优化
sse 向客户端推送通知与支付结果等事件 sse 向客户端推送通知与支付结果等事件

View File

@@ -55,8 +55,8 @@ export default function Layout(props: AdminLayoutProps) {
`md:hidden`, `md:hidden`,
`transition-opacity duration-300 ease-in-out`, `transition-opacity duration-300 ease-in-out`,
`col-start-1 row-start-1 col-span-2 row-span-2 bg-black/50 z-10`, `col-start-1 row-start-1 col-span-2 row-span-2 bg-black/50 z-10`,
`max-md:data-[expand=true]:opacity-100 data-[expand=false]:opacity-0`, `data-[expand=true]:opacity-100 data-[expand=false]:opacity-0`,
`max-md:data-[expand=true]:pointer-events-auto data-[expand=false]:pointer-events-none`, `data-[expand=true]:pointer-events-auto data-[expand=false]:pointer-events-none`,
)} )}
onClick={() => setNevBar(false)} onClick={() => setNevBar(false)}
> >

View File

@@ -70,7 +70,7 @@ export default function Extract(props: ExtractProps) {
)} )}
> >
<CardSection> <CardSection>
<Alert variant="warn" > <Alert variant="warn">
<CircleAlert/> <CircleAlert/>
<AlertTitle>IP前需要将本机IP添加到白名单后才可使用</AlertTitle> <AlertTitle>IP前需要将本机IP添加到白名单后才可使用</AlertTitle>
</Alert> </Alert>

View File

@@ -7,7 +7,7 @@ import balance from './_assets/balance.svg'
import Image from 'next/image' import Image from 'next/image'
import {useEffect, useRef, useState} from 'react' import {useEffect, useRef, useState} from 'react'
import {useProfileStore} from '@/components/providers/StoreProvider' import {useProfileStore} from '@/components/providers/StoreProvider'
import {Alert, AlertDescription} from '@/components/ui/alert' import {Alert, AlertTitle} from '@/components/ui/alert'
import {ApiResponse, ExtraResp, ExtraReq} from '@/lib/api' import {ApiResponse, ExtraResp, ExtraReq} from '@/lib/api'
import {toast} from 'sonner' import {toast} from 'sonner'
import {Loader} from 'lucide-react' import {Loader} from 'lucide-react'
@@ -172,16 +172,16 @@ export default function Pay(props: PayProps) {
</div> </div>
{balanceEnough ? ( {balanceEnough ? (
<Alert> <Alert variant="done">
<AlertDescription> <AlertTitle>
</AlertDescription> </AlertTitle>
</Alert> </Alert>
) : ( ) : (
<Alert variant="fail"> <Alert variant="fail">
<AlertDescription> <AlertTitle>
</AlertDescription> </AlertTitle>
</Alert> </Alert>
)} )}
</div> </div>

View File

@@ -8,11 +8,10 @@ const alertVariants = cva(
{ {
variants: { variants: {
variant: { variant: {
default: 'bg-card text-card-foreground', default: 'text-primary bg-primary/10 *:data-[slot=alert-description]:text-primary/90',
primary: '', done: 'text-done bg-done/10 *:data-[slot=alert-description]:text-done/90',
done: '', warn: 'text-warn bg-warn/10 *:data-[slot=alert-description]:text-warn/90',
warn: 'text-warn bg-warn/10', fail: 'text-fail bg-fail/10 *:data-[slot=alert-description]:text-fail/90',
fail: 'text-fail bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-fail/90',
}, },
}, },
defaultVariants: { defaultVariants: {
@@ -30,7 +29,7 @@ function Alert({
<div <div
data-slot="alert" data-slot="alert"
role="alert" role="alert"
className={merge(alertVariants({variant}), className, 'py-0')} className={merge(alertVariants({variant}), className)}
{...props} {...props}
/> />
) )
@@ -41,7 +40,7 @@ function AlertTitle({className, ...props}: React.ComponentProps<'div'>) {
<div <div
data-slot="alert-title" data-slot="alert-title"
className={merge( className={merge(
'col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight', 'col-start-2 line-clamp-1 min-h-4 tracking-tight',
className, className,
)} )}
{...props} {...props}