Skip to content

Commit 98b87f7

Browse files
committed
feat: added disclaimer modal to pictique.
1 parent 11a46ec commit 98b87f7

File tree

2 files changed

+55
-2
lines changed

2 files changed

+55
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { writable } from "svelte/store";
2+
3+
export const isDisclaimerModalOpen = writable(true);
4+
5+
export const closeDisclaimerModal = () => isDisclaimerModalOpen.set(false);

platforms/pictique/src/routes/(protected)/+layout.svelte

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
import CreatePostModal from '$lib/fragments/CreatePostModal/CreatePostModal.svelte';
66
import { showComments } from '$lib/store/store.svelte';
77
import { activePostId, comments, createComment, fetchComments } from '$lib/stores/comments';
8+
import { closeDisclaimerModal, isDisclaimerModalOpen } from '$lib/stores/disclaimer';
89
import { isCreatePostModalOpen, openCreatePostModal } from '$lib/stores/posts';
910
import type { userProfile } from '$lib/types';
11+
import { Button, Modal } from '$lib/ui';
1012
import { apiClient, getAuthId, getAuthToken } from '$lib/utils';
13+
import { removeAuthId, removeAuthToken } from '$lib/utils';
1114
import type { AxiosError } from 'axios';
1215
import { onMount } from 'svelte';
1316
import { heading } from '../store';
@@ -22,6 +25,7 @@
2225
let isCommentsLoading = $state(false);
2326
let commentsError = $state<string | null>(null);
2427
let profile = $state<userProfile | null>(null);
28+
let confirmedDisclaimer = $state(false);
2529
2630
const handleSend = async () => {
2731
console.log($activePostId, commentValue);
@@ -123,7 +127,7 @@
123127
</section>
124128
{#if route === '/home' || route === '/messages'}
125129
<aside
126-
class="hide-scrollbar relative hidden h-[100dvh] overflow-y-scroll border border-e-0 border-t-0 border-b-0 border-s-gray-200 px-8 pt-14 md:block"
130+
class="hide-scrollbar relative hidden h-[100dvh] overflow-y-scroll border border-b-0 border-e-0 border-t-0 border-s-gray-200 px-8 pt-14 md:block"
127131
>
128132
{#if route === '/home'}
129133
{#if showComments.value}
@@ -156,7 +160,7 @@
156160
{/each}
157161
{/if}
158162
<MessageInput
159-
class="sticky start-0 bottom-4 mt-4 w-full px-2"
163+
class="sticky bottom-4 start-0 mt-4 w-full px-2"
160164
variant="comment"
161165
src={profile?.avatarUrl ?? '/images/user.png'}
162166
bind:value={commentValue}
@@ -175,3 +179,47 @@
175179
</main>
176180

177181
<CreatePostModal bind:open={$isCreatePostModalOpen} />
182+
<Modal
183+
open={$isDisclaimerModalOpen}
184+
onclose={() => {
185+
if (!confirmedDisclaimer) {
186+
removeAuthToken();
187+
removeAuthId();
188+
goto('/auth');
189+
}
190+
}}
191+
>
192+
<article class="flex max-w-[400px] flex-col gap-2 p-4">
193+
<h1>Disclaimer from MetaState Foundation</h1>
194+
<p class="font-bold">⚠️ Please note:</p>
195+
<p>
196+
Pictique is a <b>functional prototype</b>, intended to showcase <b>interoperability</b> and
197+
core concepts of the W3DS ecosystem.
198+
</p>
199+
<p>
200+
<b>It is not a production-grade platform</b> and may lack full reliability, performance,
201+
and security guarantees.
202+
</p>
203+
<p>
204+
We <b>strongly recommend</b> that you avoid sharing <b>sensitive or private content</b>,
205+
and kindly ask for your understanding regarding any bugs, incomplete features, or
206+
unexpected behaviours.
207+
</p>
208+
<p>
209+
The app is still in development, so we kindly ask for your understanding regarding any
210+
potential issues. If you experience issues or have feedback, feel free to contact us at:
211+
</p>
212+
<a href="mailto:[email protected]" class="font-bold outline-none">
213+
214+
</a>
215+
<Button
216+
variant="secondary"
217+
size="sm"
218+
class="mt-2"
219+
callback={() => {
220+
closeDisclaimerModal();
221+
confirmedDisclaimer = true;
222+
}}>I Understand</Button
223+
>
224+
</article>
225+
</Modal>

0 commit comments

Comments
 (0)