feat: 完成代码编写

This commit is contained in:
2025-08-08 23:07:54 -07:00
parent aead2ff68f
commit 2ee4121308
25 changed files with 222 additions and 70 deletions
@@ -39,11 +39,11 @@ export const Popup = ({ ref }: PopupProps) => {
return (
<Dialog open={open} onOpenChange={setOpen}>
<DialogContent className='max-h-[350px] min-h-[220px] max-w-[80%] rounded-[25px] sm:max-w-[425px]'>
<DialogContent className='flex max-h-[350px] min-h-[420px] max-w-[80%] flex-col justify-center rounded-[25px] sm:max-w-[425px]'>
<DialogHeader>
<DialogTitle className={'sr-only'}>{data.title}</DialogTitle>
</DialogHeader>
<div className={'pt-[30%]'}>
<div className={'font-light'}>
<div className={'mb-4 text-xl'}>{data.title}</div>
<Markdown>{data.content}</Markdown>
</div>
@@ -30,6 +30,7 @@ import {
PopupRef,
} from '@/app/(main)/(content)/(user)/dashboard/components/Announcement/Popup';
import { Empty } from '@/components/empty';
import SvgIcon from '@/components/SvgIcon';
import { queryAnnouncement } from '@/services/user/announcement';
import { Popover, PopoverContent, PopoverTrigger } from '@workspace/airo-ui/components/popover';
import {
@@ -46,6 +47,7 @@ import {
import { Tabs, TabsList, TabsTrigger } from '@workspace/ui/components/tabs';
import { differenceInDays, formatDate } from '@workspace/ui/utils';
import { QRCodeCanvas } from 'qrcode.react';
import { CopyToClipboard } from 'react-copy-to-clipboard';
const platforms: (keyof API.ApplicationPlatform)[] = [
'windows',
@@ -351,12 +353,12 @@ export default function Content() {
onValueChange={setProtocol}
className='w-full max-w-full md:w-auto'
>
<TabsList className='flex h-full flex-wrap gap-2 bg-transparent p-0 *:flex-auto'>
<TabsList className='flex h-full flex-wrap gap-2 bg-transparent p-0'>
{['all', ...(data?.protocol || [])].map((item) => (
<TabsTrigger
value={item === 'all' ? '' : item}
key={item}
className='un rounded-full bg-[#EAEAEA] px-6 py-1 text-[10px] uppercase text-[#66666673] shadow-[inset_0px_0px_4px_0px_rgba(0,0,0,0.25)] data-[state=active]:bg-[#225BA9] data-[state=active]:text-white'
className='rounded-full bg-[#EAEAEA] px-6 py-1 text-[10px] uppercase text-[#66666673] shadow-[inset_0px_0px_4px_0px_rgba(0,0,0,0.25)] data-[state=active]:bg-[#225BA9] data-[state=active]:text-white'
>
{item}
</TabsTrigger>
@@ -399,20 +401,32 @@ export default function Content() {
</SelectContent>
</Select>
<div className='flex-1 rounded-full bg-white px-3 py-1 text-[10px] leading-tight text-[#225BA9] shadow-[inset_0px_0px_7.6px_0px_rgba(0,0,0,0.25)] sm:rounded-[16px] sm:p-3 sm:text-xs'>
<div className={'line-clamp-2 break-all text-[10px] sm:text-base'}>
{userSubscribeProtocolCurrent}
<div className='flex-1 rounded-full bg-white px-3 py-1 text-[10px] leading-tight text-[#225BA9] shadow-[inset_0px_0px_7.6px_0px_rgba(0,0,0,0.25)] sm:rounded-[16px] sm:text-xs'>
<div className={'flex items-center gap-4 py-1 text-[10px] sm:text-[16px]'}>
<div className={'line-clamp-2 flex-1 break-all'}>
{userSubscribeProtocolCurrent}
</div>
<CopyToClipboard
text={userSubscribeProtocolCurrent}
onCopy={(text, result) => {
if (result) {
toast.success(t('copySuccess'));
}
}}
>
<span className={'cursor-pointer p-1'}>
<SvgIcon name={'copy'}></SvgIcon>
</span>
</CopyToClipboard>
</div>
</div>
</div>
<Popover>
<PopoverTrigger asChild>
<div
className={
'ml-3 h-[40px] w-[40px] flex-shrink-0 cursor-pointer rounded-lg bg-black'
}
></div>
<div className={'size-10'}>
<SvgIcon name={'qrcode'} width={'100%'} height={'100%'}></SvgIcon>
</div>
</PopoverTrigger>
<PopoverContent className='w-auto rounded-xl p-4' align='end'>
<div className='flex flex-col items-center gap-2'>