Skip to content

Commit 415cdab

Browse files
committed
Fix history list style
1 parent 27451e7 commit 415cdab

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

components/actions.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,23 +90,23 @@ function Actions() {
9090

9191
{!edited && (
9292
<Button variant="outline" onClick={() => setEdited(true)}>
93-
<PenLine size={14} className="mr-1" />
93+
<PenLine size={16} className="mr-1" />
9494
编辑
9595
</Button>
9696
)}
9797
{edited && (
9898
<Button variant="outline" onClick={onSave}>
99-
<CheckCircle size={14} className="mr-1" />
99+
<CheckCircle size={16} className="mr-1" />
100100
保存
101101
</Button>
102102
)}
103103
<Button variant="outline" onClick={onRandom}>
104-
<Shuffle size={14} className="mr-1" />
104+
<Shuffle size={16} className="mr-1" />
105105
随机
106106
</Button>
107107
<MailHistory onChange={onChange}>
108108
<Button variant="outline">
109-
<History size={14} className="mr-1" />
109+
<History size={16} className="mr-1" />
110110
历史
111111
</Button>
112112
</MailHistory>

components/mail-history.tsx

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,32 +35,34 @@ function MailHistory({
3535
return (
3636
<Popover open={open} onOpenChange={setOpen}>
3737
<PopoverTrigger asChild>{children}</PopoverTrigger>
38-
<PopoverContent className="w-fit overflow-hidden p-0">
38+
<PopoverContent className="w-fit p-0">
3939
{history.length === 0 ? (
4040
<div className="flex items-center gap-1 p-3 text-sm text-muted-foreground">
4141
<MailQuestion size={18} strokeWidth={1.8} />
4242
这里什么也没有
4343
</div>
4444
) : (
4545
<>
46-
<div className="flex max-h-96 flex-col divide-y divide-dashed overflow-auto border-b">
46+
<div className="flex max-h-96 flex-col overflow-auto border-b p-2">
4747
{history.map((value, index) => (
48-
<div
49-
key={index}
50-
className="flex items-center gap-1 px-4 py-2 text-muted-foreground hover:bg-secondary hover:text-foreground"
51-
>
52-
<div
53-
className="cursor-pointer"
54-
onClick={() => onChangeClick(value, index)}
55-
>
56-
{value}
48+
<div key={index}>
49+
<div className="flex items-center gap-1 rounded-md px-2 py-1.5 text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground">
50+
<div
51+
className="cursor-pointer"
52+
onClick={() => onChangeClick(value, index)}
53+
>
54+
{value}
55+
</div>
56+
<div className="flex-1" />
57+
<Trash
58+
size={16}
59+
onClick={() => clearHistory(index)}
60+
className="cursor-pointer hover:text-destructive"
61+
/>
5762
</div>
58-
<div className="flex-1" />
59-
<Trash
60-
size={16}
61-
onClick={() => clearHistory(index)}
62-
className="cursor-pointer hover:text-destructive"
63-
/>
63+
{index < history.length - 1 && (
64+
<div className="mx-auto my-1 h-[1px] w-[95%] bg-border" />
65+
)}
6466
</div>
6567
))}
6668
</div>

0 commit comments

Comments
 (0)