From b4eed9ac6a90a1f37c746399354efd78d748eeef Mon Sep 17 00:00:00 2001 From: Ushie Date: Sat, 14 Jun 2025 04:58:38 +0300 Subject: [PATCH] refactor: Rename Modals to Dialogs, Move Dialogs and Banners to layout --- .../Banners}/AnnouncementBanner.svelte | 2 +- .../Banners}/Banner.svelte | 2 +- .../{Navbar => Banners}/StatusBanner.svelte | 2 +- src/layout/Dialogs/ConsentDialog.svelte | 55 ++++++ src/layout/Dialogs/CryptoDialog.svelte | 145 ++++++++++++++ .../Dialogs/Dialog.svelte} | 180 +++++++++--------- .../DownloadCompatibilityWarningDialog.svelte | 25 +++ .../Dialogs/ImageDialog.svelte} | 14 +- .../LoginDialog.svelte} | 17 +- .../LoginSuccessfulDialog.svelte} | 20 +- .../MobilePatchesPackagesDialog.svelte | 40 ++++ .../SessionExpiredDialog.svelte} | 12 +- .../SettingsDialog.svelte} | 13 +- src/layout/Navbar/NavHost.svelte | 30 +-- src/lib/components/Gallery.svelte | 12 +- .../donate => lib/components}/QRCode.svelte | 0 src/lib/components/Wave.svelte | 5 +- src/lib/stores.ts | 2 + src/routes/+layout.svelte | 84 ++------ .../announcements/[slug]/AdminButtons.svelte | 6 +- src/routes/donate/+page.svelte | 146 +------------- src/routes/download/+page.svelte | 19 +- src/routes/patches/+page.svelte | 47 ++--- 23 files changed, 458 insertions(+), 420 deletions(-) rename src/{routes/announcements => layout/Banners}/AnnouncementBanner.svelte (97%) rename src/{lib/components => layout/Banners}/Banner.svelte (97%) rename src/layout/{Navbar => Banners}/StatusBanner.svelte (89%) create mode 100644 src/layout/Dialogs/ConsentDialog.svelte create mode 100644 src/layout/Dialogs/CryptoDialog.svelte rename src/{lib/components/Dialogue.svelte => layout/Dialogs/Dialog.svelte} (52%) create mode 100644 src/layout/Dialogs/DownloadCompatibilityWarningDialog.svelte rename src/{lib/components/ImageModal.svelte => layout/Dialogs/ImageDialog.svelte} (77%) rename src/layout/{Navbar/Modals/LoginModal.svelte => Dialogs/LoginDialog.svelte} (85%) rename src/layout/{Navbar/Modals/LoginSuccessfulModal.svelte => Dialogs/LoginSuccessfulDialog.svelte} (61%) create mode 100644 src/layout/Dialogs/MobilePatchesPackagesDialog.svelte rename src/layout/{Navbar/Modals/SessionExpiredModal.svelte => Dialogs/SessionExpiredDialog.svelte} (84%) rename src/layout/{Navbar/Modals/SettingsModal.svelte => Dialogs/SettingsDialog.svelte} (92%) rename src/{routes/donate => lib/components}/QRCode.svelte (100%) diff --git a/src/routes/announcements/AnnouncementBanner.svelte b/src/layout/Banners/AnnouncementBanner.svelte similarity index 97% rename from src/routes/announcements/AnnouncementBanner.svelte rename to src/layout/Banners/AnnouncementBanner.svelte index 3e3d198..32bf987 100644 --- a/src/routes/announcements/AnnouncementBanner.svelte +++ b/src/layout/Banners/AnnouncementBanner.svelte @@ -1,6 +1,6 @@ + + + It's your choice + + We use analytics to improve your experience on this site. By clicking "Allow", you allow us to + collect anonymous data about your visit. + + + + + + diff --git a/src/layout/Dialogs/CryptoDialog.svelte b/src/layout/Dialogs/CryptoDialog.svelte new file mode 100644 index 0000000..dcb77ea --- /dev/null +++ b/src/layout/Dialogs/CryptoDialog.svelte @@ -0,0 +1,145 @@ + + + + + + + Cryptocurrencies + +
+
+ {#each wallets as wallet} + + {/each} +
+
+ + + +
+ + + + + + {qrCodeDialogueName} Wallet + +
+ {qrCodeValue} + +
+
+ + + + +
+ + + Address copied to clipboard + + + diff --git a/src/lib/components/Dialogue.svelte b/src/layout/Dialogs/Dialog.svelte similarity index 52% rename from src/lib/components/Dialogue.svelte rename to src/layout/Dialogs/Dialog.svelte index c9ed5e1..52b65f8 100644 --- a/src/lib/components/Dialogue.svelte +++ b/src/layout/Dialogs/Dialog.svelte @@ -4,7 +4,7 @@ import ArrowLeft from 'svelte-material-icons/ArrowLeft.svelte'; - export let modalOpen = false; + export let dialogOpen = false; export let fullscreen = false; export let notDismissible = false; @@ -16,20 +16,20 @@ } -{#if modalOpen} +{#if dialogOpen} +
{ - if (!notDismissible) modalOpen = !modalOpen; + if (!notDismissible) dialogOpen = !dialogOpen; }} on:keypress={() => { - if (!notDismissible) modalOpen = !modalOpen; + if (!notDismissible) dialogOpen = !dialogOpen; }} transition:fade={{ easing: quadInOut, duration: 150 }} /> 10} aria-modal="true" @@ -37,41 +37,39 @@ on:scroll={parseScroll} transition:fade={{ easing: quadInOut, duration: 150 }} > -
-
- {#if fullscreen} - - {/if} - {#if $$slots.icon} - - {/if} - {#if $$slots.title} -

- -

- {/if} -
- - {#if $$slots.description} -

- -

+
+ {#if fullscreen} + {/if} - -
- - {#if $$slots.buttons} -
- -
+ {#if $$slots.icon} + + {/if} + {#if $$slots.title} +

+ +

{/if}
+ + {#if $$slots.description} +

+ +

+ {/if} + +
+ + {#if $$slots.buttons} +
+ +
+ {/if}
{/if} - diff --git a/src/layout/Dialogs/DownloadCompatibilityWarningDialog.svelte b/src/layout/Dialogs/DownloadCompatibilityWarningDialog.svelte new file mode 100644 index 0000000..658221d --- /dev/null +++ b/src/layout/Dialogs/DownloadCompatibilityWarningDialog.svelte @@ -0,0 +1,25 @@ + + + + Warning + {warning} Do you still want to download? + + + + + + + diff --git a/src/lib/components/ImageModal.svelte b/src/layout/Dialogs/ImageDialog.svelte similarity index 77% rename from src/lib/components/ImageModal.svelte rename to src/layout/Dialogs/ImageDialog.svelte index 987a973..3d7806d 100644 --- a/src/lib/components/ImageModal.svelte +++ b/src/layout/Dialogs/ImageDialog.svelte @@ -7,12 +7,12 @@ const dispatch = createEventDispatcher(); - function closeModal() { + function closeDialog() { dispatch('close'); } function handleKeydown(event: KeyboardEvent) { - if (event.key === 'Escape') closeModal(); + if (event.key === 'Escape') closeDialog(); } @@ -20,16 +20,16 @@ - - + diff --git a/src/routes/download/+page.svelte b/src/routes/download/+page.svelte index b57668b..536bcf0 100644 --- a/src/routes/download/+page.svelte +++ b/src/routes/download/+page.svelte @@ -13,7 +13,7 @@ import Query from '$lib/components/Query.svelte'; import Button from '$lib/components/Button.svelte'; import Picture from '$lib/components/Picture.svelte'; - import Dialogue from '$lib/components/Dialogue.svelte'; + import DownloadCompatibilityWarningDialog from '$layout/Dialogs/DownloadCompatibilityWarningDialog.svelte'; import { onMount } from 'svelte'; const query = createQuery(queries.manager()); @@ -69,21 +69,6 @@ ]} /> - - Warning - {warning} Do you still want to download? - - - - - - - -

ReVanced Manager

Patch your favourite apps, right on your device.

@@ -113,6 +98,8 @@
+ +