feat: 🚀 😃 convert repo into a monorepo 🚀 😃 (#51)
* Merge main into turbo-monrepo * feat: rename apps * feat: remove supbase videos and serve all from project * feat: move supabase to root * feat: update README * docs: update link
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
import { writable } from 'svelte/store';
|
||||
|
||||
export const appStore = writable({
|
||||
isDark: false,
|
||||
isOrgSite: false,
|
||||
orgSiteName: ''
|
||||
});
|
||||
@@ -0,0 +1,10 @@
|
||||
import { writable } from 'svelte/store';
|
||||
|
||||
export const attendance = writable<{
|
||||
[key: string]: {
|
||||
[key: string]: {
|
||||
is_present: boolean;
|
||||
id: number;
|
||||
};
|
||||
};
|
||||
}>({});
|
||||
@@ -0,0 +1,68 @@
|
||||
import { writable, derived } from 'svelte/store';
|
||||
import { dev, browser } from '$app/environment';
|
||||
import { STEPS } from '../constants/quiz';
|
||||
import type { Writable } from 'svelte/store';
|
||||
import type { CurrentOrg, OrgTeamMember, OrgAudience } from '../types/org';
|
||||
import { ROLE } from '$lib/utils/constants/roles';
|
||||
import type { UserLessonDataType } from '$lib/utils/types';
|
||||
|
||||
export const orgs = writable<CurrentOrg[]>([]);
|
||||
export const currentOrg: Writable<CurrentOrg> = writable({
|
||||
id: '',
|
||||
name: '',
|
||||
shortName: '',
|
||||
siteName: '',
|
||||
avatar_url: '',
|
||||
memberId: '',
|
||||
role_id: '',
|
||||
landingpage: {},
|
||||
theme: ''
|
||||
});
|
||||
export const orgAudience = writable<OrgAudience[]>([]);
|
||||
export const orgTeam = writable<OrgTeamMember[]>([]);
|
||||
export const isOrgAdmin = derived(
|
||||
currentOrg,
|
||||
($currentOrg) => parseInt($currentOrg.role_id) === ROLE.ADMIN
|
||||
);
|
||||
export const currentOrgPath = derived(currentOrg, ($currentOrg) =>
|
||||
$currentOrg.siteName ? `/org/${$currentOrg.siteName}` : ''
|
||||
);
|
||||
export const currentOrgDomain = derived(currentOrg, ($currentOrg) => {
|
||||
const browserOrigin = dev && browser && window.location.origin;
|
||||
return browserOrigin
|
||||
? browserOrigin
|
||||
: $currentOrg.siteName
|
||||
? `https://${$currentOrg.siteName}.classroomio.com`
|
||||
: '';
|
||||
});
|
||||
|
||||
// Quiz
|
||||
export const createQuizModal = writable({
|
||||
open: false,
|
||||
openEdit: false,
|
||||
title: '',
|
||||
id: null
|
||||
});
|
||||
|
||||
export const deleteModal = writable({
|
||||
id: null,
|
||||
open: false,
|
||||
isQuestion: false
|
||||
});
|
||||
|
||||
export const quizesStore = writable([]);
|
||||
|
||||
export const quizStore = writable({
|
||||
uuid: '',
|
||||
title: '',
|
||||
questions: [],
|
||||
timelimit: '10s',
|
||||
theme: 'standard',
|
||||
pin: ''
|
||||
});
|
||||
|
||||
export const playQuizStore = writable({
|
||||
step: STEPS.CONNECT_TO_PLAY
|
||||
});
|
||||
|
||||
export const userUpcomingData = writable<UserLessonDataType[]>([]);
|
||||
@@ -0,0 +1,3 @@
|
||||
import { writable } from 'svelte/store';
|
||||
|
||||
export const isMobile = writable(false);
|
||||
@@ -0,0 +1,41 @@
|
||||
import { writable } from 'svelte/store';
|
||||
import type { User } from '@supabase/supabase-js';
|
||||
|
||||
export const user = writable<{
|
||||
openAuthModal: boolean;
|
||||
fetchingUser: boolean;
|
||||
isLoggedIn: boolean;
|
||||
currentSession: User | undefined;
|
||||
expiresAt: number;
|
||||
}>({
|
||||
openAuthModal: false,
|
||||
fetchingUser: false,
|
||||
isLoggedIn: false,
|
||||
currentSession: undefined,
|
||||
expiresAt: 0
|
||||
});
|
||||
|
||||
export const profile = writable<{
|
||||
id: string | undefined;
|
||||
fullname: string;
|
||||
avatar_url: string;
|
||||
profile_url?: string;
|
||||
username: string;
|
||||
user_id: string;
|
||||
email: string;
|
||||
role: string;
|
||||
goal: string;
|
||||
source: string;
|
||||
telegram_chat_id: number | null;
|
||||
}>({
|
||||
id: undefined,
|
||||
fullname: '',
|
||||
avatar_url: 'https://pbs.twimg.com/profile_images/1416443682157473795/dGtFbtht_normal.jpg',
|
||||
username: 'Elon',
|
||||
user_id: '',
|
||||
email: '',
|
||||
role: '',
|
||||
goal: '',
|
||||
source: '',
|
||||
telegram_chat_id: null
|
||||
});
|
||||
Reference in New Issue
Block a user