CLASSROOMIO-T-127: Theming configuration
CLASSROOMIO-T-127: Add 4 themes configurations into the app Clean up Co-authored-by: Rotimi Best <rotimiibitoyeemma@gmail.com> Merge-request: CLASSROOMIO-MR-51 Merged-by: Best Admin <best@digdippa.com>
This commit is contained in:
committed by
Space Cloud
co-authored by
Rotimi Best
parent
910d9c50a9
commit
f39a0cee4b
@@ -1,4 +1,4 @@
|
||||
export const NavClasses = {
|
||||
active: 'bg-gray-200 dark:bg-gray-700',
|
||||
active: 'active-sidenav bg-primary-700 text-white transition delay-150 duration-300 ease-in-out',
|
||||
background: ''
|
||||
};
|
||||
|
||||
@@ -58,6 +58,7 @@ export async function getOrganizations(userId) {
|
||||
id,
|
||||
name,
|
||||
siteName,
|
||||
theme,
|
||||
avatar_url
|
||||
)
|
||||
`
|
||||
@@ -72,6 +73,7 @@ export async function getOrganizations(userId) {
|
||||
name: orgMember?.organization?.name,
|
||||
shortName: orgMember?.organization?.name?.substring(0, 2)?.toUpperCase() || '',
|
||||
siteName: orgMember?.organization?.siteName,
|
||||
theme: orgMember?.organization?.theme,
|
||||
avatar_url: orgMember?.organization?.avatar_url,
|
||||
memberId: orgMember?.id
|
||||
});
|
||||
@@ -155,7 +157,7 @@ export async function getCourseBySiteName(siteName) {
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function getCurrentOrg(siteName) {
|
||||
export async function getCurrentOrg(siteName, justGet = false) {
|
||||
const { data, error } = await supabase
|
||||
.from('organization')
|
||||
.select(
|
||||
@@ -163,15 +165,20 @@ export async function getCurrentOrg(siteName) {
|
||||
id,
|
||||
name,
|
||||
siteName,
|
||||
theme,
|
||||
avatar_url
|
||||
`
|
||||
)
|
||||
.eq('siteName', siteName);
|
||||
|
||||
if (error || isEmpty(data)) {
|
||||
if (!justGet && (error || isEmpty(data))) {
|
||||
console.error('Error getOrganization', error);
|
||||
return goto('/404');
|
||||
}
|
||||
|
||||
currentOrg.set(data[0]);
|
||||
if (!justGet) {
|
||||
currentOrg.set(data[0]);
|
||||
} else {
|
||||
return data[0];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ export const currentOrg = writable({
|
||||
shortName: '',
|
||||
siteName: '',
|
||||
avatar_url: '',
|
||||
theme: '',
|
||||
memberId: ''
|
||||
});
|
||||
export const orgAudience = writable([]);
|
||||
|
||||
Reference in New Issue
Block a user