Skip to content

Commit

Permalink
chores: update to last didroom components
Browse files Browse the repository at this point in the history
  • Loading branch information
phoebus-84 committed Sep 10, 2024
1 parent d8d4da7 commit 6b07c36
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@
/>
<script
type="module"
src="https://cdn.jsdelivr.net/npm/@didroom/[email protected].1/dist/didroom-components/didroom-components.esm.js"
src="https://cdn.jsdelivr.net/npm/@didroom/[email protected].3/dist/didroom-components/didroom-components.esm.js"
></script>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@didroom/[email protected].1/dist/didroom-components/didroom-components.css"
href="https://cdn.jsdelivr.net/npm/@didroom/[email protected].3/dist/didroom-components/didroom-components.css"
/>
</svelte:head>

Expand Down
24 changes: 14 additions & 10 deletions src/routes/[[lang]]/(protected)/(tabs)/profile/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
const gotoLanguageSettings = () => goto('/languages');
const gotoAccountSettings = () => goto('/user-settings');
</script>

<d-tab-page tab="profile" title={m.Profile()} settings>
Expand All @@ -40,19 +41,22 @@
</div>
<div slot="settings">
<d-settings-menu
accountSettings={m.Account_Settings()}
securityAndAuthentication={m.Security_and_Authentication()}
notificationsSettings={m.Notifications_Settings()}
account-settings={m.Account_Settings()}
security-and-authentication={m.Security_and_Authentication()}
notifications-settings={m.Notifications_Settings()}
languages={m.Languages()}
support={m.Support()}
privacyPolicy={m.Privacy_Policy()}
logOut={m.Log_Out()}
privacy-policy={m.Privacy_Policy()}
log-out={m.Log_Out()}
{version}
developedBy={m.Developed_by_Forkbomb()}
{logoutCB}
{gotoLanguageSettings}
{gotoAccountSettings}
{openAppSettings}
developed-by={m.Developed_by_Forkbomb()}
on:accountSettingsClick={() => goto('/user-settings')}
on:languageSettingsClick={() => {
console.log("pppp")
goto('/languages')
}}
on:appSettingsClick={() => openAppSettings()}
on:logoutClick={() => goto('/logout')}
/>
</div>
<div class="pb-24" />
Expand Down
16 changes: 9 additions & 7 deletions src/routes/[[lang]]/(protected)/languages/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import { setLanguagePreference } from '$lib/preferences/lang';
import { availableLanguageTags } from '$paraglide/runtime';
const back = () => goto('/profile');
const recordLanguages = {
en: 'English',
es: 'Español',
Expand All @@ -12,10 +13,15 @@
it: 'Italiano'
};
$: activeLanguage = i18n.getLanguageFromUrl($page.url);
const back = () => goto('/profile')
function handleLanguageChange(language: 'en' | 'it') {
setLanguagePreference(language).then(() => {
activeLanguage = language;
window.location.replace(`/${language}/languages`);
});
}
</script>

<d-header back-button backFunction={back}>
<d-header back-button on:backButtonClick={back}>
{m.Languages()}
</d-header>

Expand All @@ -33,11 +39,7 @@
{:else}
<button
class="border-b-stroke flex h-16 w-full items-center justify-between gap-2.5 rounded-lg border-b border-solid px-5 py-8"
on:click={async () => {
await setLanguagePreference(language);
activeLanguage = language;
window.location.replace(`/${language}/languages`);
}}
on:click={() => handleLanguageChange(language)}
>
<span class="flex items-center self-stretch">
{recordLanguages[language]}
Expand Down

0 comments on commit 6b07c36

Please sign in to comment.