Skip to content

Commit

Permalink
💄 Remove anonymous signout + set default to dark
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpiac committed Oct 24, 2023
1 parent 2b9e45c commit 4bc540c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@
<section class="p-3 border-b border-stroke-base dark:border-stroke-base-dark">
<ul class="flex flex-col gap-3 antialiased">
<ThemeSwitch isNavItem={true} />
<NavItem
isActive={false}
item={{
path: logoutRoute.path(),
label: "Sign out",
icon: ArrowRightOnRectangle
}} />
{#if !member.isAnonymous}
<NavItem
isActive={false}
item={{
path: logoutRoute.path(),
label: "Sign out",
icon: ArrowRightOnRectangle
}} />
{/if}
</ul>
</section>
</div>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib/entities/member/member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export type Member = {
firstName: string | null;
lastName: string | null;
profilePictureUrl: string | null;
isAnonymous: boolean;
verifiedAt: Date | null;
email: string | null;
createdAt: Date;
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/lib/stores/theme.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { writable } from "svelte/store";
import { createLocalStorage, persist } from "@macfja/svelte-persistent-store";
import { genStoreKey } from "$lib/utils/genStoreKey";
import { createLocalStorage, persist } from "@macfja/svelte-persistent-store";
import { writable } from "svelte/store";

export type Theme = "light" | "dark";

const THEME_STORE_KEY = genStoreKey("theme-store");

export const themeStore = persist(writable<Theme>("light"), createLocalStorage(), THEME_STORE_KEY);
export const themeStore = persist(writable<Theme>("dark"), createLocalStorage(), THEME_STORE_KEY);
1 change: 1 addition & 0 deletions frontend/src/lib/usecases/members/loginWithOAuthCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const loginWithOAuthCode = async (params: {
email: result.member.email,
fullName: result.member.fullName,
profilePictureUrl: result.member.profilePictureUrl,
isAnonymous: !result.member.email,
firstName: result.member.firstName,
lastName: result.member.lastName,
verifiedAt: dayjs(result.member.verifiedAt).toDate(),
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib/usecases/members/signInAnonymously.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const signInAnonymously = async (projectId: string): Promise<LoginMemberR
email: result.member.email,
fullName: result.member.fullName,
profilePictureUrl: result.member.profilePictureUrl,
isAnonymous: !result.member.email,
firstName: result.member.firstName,
lastName: result.member.lastName,
verifiedAt: dayjs(result.member.verifiedAt).toDate(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const verifyPasswordlessEmail = async (params: {
createdAt: dayjs(result.member.createdAt).toDate(),
updatedAt: dayjs(result.member.updatedAt).toDate(),
email: result.member.email,
isAnonymous: !result.member.email,
fullName: result.member.fullName,
profilePictureUrl: result.member.profilePictureUrl,
firstName: result.member.firstName,
Expand Down

0 comments on commit 4bc540c

Please sign in to comment.