Files
classroomio/src/lib/utils/store/org.ts
T

52 lines
1.1 KiB
TypeScript
Raw Normal View History

2023-05-20 23:53:28 +00:00
import { writable, derived } from 'svelte/store';
import { STEPS } from '../constants/quiz';
import type { Writable } from 'svelte/store';
import type { CurrentOrg } from '../types/org';
export const orgs = writable([]);
export const currentOrg: Writable<CurrentOrg> = writable({
2023-04-22 20:00:37 +00:00
id: '',
name: '',
shortName: '',
siteName: '',
2023-05-02 23:55:26 +00:00
avatar_url: '',
memberId: '',
role_id: '',
landingpage: {},
theme: ''
2023-04-22 20:00:37 +00:00
});
2023-04-23 22:28:18 +00:00
export const orgAudience = writable([]);
2023-05-02 23:55:26 +00:00
export const orgTeam = writable([]);
export const currentOrgPath = derived(currentOrg, ($currentOrg) =>
$currentOrg.siteName ? `/org/${$currentOrg.siteName}` : ''
2023-05-20 23:53:28 +00:00
);
2023-06-17 19:11:29 +00:00
// Quiz
export const createQuizModal = writable({
open: false,
openEdit: false,
title: '',
id: null
2023-06-17 19:11:29 +00:00
});
export const deleteModal = writable({
id: null,
open: false,
isQuestion: false
2023-06-17 19:11:29 +00:00
});
export const quizesStore = writable([]);
export const quizStore = writable({
uuid: '',
title: '',
questions: [],
timelimit: '10s',
theme: 'standard',
pin: ''
2023-06-17 19:11:29 +00:00
});
export const playQuizStore = writable({
step: STEPS.CONNECT_TO_PLAY
2023-06-17 19:11:29 +00:00
});