adds profile page
This commit is contained in:
@@ -83,7 +83,7 @@
|
||||
logout();
|
||||
window.location.href = "/";
|
||||
} else if (item.value == "settings") {
|
||||
goto("/settings/account");
|
||||
goto("/settings/profile");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { goto } from "$app/navigation";
|
||||
import type { DropdownItem } from "../base/dropdown.svelte";
|
||||
import { _ } from "svelte-i18n";
|
||||
export let selected: number;
|
||||
|
||||
const items: DropdownItem[] = [
|
||||
{ text: $_("my-account"), value: "/settings/account" },
|
||||
{ text: $_("display"), value: "/settings/display" },
|
||||
{ text: `${$_("import")}/${$_("export")}`, value: "/settings/export" },
|
||||
{ text: $_('help'), value: "https://wanderer.to" },
|
||||
];
|
||||
|
||||
function handleItemClick(item: DropdownItem) {
|
||||
if (item.text != "Help") {
|
||||
goto(item.value);
|
||||
} else {
|
||||
window.open(item.value, "_blank");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="grid grid-cols-1 md:grid-cols-[256px_1fr] max-w-4xl mx-4 md:mx-auto gap-x-12 items-start"
|
||||
>
|
||||
<menu class="p-4 border border-input-border rounded-xl mb-4">
|
||||
{#each items as item, i}
|
||||
<li
|
||||
class="menu-item flex items-center px-4 py-3 my-1 cursor-pointer hover:bg-menu-item-background-hover focus:bg-menu-item-background-focus transition-colors rounded-md"
|
||||
class:bg-menu-item-background-hover={i == selected}
|
||||
role="presentation"
|
||||
on:mousedown|stopPropagation={() => handleItemClick(item)}
|
||||
>
|
||||
{item.text}
|
||||
</li>
|
||||
{/each}
|
||||
</menu>
|
||||
<div class="settings-content">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</div>
|
||||
@@ -95,6 +95,7 @@
|
||||
"explore-some-trails": "Erkunden Sie einige Routen",
|
||||
"export": "Exportieren",
|
||||
"export-all-trails": "Alle Routen exportieren",
|
||||
"favourite-sport": "",
|
||||
"features": "Features",
|
||||
"file-format": "Dateiformat",
|
||||
"file-too-big": "Datei {file} ist zu groß (max. {size})",
|
||||
|
||||
@@ -95,6 +95,7 @@
|
||||
"explore-some-trails": "Explore some trails",
|
||||
"export": "Export",
|
||||
"export-all-trails": "Export all trails",
|
||||
"favourite-sport": "Favourite sport",
|
||||
"features": "Features",
|
||||
"file-format": "File format",
|
||||
"file-too-big": "File {file} is too big (max. {size})",
|
||||
|
||||
@@ -95,6 +95,7 @@
|
||||
"explore-some-trails": "Explorer certains itinéraires",
|
||||
"export": "",
|
||||
"export-all-trails": "",
|
||||
"favourite-sport": "",
|
||||
"features": "Fonctionnalités",
|
||||
"file-format": "",
|
||||
"file-too-big": "",
|
||||
|
||||
@@ -95,6 +95,7 @@
|
||||
"explore-some-trails": "Fedezzen fel néhány ösvényt",
|
||||
"export": "",
|
||||
"export-all-trails": "",
|
||||
"favourite-sport": "",
|
||||
"features": "Jellemzők",
|
||||
"file-format": "",
|
||||
"file-too-big": "",
|
||||
|
||||
@@ -95,6 +95,7 @@
|
||||
"explore-some-trails": "Esplora alcuni percorsi",
|
||||
"export": "Esporta",
|
||||
"export-all-trails": "",
|
||||
"favourite-sport": "",
|
||||
"features": "Caratteristiche",
|
||||
"file-format": "Formato del file",
|
||||
"file-too-big": "",
|
||||
|
||||
@@ -95,6 +95,7 @@
|
||||
"explore-some-trails": "Verken enkele wandelroutes",
|
||||
"export": "",
|
||||
"export-all-trails": "",
|
||||
"favourite-sport": "",
|
||||
"features": "Kenmerken",
|
||||
"file-format": "",
|
||||
"file-too-big": "",
|
||||
|
||||
@@ -95,6 +95,7 @@
|
||||
"explore-some-trails": "Eksploruj różne ścieżki",
|
||||
"export": "",
|
||||
"export-all-trails": "",
|
||||
"favourite-sport": "",
|
||||
"features": "Funkcje",
|
||||
"file-format": "",
|
||||
"file-too-big": "",
|
||||
|
||||
@@ -95,6 +95,7 @@
|
||||
"explore-some-trails": "Explore algumas trilhas",
|
||||
"export": "",
|
||||
"export-all-trails": "",
|
||||
"favourite-sport": "",
|
||||
"features": "Características",
|
||||
"file-format": "",
|
||||
"file-too-big": "",
|
||||
|
||||
@@ -95,6 +95,7 @@
|
||||
"explore-some-trails": "探索行程",
|
||||
"export": "",
|
||||
"export-all-trails": "",
|
||||
"favourite-sport": "",
|
||||
"features": "特性",
|
||||
"file-format": "",
|
||||
"file-too-big": "",
|
||||
|
||||
@@ -6,6 +6,7 @@ export type User = {
|
||||
email?: string,
|
||||
password: string,
|
||||
avatar?: string;
|
||||
bio?: string;
|
||||
language?: string;
|
||||
created?: string;
|
||||
}
|
||||
@@ -14,5 +15,6 @@ export type UserAnonymous = {
|
||||
id: string,
|
||||
username?: string,
|
||||
avatar?: string;
|
||||
bio?: string;
|
||||
created?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user