Skip to content

Commit a146787

Browse files
committed
fix[frontend]: use tootip instead of popover
1 parent 466889a commit a146787

File tree

1 file changed

+16
-23
lines changed

1 file changed

+16
-23
lines changed

frontend/components/PasteSettingPanel.tsx

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ import {
55
CardProps,
66
Divider,
77
Input,
8-
PopoverContent,
9-
PopoverTrigger,
10-
Popover,
118
Radio,
129
RadioGroup,
1310
Switch,
11+
Tooltip,
1412
} from "@heroui/react"
1513
import { BaseUrl, verifyExpiration, verifyManageUrl, verifyName } from "../utils/utils.js"
1614
import React from "react"
@@ -115,29 +113,24 @@ export function PanelSettingsPanel({ setting, onSettingChange, ...rest }: PasteS
115113
) : null}
116114
</RadioGroup>
117115
<Divider />
118-
<div className="mt-2 flex flex-row items-center">
116+
<div className="mt-3 flex flex-row items-center">
119117
<Switch isSelected={setting.doEncrypt} onValueChange={(v) => onSettingChange({ ...setting, doEncrypt: v })}>
120-
Encrypt paste
118+
Client-side encryption
121119
</Switch>
122-
<Popover>
123-
<PopoverTrigger>
124-
<InfoIcon className="inline size-5 ml-2" />
125-
</PopoverTrigger>
126-
<PopoverContent>
127-
{(titleProps) => (
128-
<div className="px-1 py-2 max-w-[20rem]">
129-
<h3 className="text-normal font-bold mb-2" {...titleProps}>
130-
Encrypted Paste
131-
</h3>
132-
<div className="text-small">
133-
Enable client-side encryption. Your paste is shared via a URL containing the decryption key in the
134-
hash. Decryption happens in the browser, so only those with the key (not the server) can view the
135-
original content.
136-
</div>
120+
<Tooltip
121+
content={
122+
<div className="px-1 py-2 max-w-[20rem]">
123+
<h3 className="text-normal font-bold mb-2">Client-side encryption</h3>
124+
<div className="text-small">
125+
Your paste is shared via a URL containing the decryption key in the URL hash, which is never sent to
126+
the server. Decryption happens in the browser, so only those with the key (not the server) can view
127+
the decrypted content.
137128
</div>
138-
)}
139-
</PopoverContent>
140-
</Popover>
129+
</div>
130+
}
131+
>
132+
<InfoIcon className="inline size-5 ml-2" />
133+
</Tooltip>
141134
</div>
142135
</CardBody>
143136
</Card>

0 commit comments

Comments
 (0)