Skip to content

Commit

Permalink
feat: add download button
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Jul 4, 2024
1 parent 041bd52 commit 2ae11fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions icons/mgc/download_2_cute_re.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 11 additions & 2 deletions src/renderer/src/components/ui/image/preview-image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,19 @@ const Wrapper: Component<{
initial={{ opacity: 0.8 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
className="absolute bottom-4 right-4"
className="absolute bottom-4 right-4 flex gap-3"
onClick={stopPropagation}
>
{!!window.electron && (
<ActionButton
tooltip="Download"
onClick={() => {
tipcClient?.saveImage(src)
}}
>
<i className="i-mgc-download-2-cute-re" />
</ActionButton>
)}
<ActionButton
tooltip="Open in browser"
onClick={() => {
Expand Down Expand Up @@ -76,7 +86,6 @@ export const PreviewImageContent: FC<{
label: "Save image as...",
type: "text",
click: () => {
// window.electron.ipcRenderer.invoke("save-image", image);
tipcClient?.saveImage(image)
},
},
Expand Down

0 comments on commit 2ae11fa

Please sign in to comment.