From 71c7b6e7118dbe1e524b8ef894e671dd341931ad Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Fri, 20 Sep 2024 20:53:29 +0530 Subject: [PATCH] add: mobile banner. --- src/lib/components/bottomModalAlert.svelte | 144 ++++++++++++++++++++- src/lib/stores/bottom-alerts.ts | 4 + 2 files changed, 146 insertions(+), 2 deletions(-) diff --git a/src/lib/components/bottomModalAlert.svelte b/src/lib/components/bottomModalAlert.svelte index e376b006e..933fa6d02 100644 --- a/src/lib/components/bottomModalAlert.svelte +++ b/src/lib/components/bottomModalAlert.svelte @@ -3,9 +3,10 @@ import { Button } from '$lib/elements/forms/index'; import { hideNotification, shouldShowNotification } from '$lib/helpers/notifications'; import { app } from '$lib/stores/app'; - import { type BottomModalAlertItem, bottomModalAlerts, dismissBottomModalAlert } from '$lib/stores/bottom-alerts'; + import { type BottomModalAlertItem, bottomModalAlerts, dismissBottomModalAlert, hideAllModalAlerts } from '$lib/stores/bottom-alerts'; let currentIndex = 0; + let openModalOnMobile = false; $: filteredModalAlerts = $bottomModalAlerts .sort((a, b) => b.importance - a.importance) @@ -35,7 +36,7 @@ {#if filteredModalAlerts.length > 0 && currentModalAlert} -
+
{#key currentModalAlert.id} @@ -136,6 +137,130 @@
+ +
+ {#if openModalOnMobile} +
+
+ {#key currentModalAlert.id} +
+ {#if $app.themeInUse === 'dark'} + {currentModalAlert.title} + {:else} + {currentModalAlert.title} + {/if} + +
+ +
+ + {#if filteredModalAlerts.length > 1} +
+ + Feature {currentIndex + 1} of {filteredModalAlerts.length} + + +
+
+
+ {/if} + +
+

{currentModalAlert.title}

+ + + {#if currentModalAlert.isHtml} + {@html currentModalAlert.message} + {:else} + {currentModalAlert.message} + {/if} + +
+ +
+ + + {#if currentModalAlert.learnMore && currentModalAlert.learnMore.link} + + {/if} +
+
+ {/key} +
+
+ {:else} + +
+ + + Opt-in to experiments, new features, and more. + +
+ + {/if} + {/if}