-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: show browser not supported popup at startup (#112)
* feat: show browser not supported popup at startup * fix: if browser supports webusb then do not show warning, also adjusted styling for the popup * chore: biome * fix: I snap het --------- Co-authored-by: Koen <[email protected]>
- Loading branch information
Showing
4 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/lib/components/core/popups/popups/BrowserNotSupported.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<script lang="ts"> | ||
import Button from "$components/ui/Button.svelte"; | ||
import { type PopupState, popups } from "$state/popup.svelte"; | ||
import { getContext } from "svelte"; | ||
import { _ } from "svelte-i18n"; | ||
import type { Writable } from "svelte/store"; | ||
const popupState = getContext<Writable<PopupState>>("state"); | ||
function close() { | ||
popups.close($popupState.id); | ||
} | ||
function close_dont_show_again() { | ||
localStorage.setItem("dontShowBrowserNotSupported", "true"); | ||
popups.close($popupState.id); | ||
} | ||
</script> | ||
|
||
<div class="error"> | ||
<h2 class="text">{$_("BROWSER_NOT_SUPPORTED")}</h2> | ||
</div> | ||
|
||
<div class="content"> | ||
<div class="text">{$_("BROWSER_NOT_SUPPORTED_1")}</div> | ||
<div class="text">{$_("BROWSER_NOT_SUPPORTED_SUGGESTION")}</div> | ||
</div> | ||
|
||
<div class="actions"> | ||
<Button name={$_("ACKNOWLEDGE_BROWSER_NOT_SUPPORTED")} mode={"primary"} onclick={close} bold={true} /> | ||
<Button name={$_("ACKNOWLEDGE_BROWSER_NOT_SUPPORTED_DONT_SHOW_AGAIN")} mode={"secondary"} onclick={close_dont_show_again} bold={true} /> | ||
</div> | ||
|
||
<style> | ||
.error { | ||
border-radius: 5px; | ||
padding: 10px; | ||
color: red; | ||
text-align: center; | ||
} | ||
.content { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
width: 800px; | ||
gap: 10px; | ||
text-align: center; | ||
} | ||
.actions { | ||
display: flex; | ||
justify-content: center; | ||
margin-top: 20px; | ||
padding: 20px; | ||
gap: 20px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters