mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-03-01 16:20:25 +00:00
Refactor UI styles for improved consistency and clarity
Unified card backgrounds, borders, and shadows across components for a more consistent look. Enhanced table, tab, and button styles for clarity and accessibility. Improved layout and modal structure in OneBot API debug, added modal for struct display, and optimized WebSocket debug connection logic. Updated file manager, logs, network, and terminal pages for visual consistency. Refactored interface definitions for stricter typing and readability.
This commit is contained in:
@@ -2,6 +2,7 @@ import { Button } from '@heroui/button';
|
||||
import { Tooltip } from '@heroui/tooltip';
|
||||
import { useRequest } from 'ahooks';
|
||||
import toast from 'react-hot-toast';
|
||||
import { IoMdQuote } from 'react-icons/io';
|
||||
import { IoCopy, IoRefresh } from 'react-icons/io5';
|
||||
|
||||
import { request } from '@/utils/request';
|
||||
@@ -30,18 +31,21 @@ export default function Hitokoto () {
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
<div className='relative'>
|
||||
<div className='relative flex flex-col items-center justify-center p-6 min-h-[120px]'>
|
||||
{loading && <PageLoading />}
|
||||
{error
|
||||
? (
|
||||
<div className='text-primary-400'>一言加载失败:{error.message}</div>
|
||||
<div className='text-danger'>一言加载失败:{error.message}</div>
|
||||
)
|
||||
: (
|
||||
<>
|
||||
<div>{data?.hitokoto}</div>
|
||||
<div className='text-right'>
|
||||
—— <span className='text-default-400'>{data?.from}</span>{' '}
|
||||
{data?.from_who}
|
||||
<IoMdQuote className="text-4xl text-primary/20 mb-4" />
|
||||
<div className="text-xl font-medium text-default-700 dark:text-gray-200 tracking-wide leading-relaxed italic">
|
||||
“ {data?.hitokoto} ”
|
||||
</div>
|
||||
<div className='mt-4 flex flex-col items-center text-sm'>
|
||||
<span className='font-bold text-primary-500/80'>—— {data?.from}</span>
|
||||
{data?.from_who && <span className="text-default-400 text-xs mt-1">{data?.from_who}</span>}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
@@ -49,25 +53,25 @@ export default function Hitokoto () {
|
||||
<div className='flex gap-2'>
|
||||
<Tooltip content='刷新' placement='top'>
|
||||
<Button
|
||||
className="text-default-400 hover:text-primary transition-colors"
|
||||
onPress={run}
|
||||
size='sm'
|
||||
isLoading={loading}
|
||||
isIconOnly
|
||||
radius='full'
|
||||
color='primary'
|
||||
variant='flat'
|
||||
variant='light'
|
||||
>
|
||||
<IoRefresh />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Tooltip content='复制' placement='top'>
|
||||
<Button
|
||||
className="text-default-400 hover:text-success transition-colors"
|
||||
onPress={onCopy}
|
||||
size='sm'
|
||||
isIconOnly
|
||||
radius='full'
|
||||
color='success'
|
||||
variant='flat'
|
||||
variant='light'
|
||||
>
|
||||
<IoCopy />
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user