web/dialogs: add picker dialog & clean up small dialog
This commit is contained in:
9
web/src/lib/download.ts
Normal file
9
web/src/lib/download.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { device } from "$lib/device";
|
||||
|
||||
export const downloadFile = (url: string) => {
|
||||
if (device.is.iOS) {
|
||||
return navigator?.share({ url }).catch(() => {});
|
||||
} else {
|
||||
return window.open(url, "_blank");
|
||||
}
|
||||
};
|
||||
@@ -9,13 +9,20 @@ export type DialogButton = {
|
||||
|
||||
export type SmallDialogIcons = "warn-red";
|
||||
|
||||
export type DialogPickerItem = {
|
||||
type?: 'photo' | 'video',
|
||||
url: string,
|
||||
thumb?: string,
|
||||
}
|
||||
|
||||
export type DialogInfo = {
|
||||
id: string,
|
||||
type: "small",
|
||||
type: "small" | "picker",
|
||||
meowbalt?: MeowbaltEmotions,
|
||||
icon?: SmallDialogIcons,
|
||||
title?: string,
|
||||
bodyText?: string,
|
||||
bodySubText?: string,
|
||||
buttons: DialogButton[],
|
||||
buttons?: DialogButton[],
|
||||
items?: DialogPickerItem[],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user