summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/projects/src/app/pages/_layout.svelte9
-rw-r--r--apps/web-shared/src/components/blowout-toolbelt.svelte14
-rw-r--r--apps/web-shared/src/components/locale-switcher.svelte12
3 files changed, 9 insertions, 26 deletions
diff --git a/apps/projects/src/app/pages/_layout.svelte b/apps/projects/src/app/pages/_layout.svelte
index b75c062..f0f80a0 100644
--- a/apps/projects/src/app/pages/_layout.svelte
+++ b/apps/projects/src/app/pages/_layout.svelte
@@ -10,7 +10,6 @@
import { IconNames } from "$shared/lib/configuration";
import LL from "$app/lib/i18n/i18n-svelte";
import BlowoutToolbelt from "$shared/components/blowout-toolbelt.svelte";
- import { currentLocale } from "$shared/lib/locale";
let ProfileModalFunctions = {};
let showUserMenu = false;
@@ -18,19 +17,13 @@
const userMenuId = "__menu_" + random_string(3);
const username = get_session_data()?.profile.username;
- function toolbelt_change(event) {
- if (event.detail.name === "locale") {
- currentLocale.set(event.detail.value);
- }
- }
-
onMount(() => {
userMenuTriggerNode = document.getElementById("open-user-menu");
});
</script>
<ProfileModal bind:functions={ProfileModalFunctions}/>
-<BlowoutToolbelt on:change={toolbelt_change}/>
+<BlowoutToolbelt/>
<nav class="container max-width-xl@md width-fit-content@md width-100% max-width-none margin-y-xs@md margin-bottom-xs block@md position-relative@md position-absolute bottom-unset@md bottom-0">
<div class="tabs-nav-v2 justify-between">
diff --git a/apps/web-shared/src/components/blowout-toolbelt.svelte b/apps/web-shared/src/components/blowout-toolbelt.svelte
index b611a2d..2927d70 100644
--- a/apps/web-shared/src/components/blowout-toolbelt.svelte
+++ b/apps/web-shared/src/components/blowout-toolbelt.svelte
@@ -1,23 +1,16 @@
<script>
- import {createEventDispatcher} from "svelte";
import ThemeSwitcher from "./theme-switcher.svelte";
import ThemeSwitcherIcon from "./theme-switcher-icon.svelte";
import LocaleSwitcher from "./locale-switcher.svelte";
import LocaleSwitcherIcon from "./locale-switcher-icon.svelte";
- import {ChevronsRightIcon, ChevronsLeftIcon} from "svelte-feather-icons";
-
- const dispatch = createEventDispatcher();
-
- function locale_change(event) {
- dispatch("change", {name: "locale", value: event.detail})
- }
-
+ import { ChevronsRightIcon, ChevronsLeftIcon } from "svelte-feather-icons";
+
let expanded = false;
const localeSwitcher = {
show: false,
selection: "preffered"
};
-
+
const themeSwitcher = {
show: false,
selection: "system"
@@ -35,7 +28,6 @@
<aside class="blowout position-fixed bg-light inner-glow shadow-xs padding-xxs bottom-50% right-0 z-index-popover {expanded ? 'expanded' : ''}">
<LocaleSwitcher bind:show="{localeSwitcher.show}"
glow="{false}"
- on:change={locale_change}
bind:selection="{localeSwitcher.selection}"/>
<ThemeSwitcher bind:show="{themeSwitcher.show}"
glow="{false}"
diff --git a/apps/web-shared/src/components/locale-switcher.svelte b/apps/web-shared/src/components/locale-switcher.svelte
index 2dae026..9cffc7a 100644
--- a/apps/web-shared/src/components/locale-switcher.svelte
+++ b/apps/web-shared/src/components/locale-switcher.svelte
@@ -1,9 +1,8 @@
<script>
- import {base_domain, CookieNames} from "$shared/lib/configuration";
- import {get_cookie, set_cookie} from "$shared/lib/helpers";
- import {createEventDispatcher, onMount} from "svelte";
-
- const dispatch = createEventDispatcher();
+ import { CookieNames } from "$shared/lib/configuration";
+ import { get_cookie } from "$shared/lib/helpers";
+ import { currentLocale } from "$shared/lib/locale";
+ import { onMount } from "svelte";
export let glow = false;
export let show = false;
@@ -12,8 +11,7 @@
function change(to) {
selection = to;
- set_cookie(CookieNames.locale, selection, base_domain());
- dispatch("change", selection);
+ currentLocale.set(to);
}
onMount(() => {