Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into pr/619
Browse files Browse the repository at this point in the history
  • Loading branch information
gagansuie committed Jul 12, 2023
2 parents 97f87e4 + 3b35c88 commit 70b9130
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 7 deletions.
12 changes: 12 additions & 0 deletions src/lib/assets/icons/drawer/IconDrawerVerification.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="w-6 h-6">
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M9 12.75L11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 01-1.043 3.296 3.745 3.745 0 01-3.296 1.043A3.745 3.745 0 0112 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 01-3.296-1.043 3.745 3.745 0 01-1.043-3.296A3.745 3.745 0 013 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 011.043-3.296 3.746 3.746 0 013.296-1.043A3.746 3.746 0 0112 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 013.296 1.043 3.746 3.746 0 011.043 3.296A3.745 3.745 0 0121 12z" />
</svg>
30 changes: 24 additions & 6 deletions src/lib/components/Global/DrawerMain.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
import { user_role } from '$lib/stores/authStore'
import {
is_feature_premium_page_enabled,
is_feature_video_responses_enabled
is_feature_video_responses_enabled,
is_feature_verify_enabled
} from '$lib/stores/remoteConfigStore'
import IconMageText from '$lib/assets/icons/IconMageText.svelte'
import { is_login_modal_open } from '$lib/stores/helperStore'
Expand All @@ -27,6 +28,7 @@
import { isOnline } from '$lib/stores/userStore'
import { get } from '$lib/api'
import IconMageLogo from '$lib/assets/icons/IconMageLogo.svelte'
import IconDrawerVerification from '$lib/assets/icons/drawer/IconDrawerVerification.svelte'
export var nav_drawer: HTMLInputElement
Expand Down Expand Up @@ -98,7 +100,12 @@
<div class="col-span-3 tooltip flex" data-tip={currentUser.displayName}>
<p class="truncate">{currentUser.displayName}</p>
</div>
<div class="col-span-3 tooltip flex" data-tip="@{currentUser.username}">
<div class="col-span-3 tooltip flex gap-1" data-tip="@{currentUser.username}">
{#if currentUser.isVerified}
<div>
<IconDrawerVerification />
</div>
{/if}
<p class=" text-pink-500 truncate">@{currentUser.username}</p>
</div>
<IconDrawerStreak />
Expand Down Expand Up @@ -167,9 +174,20 @@
<li>
<a class="custom-menu-item" href="https://codecrow.io/careers" target="_blank">
<IconDrawerCareers />
<span class={isChannelPage ? 'md:hidden' : ''}> Careers </span>
<span class={isChannelPage ? 'md:hidden' : ''}>Careers</span>
</a>
</li>
{#if currentUser && $is_feature_verify_enabled}
<li>
<a href="/verify" class="custom-menu-item">
<IconDrawerVerification />
<span class={isChannelPage ? 'md:hidden' : ''}>Verify</span>
{#if !isChannelPage}
<span class="badge badge-neutral">New</span>
{/if}
</a>
</li>
{/if}
<li>
<details>
<summary class="custom-menu-item"
Expand All @@ -184,15 +202,15 @@
<li>
<a class="custom-menu-item" href="/settings">
<IconDrawerSettings />
<span class={isChannelPage ? 'md:hidden' : ''}> Settings </span>
<span class={isChannelPage ? 'md:hidden' : ''}>Settings </span>
</a>
</li>
{#if currentUser}
<form action="/logout" method="POST">
<li>
<button class="custom-menu-item" type="submit">
<IconDrawerLogOut />
<span class={isChannelPage ? 'md:hidden' : ''}>Log out </span>
<span class={isChannelPage ? 'md:hidden' : ''}>Log out</span>
</button>
</li>
</form>
Expand All @@ -207,7 +225,7 @@
}
}}>
<IconDrawerLogOut />
<span class={isChannelPage ? 'md:hidden' : ''}>Log In </span>
<span class={isChannelPage ? 'md:hidden' : ''}>Log In</span>
</button>
</li>
{/if}
Expand Down
1 change: 1 addition & 0 deletions src/lib/stores/remoteConfigStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export const is_feature_video_responses_enabled: Writable<boolean> = writable(fa
export const is_feature_premium_page_enabled: Writable<boolean> = writable(false)
export const is_feature_follows_enabled: Writable<boolean> = writable(false)
export const is_feature_stats_enabled: Writable<boolean> = writable(false)
export const is_feature_verify_enabled: Writable<boolean> = writable(false)
4 changes: 3 additions & 1 deletion src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
is_feature_premium_page_enabled,
is_feature_follows_enabled,
is_feature_video_responses_enabled,
is_feature_stats_enabled
is_feature_stats_enabled,
is_feature_verify_enabled
} from '$lib/stores/remoteConfigStore'
import { env } from '$env/dynamic/public'
import { user_role } from '$lib/stores/authStore'
Expand All @@ -50,6 +51,7 @@
$is_feature_video_responses_enabled = env.PUBLIC_FEATURE_VIDEO_RESPONSES === 'true'
$is_feature_follows_enabled = env.PUBLIC_FEATURE_FOLLOWS === 'true'
$is_feature_stats_enabled = env.PUBLIC_FEATURE_STATS === 'true'
$is_feature_verify_enabled = env.PUBLIC_FEATURE_VERIFY === 'true'
await handleWebsocket()
if (!$category_list.length) {
$category_list = imageUrlsJson
Expand Down

0 comments on commit 70b9130

Please sign in to comment.