diff --git a/infrastructure/eid-wallet/src/lib/fragments/IdentityCard/IdentityCard.svelte b/infrastructure/eid-wallet/src/lib/fragments/IdentityCard/IdentityCard.svelte index 624727ab..e9081a00 100644 --- a/infrastructure/eid-wallet/src/lib/fragments/IdentityCard/IdentityCard.svelte +++ b/infrastructure/eid-wallet/src/lib/fragments/IdentityCard/IdentityCard.svelte @@ -1,47 +1,47 @@
diff --git a/infrastructure/eid-wallet/src/routes/(app)/ePassport/+page.svelte b/infrastructure/eid-wallet/src/routes/(app)/ePassport/+page.svelte index 5d8748ad..9cda9e00 100644 --- a/infrastructure/eid-wallet/src/routes/(app)/ePassport/+page.svelte +++ b/infrastructure/eid-wallet/src/routes/(app)/ePassport/+page.svelte @@ -1,25 +1,25 @@ diff --git a/infrastructure/eid-wallet/src/routes/(app)/main/+page.svelte b/infrastructure/eid-wallet/src/routes/(app)/main/+page.svelte index c1cc5372..ad61917a 100644 --- a/infrastructure/eid-wallet/src/routes/(app)/main/+page.svelte +++ b/infrastructure/eid-wallet/src/routes/(app)/main/+page.svelte @@ -1,39 +1,39 @@ - import AppNav from "$lib/fragments/AppNav/AppNav.svelte"; - import { Drawer } from "$lib/ui"; - import * as Button from "$lib/ui/Button"; - import { - FlashlightIcon, - Image02Icon, - QrCodeIcon, - } from "@hugeicons/core-free-icons"; - import { HugeiconsIcon } from "@hugeicons/svelte"; - import { - Format, - type PermissionState, - type Scanned, - cancel, - checkPermissions, - requestPermissions, - scan, - } from "@tauri-apps/plugin-barcode-scanner"; - import { onDestroy, onMount } from "svelte"; - import type { SVGAttributes } from "svelte/elements"; - - const pathProps: SVGAttributes = { - stroke: "white", - "stroke-width": 7, - "stroke-linecap": "round", - "stroke-linejoin": "round", - }; - - let codeScannedDrawerOpen = $state(false); - let loggedInDrawerOpen = $state(false); - let flashlightOn = $state(false); - - let scannedData: Scanned | undefined = $state(undefined); - - let scanning = false; - let loading = false; - - let permissions_nullable: PermissionState | null; - - async function startScan() { - let permissions = await checkPermissions() - .then((permissions) => { - return permissions; +import AppNav from "$lib/fragments/AppNav/AppNav.svelte"; +import { Drawer } from "$lib/ui"; +import * as Button from "$lib/ui/Button"; +import { + FlashlightIcon, + Image02Icon, + QrCodeIcon, +} from "@hugeicons/core-free-icons"; +import { HugeiconsIcon } from "@hugeicons/svelte"; +import { + Format, + type PermissionState, + type Scanned, + cancel, + checkPermissions, + requestPermissions, + scan, +} from "@tauri-apps/plugin-barcode-scanner"; +import { onDestroy, onMount } from "svelte"; +import type { SVGAttributes } from "svelte/elements"; + +const pathProps: SVGAttributes = { + stroke: "white", + "stroke-width": 7, + "stroke-linecap": "round", + "stroke-linejoin": "round", +}; + +let codeScannedDrawerOpen = $state(false); +let loggedInDrawerOpen = $state(false); +let flashlightOn = $state(false); + +let scannedData: Scanned | undefined = $state(undefined); + +let scanning = false; +let loading = false; + +let permissions_nullable: PermissionState | null; + +async function startScan() { + let permissions = await checkPermissions() + .then((permissions) => { + return permissions; + }) + .catch(() => { + return null; // possibly return "denied"? or does that imply that the check has been successful, but was actively denied? + }); + + // TODO: handle receiving "prompt-with-rationale" (issue: https://github.com/tauri-apps/plugins-workspace/issues/979) + if (permissions === "prompt") { + permissions = await requestPermissions(); // handle in more detail? + } + + permissions_nullable = permissions; + + if (permissions === "granted") { + // Scanning parameters + const formats = [Format.QRCode]; + const windowed = true; + + if (scanning) return; + scanning = true; + scan({ formats, windowed }) + .then((res) => { + console.log("Scan result:", res); + scannedData = res; + codeScannedDrawerOpen = true; }) - .catch(() => { - return null; // possibly return "denied"? or does that imply that the check has been successful, but was actively denied? + .catch((error) => { + // TODO: display error to user + console.error("Scan error:", error); + }) + .finally(() => { + scanning = false; }); - - // TODO: handle receiving "prompt-with-rationale" (issue: https://github.com/tauri-apps/plugins-workspace/issues/979) - if (permissions === "prompt") { - permissions = await requestPermissions(); // handle in more detail? - } - - permissions_nullable = permissions; - - if (permissions === "granted") { - // Scanning parameters - const formats = [Format.QRCode]; - const windowed = true; - - if (scanning) return; - scanning = true; - scan({ formats, windowed }) - .then((res) => { - console.log("Scan result:", res); - scannedData = res; - codeScannedDrawerOpen = true; - }) - .catch((error) => { - // TODO: display error to user - console.error("Scan error:", error); - }) - .finally(() => { - scanning = false; - }); - } - - console.error("Permission denied or not granted"); - // TODO: consider handling GUI for permission denied } - async function cancelScan() { - await cancel(); - scanning = false; - } + console.error("Permission denied or not granted"); + // TODO: consider handling GUI for permission denied +} + +async function cancelScan() { + await cancel(); + scanning = false; +} - onMount(async () => { - startScan(); - }); +onMount(async () => { + startScan(); +}); - onDestroy(async () => { - await cancelScan(); - }); +onDestroy(async () => { + await cancelScan(); +}); diff --git a/infrastructure/eid-wallet/src/routes/(app)/settings/+page.svelte b/infrastructure/eid-wallet/src/routes/(app)/settings/+page.svelte index a172a593..719199c2 100644 --- a/infrastructure/eid-wallet/src/routes/(app)/settings/+page.svelte +++ b/infrastructure/eid-wallet/src/routes/(app)/settings/+page.svelte @@ -1,29 +1,29 @@
diff --git a/infrastructure/eid-wallet/src/routes/(auth)/e-passport/+page.svelte b/infrastructure/eid-wallet/src/routes/(auth)/e-passport/+page.svelte index 8a2d1bb9..9e4e0b2a 100644 --- a/infrastructure/eid-wallet/src/routes/(auth)/e-passport/+page.svelte +++ b/infrastructure/eid-wallet/src/routes/(auth)/e-passport/+page.svelte @@ -1,22 +1,21 @@
- import { goto } from "$app/navigation"; - import { Hero, IdentityCard } from "$lib/fragments"; - import type { GlobalState } from "$lib/global"; - import { ButtonAction } from "$lib/ui"; - import axios from "axios"; - import { getContext, onMount } from "svelte"; +import { goto } from "$app/navigation"; +import { Hero, IdentityCard } from "$lib/fragments"; +import type { GlobalState } from "$lib/global"; +import { ButtonAction } from "$lib/ui"; +import axios from "axios"; +import { getContext, onMount } from "svelte"; - let globalState = getContext<() => GlobalState>("globalState")(); - let ename = $state(); +let globalState = getContext<() => GlobalState>("globalState")(); +let ename = $state(); - const handleNext = async () => { - await goto("/e-passport"); - }; +const handleNext = async () => { + await goto("/e-passport"); +}; - onMount(async () => { - const vault = await globalState.vaultController.vault; - ename = vault.ename; - }); +onMount(async () => { + const vault = await globalState.vaultController.vault; + ename = vault.ename; +});
- import { goto } from "$app/navigation"; - import { Hero } from "$lib/fragments"; - import { GlobalState } from "$lib/global"; - import { ButtonAction } from "$lib/ui"; - import { getContext, onMount } from "svelte"; - import { capitalize } from "$lib/utils"; - import Drawer from "$lib/ui/Drawer/Drawer.svelte"; - import axios from "axios"; - import { v4 as uuidv4 } from "uuid"; - import { - PUBLIC_PROVISIONER_URL, - PUBLIC_REGISTRY_URL, - } from "$env/static/public"; - import { - DocFront, - verificaitonId, - verifStep, - status, - reason, - } from "./store"; - import Passport from "./steps/passport.svelte"; - import Selfie from "./steps/selfie.svelte"; - import { load } from "@tauri-apps/plugin-store"; - import { Shadow } from "svelte-loading-spinners"; +import { goto } from "$app/navigation"; +import { Hero } from "$lib/fragments"; +import { GlobalState } from "$lib/global"; +import { ButtonAction } from "$lib/ui"; +import { getContext, onMount } from "svelte"; +import { capitalize } from "$lib/utils"; +import Drawer from "$lib/ui/Drawer/Drawer.svelte"; +import axios from "axios"; +import { v4 as uuidv4 } from "uuid"; +import { + PUBLIC_PROVISIONER_URL, + PUBLIC_REGISTRY_URL, +} from "$env/static/public"; +import { DocFront, verificaitonId, verifStep, status, reason } from "./store"; +import Passport from "./steps/passport.svelte"; +import Selfie from "./steps/selfie.svelte"; +import { load } from "@tauri-apps/plugin-store"; +import { Shadow } from "svelte-loading-spinners"; - let globalState: GlobalState | undefined = $state(undefined); - let showVeriffModal = $state(false); - let person: Record; - let document: Record; - let loading = $state(false); +let globalState: GlobalState | undefined = $state(undefined); +let showVeriffModal = $state(false); +let person: Record; +let document: Record; +let loading = $state(false); - async function handleVerification() { - const { data } = await axios.post( - new URL("/verification", PUBLIC_PROVISIONER_URL).toString(), - ); - verificaitonId.set(data.id); - showVeriffModal = true; - watchEventStream(data.id); - } +async function handleVerification() { + const { data } = await axios.post( + new URL("/verification", PUBLIC_PROVISIONER_URL).toString(), + ); + verificaitonId.set(data.id); + showVeriffModal = true; + watchEventStream(data.id); +} - function watchEventStream(id: string) { - const sseUrl = new URL( - `/verification/sessions/${id}`, - PUBLIC_PROVISIONER_URL, - ).toString(); - const eventSource = new EventSource(sseUrl); +function watchEventStream(id: string) { + const sseUrl = new URL( + `/verification/sessions/${id}`, + PUBLIC_PROVISIONER_URL, + ).toString(); + const eventSource = new EventSource(sseUrl); - eventSource.onopen = function (e) { - console.log("Successfully connected."); - }; + eventSource.onopen = function (e) { + console.log("Successfully connected."); + }; - eventSource.onmessage = function (e) { - const data = JSON.parse(e.data); - if (!data.status) console.log(data); - console.log("STATUS", data); - status.set(data.status); - reason.set(data.reason); - person = data.person; - document = data.document; - if (data.status === "resubmission_requested") { - DocFront.set(null); - Selfie.set(null); - } - verifStep.set(2); - }; - } + eventSource.onmessage = function (e) { + const data = JSON.parse(e.data); + if (!data.status) console.log(data); + console.log("STATUS", data); + status.set(data.status); + reason.set(data.reason); + person = data.person; + document = data.document; + if (data.status === "resubmission_requested") { + DocFront.set(null); + Selfie.set(null); + } + verifStep.set(2); + }; +} - let handleContinue: () => Promise; +let handleContinue: () => Promise; - onMount(() => { - globalState = getContext<() => GlobalState>("globalState")(); - // handle verification logic + sec user data in the store +onMount(() => { + globalState = getContext<() => GlobalState>("globalState")(); + // handle verification logic + sec user data in the store - handleContinue = async () => { - if ($status !== "approved") return verifStep.set(0); - if (!globalState) throw new Error("Global state is not defined"); + handleContinue = async () => { + if ($status !== "approved") return verifStep.set(0); + if (!globalState) throw new Error("Global state is not defined"); - loading = true; - globalState.userController.user = { - name: capitalize( - person.firstName.value + " " + person.lastName.value, - ), - "Date of Birth": new Date( - person.dateOfBirth.value, - ).toDateString(), - "ID submitted": "Passport - " + person.nationality.value, - "Passport Number": document.number.value, - }; - globalState.userController.document = { - "Valid From": new Date(document.validFrom.value).toDateString(), - "Valid Until": new Date( - document.validUntil.value, - ).toDateString(), - "Verified On": new Date().toDateString(), - }; - const { - data: { token: registryEntropy }, - } = await axios.get( - new URL("/entropy", PUBLIC_REGISTRY_URL).toString(), - ); - const { data } = await axios.post( - new URL("/provision", PUBLIC_PROVISIONER_URL).toString(), - { - registryEntropy, - namespace: uuidv4(), - verificationId: $verificaitonId, - }, - ); - if (data.success === true) { - globalState.vaultController.vault = { - uri: data.uri, - ename: data.w3id, - }; - } - setTimeout(() => { - goto("/register"); - }, 10_000); + loading = true; + globalState.userController.user = { + name: capitalize( + person.firstName.value + " " + person.lastName.value, + ), + "Date of Birth": new Date(person.dateOfBirth.value).toDateString(), + "ID submitted": "Passport - " + person.nationality.value, + "Passport Number": document.number.value, + }; + globalState.userController.document = { + "Valid From": new Date(document.validFrom.value).toDateString(), + "Valid Until": new Date(document.validUntil.value).toDateString(), + "Verified On": new Date().toDateString(), }; - }); + const { + data: { token: registryEntropy }, + } = await axios.get( + new URL("/entropy", PUBLIC_REGISTRY_URL).toString(), + ); + const { data } = await axios.post( + new URL("/provision", PUBLIC_PROVISIONER_URL).toString(), + { + registryEntropy, + namespace: uuidv4(), + verificationId: $verificaitonId, + }, + ); + if (data.success === true) { + globalState.vaultController.vault = { + uri: data.uri, + ename: data.w3id, + }; + } + setTimeout(() => { + goto("/register"); + }, 10_000); + }; +});
- import { ButtonAction } from "$lib/ui"; - import { writable } from "svelte/store"; - import { - permissionGranted, - verifStep, - DocFront, - verificaitonId, - } from "../store"; - import { onMount } from "svelte"; - import axios from "axios"; - import { PUBLIC_PROVISIONER_URL } from "$env/static/public"; +import { ButtonAction } from "$lib/ui"; +import { writable } from "svelte/store"; +import { + permissionGranted, + verifStep, + DocFront, + verificaitonId, +} from "../store"; +import { onMount } from "svelte"; +import axios from "axios"; +import { PUBLIC_PROVISIONER_URL } from "$env/static/public"; - let error: string; +let error: string; - onMount(async () => { - try { - const stream = await navigator.mediaDevices.getUserMedia({ - video: true, - }); - permissionGranted.set(true); - stream.getTracks().forEach((track) => track.stop()); - } catch (err) { - permissionGranted.set(false); - console.error("Camera permission denied", err); - error = - "Camera permission denied. Please allow camera access and try again."; - } - }); +onMount(async () => { + try { + const stream = await navigator.mediaDevices.getUserMedia({ + video: true, + }); + permissionGranted.set(true); + stream.getTracks().forEach((track) => track.stop()); + } catch (err) { + permissionGranted.set(false); + console.error("Camera permission denied", err); + error = + "Camera permission denied. Please allow camera access and try again."; + } +}); - let video: HTMLVideoElement; - let canvas1: HTMLCanvasElement; - let canvas2: HTMLCanvasElement; - let image = 1; - let image1Captured = writable(false); - let loading = false; - async function requestCameraPermission() { - try { - const stream = await navigator.mediaDevices.getUserMedia({ - video: { facingMode: "environment" }, - }); - video.srcObject = stream; - video.play(); - permissionGranted.set(true); - } catch (err) { - permissionGranted.set(false); - console.error("Camera permission denied", err); - } +let video: HTMLVideoElement; +let canvas1: HTMLCanvasElement; +let canvas2: HTMLCanvasElement; +let image = 1; +let image1Captured = writable(false); +let loading = false; +async function requestCameraPermission() { + try { + const stream = await navigator.mediaDevices.getUserMedia({ + video: { facingMode: "environment" }, + }); + video.srcObject = stream; + video.play(); + permissionGranted.set(true); + } catch (err) { + permissionGranted.set(false); + console.error("Camera permission denied", err); } - async function captureImage() { - if (image === 1) { - console.log("huh?"); - const context1 = canvas1.getContext("2d"); - if (context1) { - context1.drawImage(video, 0, 0, 1920, 1080); - canvas1.width = video.videoWidth; - canvas1.height = video.videoHeight; - context1.drawImage(video, 0, 0, canvas1.width, canvas1.height); - const dataUrl = canvas1.toDataURL("image/png"); - DocFront.set(dataUrl); - loading = true; - await axios.post( - new URL( - `/verification/${$verificaitonId}/media`, - PUBLIC_PROVISIONER_URL, - ).toString(), - { - img: dataUrl, - type: "document-front", - }, - ); - console.log("here???"); - loading = false; - image1Captured.set(true); - verifStep.set(1); - } +} +async function captureImage() { + if (image === 1) { + console.log("huh?"); + const context1 = canvas1.getContext("2d"); + if (context1) { + context1.drawImage(video, 0, 0, 1920, 1080); + canvas1.width = video.videoWidth; + canvas1.height = video.videoHeight; + context1.drawImage(video, 0, 0, canvas1.width, canvas1.height); + const dataUrl = canvas1.toDataURL("image/png"); + DocFront.set(dataUrl); + loading = true; + await axios.post( + new URL( + `/verification/${$verificaitonId}/media`, + PUBLIC_PROVISIONER_URL, + ).toString(), + { + img: dataUrl, + type: "document-front", + }, + ); + console.log("here???"); + loading = false; + image1Captured.set(true); + verifStep.set(1); } } +} - onMount(() => { - requestCameraPermission(); - }); +onMount(() => { + requestCameraPermission(); +});
diff --git a/infrastructure/eid-wallet/src/routes/(auth)/verify/steps/selfie.svelte b/infrastructure/eid-wallet/src/routes/(auth)/verify/steps/selfie.svelte index eed8fd72..4b6b765d 100644 --- a/infrastructure/eid-wallet/src/routes/(auth)/verify/steps/selfie.svelte +++ b/infrastructure/eid-wallet/src/routes/(auth)/verify/steps/selfie.svelte @@ -1,72 +1,67 @@
diff --git a/infrastructure/eid-wallet/src/routes/+layout.svelte b/infrastructure/eid-wallet/src/routes/+layout.svelte index 0444fe77..0806cb78 100644 --- a/infrastructure/eid-wallet/src/routes/+layout.svelte +++ b/infrastructure/eid-wallet/src/routes/+layout.svelte @@ -1,102 +1,102 @@ {#if showSplashScreen} diff --git a/platforms/metagram/src/lib/dummyData.ts b/platforms/metagram/src/lib/dummyData.ts index 7c8580b9..03b5e705 100644 --- a/platforms/metagram/src/lib/dummyData.ts +++ b/platforms/metagram/src/lib/dummyData.ts @@ -1,24 +1,22 @@ import type { CommentType } from './types'; - export const dummyPosts = Array.from({ length: 100 }, (_, i) => ({ - id: i + 1, + id: (i + 1).toString(), avatar: 'https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250', + userId: (i + 1).toString(), username: `user${i + 1}`, - imgUri: [ + imgUris: [ 'https://picsum.photos/800', 'https://picsum.photos/600', 'https://picsum.photos/800', 'https://picsum.photos/600' ], - postAlt: 'Sample', - text: `This is post number ${i + 1}. Loving how these shots came out! 📸`, + caption: `This is post number ${i + 1}. Loving how these shots came out! :camera_with_flash:`, time: `${i + 1} hours ago`, count: { likes: Math.floor(Math.random() * 500), comments: Math.floor(Math.random() * 200) } })); - export const comments: CommentType[] = Array.from({ length: 50 }, (_, i) => ({ userImgSrc: 'https://picsum.photos/800', name: `user${i + 1}`, diff --git a/platforms/metagram/src/lib/fragments/BottomNav/BottomNav.svelte b/platforms/metagram/src/lib/fragments/BottomNav/BottomNav.svelte index 6175ec8b..98104c23 100644 --- a/platforms/metagram/src/lib/fragments/BottomNav/BottomNav.svelte +++ b/platforms/metagram/src/lib/fragments/BottomNav/BottomNav.svelte @@ -2,7 +2,7 @@ import type { HTMLAttributes } from 'svelte/elements'; import { Home, CommentsTwo, Search, Camera } from '$lib/icons'; import { goto } from '$app/navigation'; - import { isNavigatingThroughNav } from '$lib/store/store.svelte'; + import { isNavigatingThroughNav, ownerId } from '$lib/store/store.svelte'; import { page } from '$app/state'; interface IBottomNavProps extends HTMLAttributes { @@ -27,7 +27,11 @@ const direction = toIndex > fromIndex ? 'right' : 'left'; document.documentElement.setAttribute('data-transition', direction); previousTab = newTab; - goto(`/${newTab}`); + if (newTab === 'profile') { + goto(`/profile/${ownerId}`); + } else { + goto(`/${newTab}`); + } }; $effect(() => { diff --git a/platforms/metagram/src/lib/fragments/Header/Header.stories.ts b/platforms/metagram/src/lib/fragments/Header/Header.stories.ts index 798561f3..597e9f58 100644 --- a/platforms/metagram/src/lib/fragments/Header/Header.stories.ts +++ b/platforms/metagram/src/lib/fragments/Header/Header.stories.ts @@ -15,6 +15,7 @@ export const Primary = { args: { variant: 'primary', heading: 'metagram', + isCallBackNeeded: true, callback: () => alert('clicked') } }; @@ -37,6 +38,7 @@ export const SecondaryWithMenu = { args: { variant: 'secondary', heading: 'Account', + isCallBackNeeded: true, callback: () => alert('menu clicked') } }; @@ -44,6 +46,7 @@ export const SecondaryWithMenu = { export const Tertiary = { args: { variant: 'tertiary', + isCallBackNeeded: true, callback: () => alert('clicked') } }; diff --git a/platforms/metagram/src/lib/fragments/Header/Header.svelte b/platforms/metagram/src/lib/fragments/Header/Header.svelte index 2694cb43..b6e1781c 100644 --- a/platforms/metagram/src/lib/fragments/Header/Header.svelte +++ b/platforms/metagram/src/lib/fragments/Header/Header.svelte @@ -13,11 +13,13 @@ interface IHeaderProps extends HTMLAttributes { variant: 'primary' | 'secondary' | 'tertiary'; heading?: string; + isCallBackNeeded?: boolean; callback?: () => void; options?: { name: string; handler: () => void }[]; } - const { variant, callback, heading, options, ...restProps }: IHeaderProps = $props(); + const { variant, isCallBackNeeded, callback, heading, options, ...restProps }: IHeaderProps = + $props(); const variantClasses = { primary: { @@ -47,7 +49,7 @@ const classes = $derived({ common: cn( - 'w-full flex items-center justify-between my-4 pb-6 border-b-[1px] md:border-0 border-grey' + 'flex items-center justify-between my-4 w-full pb-2 border-b-[1px] md:border-0 border-grey' ), text: variantClasses[variant].text, background: variantClasses[variant].background @@ -81,7 +83,7 @@ {/if} - {#if callback} + {#if isCallBackNeeded} @@ -93,7 +98,7 @@
{postAlt
@@ -123,7 +128,7 @@ {/if}
-

{text}

+

{caption}

{time}

diff --git a/platforms/metagram/src/lib/fragments/Profile/Profile.svelte b/platforms/metagram/src/lib/fragments/Profile/Profile.svelte new file mode 100644 index 00000000..f1d48220 --- /dev/null +++ b/platforms/metagram/src/lib/fragments/Profile/Profile.svelte @@ -0,0 +1,81 @@ + + +
+
+ +
+

{profileData.userId}

+

{profileData.username}

+
+
+

{profileData.followers} followers

+

{profileData.following} following

+

{profileData.totalPosts} posts

+
+
+ {profileData.userBio} +
+
+ {#if variant === 'user'} +
+ +
+
+ +
+ {:else if variant === 'other'} +
+ +
+
+ +
+ {/if} +
+
+
+ {#each profileData.posts as post} + + +
{ + handleSinglePost && handleSinglePost(post); + }} + > + user post +
+ {/each} +
+
diff --git a/platforms/metagram/src/lib/fragments/SideBar/SideBar.svelte b/platforms/metagram/src/lib/fragments/SideBar/SideBar.svelte index 9cd304c5..06d1f612 100644 --- a/platforms/metagram/src/lib/fragments/SideBar/SideBar.svelte +++ b/platforms/metagram/src/lib/fragments/SideBar/SideBar.svelte @@ -5,6 +5,7 @@ import { page } from '$app/state'; import Button from '$lib/ui/Button/Button.svelte'; import { cn } from '$lib/utils'; + import { ownerId } from '$lib/store/store.svelte'; interface ISideBarProps extends HTMLAttributes { activeTab?: string; @@ -148,7 +149,7 @@ aria-current={activeTab === 'profile' ? 'page' : undefined} onclick={() => { activeTab = 'profile'; - goto('/profile'); + goto(`/profile/${ownerId.value}`); }} > ; - }) => ({ - Component: UploadedPostView, - props: args, - }), + title: 'UI/UploadedPostView', + component: UploadedPostView, + tags: ['autodocs'], + render: (args: { + Component: UploadedPostView; + props: ComponentProps; + }) => ({ + Component: UploadedPostView, + props: args + }) }; let images = [ - { - url: "https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250", - alt: "Sample Image 1", - }, - { - url: "https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250", - alt: "Sample Image 1", - }, - { - url: "https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250", - alt: "Sample Image 1", - }, - { - url: "https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250", - alt: "Sample Image 1", - }, - { - url: "https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250", - alt: "Sample Image 1", - }, - { - url: "https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250", - alt: "Sample Image 1", - }, + { + url: 'https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250', + alt: 'Sample Image 1' + }, + { + url: 'https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250', + alt: 'Sample Image 1' + }, + { + url: 'https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250', + alt: 'Sample Image 1' + }, + { + url: 'https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250', + alt: 'Sample Image 1' + }, + { + url: 'https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250', + alt: 'Sample Image 1' + }, + { + url: 'https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250', + alt: 'Sample Image 1' + } ]; export const Primary = { - args: { - images: images, - callback: (i: number) => { - images = images.filter((_, index) => index !== i); - }, - }, + args: { + images: images, + callback: (i: number) => { + images = images.filter((_, index) => index !== i); + } + } }; diff --git a/platforms/metagram/src/lib/fragments/UploadedPostView/UploadedPostView.svelte b/platforms/metagram/src/lib/fragments/UploadedPostView/UploadedPostView.svelte index d8ac5856..ad98b2dc 100644 --- a/platforms/metagram/src/lib/fragments/UploadedPostView/UploadedPostView.svelte +++ b/platforms/metagram/src/lib/fragments/UploadedPostView/UploadedPostView.svelte @@ -27,13 +27,13 @@
{#each images as image, i}
-
-
-
-

System

goto(`/settings/data-and-storage`)}> {#snippet leadingIcon()} @@ -60,6 +56,7 @@ {/snippet}
+
goto(`/settings/logout`)}> {#snippet leadingIcon()} diff --git a/platforms/metagram/src/routes/+layout.svelte b/platforms/metagram/src/routes/+layout.svelte index 9adad7b8..d2583c88 100644 --- a/platforms/metagram/src/routes/+layout.svelte +++ b/platforms/metagram/src/routes/+layout.svelte @@ -1,8 +1,9 @@ {#if showSplashScreen} -
- logo -
+
+ logo +
{:else} -
- {@render children()} -
-{/if} \ No newline at end of file +
+ {@render children()} +
+{/if}