Skip to content

Commit 00ba2ed

Browse files
committed
feat: 在ServiceWorker组件中添加按钮以替代通知测试的div元素
1 parent 5acddc1 commit 00ba2ed

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

web/src/components/experiment/serviceWorker.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { useEffect, useState } from 'react';
77
import { useTranslation } from 'react-i18next';
88
import { toast } from 'sonner';
99
import { SoftBottom } from '../others/SoftBottom';
10+
import { Button } from '../ui/button';
1011
import SubList, { noticeTest } from './SubList';
1112

1213
export default function ServiceWorker() {
@@ -125,9 +126,9 @@ export default function ServiceWorker() {
125126
{noticeId && (
126127
<div className="text-info mt-2 flex items-center gap-2">
127128
<span className="shrink-0">{t('serviceId')}</span>
128-
<span className="overflow-hidden text-ellipsis">{noticeId}</span>
129-
<div
130-
className="bg-background flex shrink-0 cursor-pointer items-center gap-1 rounded-md px-2 py-1 duration-300 active:scale-95"
129+
<span className="truncate overflow-hidden">{noticeId}</span>
130+
<Button
131+
variant="secondary"
131132
onClick={() => {
132133
noticeTest(noticeId, '自在废物', '这是我的博客。')
133134
.then(() => {
@@ -141,7 +142,7 @@ export default function ServiceWorker() {
141142
>
142143
<Bell className="size-4" />
143144
{t('notificationTest')}
144-
</div>
145+
</Button>
145146
</div>
146147
)}
147148
{noticeId && (

0 commit comments

Comments
 (0)