New org improvements

This commit is contained in:
Rotimi Best
2023-09-27 11:26:04 +01:00
parent 73a1d88cd9
commit 0fe6e2ab87
4 changed files with 10 additions and 5 deletions
@@ -196,7 +196,7 @@
<SectionTitle>Banner Image</SectionTitle> <SectionTitle>Banner Image</SectionTitle>
<p> <p>
This optional image will show up on your welcome page. If you include one, it should be at This optional image will show up on your welcome page. If you include one, it should be at
least 300 x 200" least 280 x 200"
</p> </p>
<span class="flex items-center justify-start"> <span class="flex items-center justify-start">
<PrimaryButton <PrimaryButton
@@ -223,13 +223,13 @@
on:change={onFileSelected} on:change={onFileSelected}
/> />
<img <img
style="width:250px; height:150px" style="min-width:280px; min-height:200px"
alt="About us" alt="About us"
src={$settings.image ? $settings.image : '/images/classroomio-course-img-template.jpg'} src={$settings.image ? $settings.image : '/images/classroomio-course-img-template.jpg'}
class="mt-2 md:mt-0 rounded-md w-full relative" class="mt-2 md:mt-0 rounded-md w-full relative"
/> />
{#if uploadingImage} {#if uploadingImage}
<Loading withOverlay={true} small class="absolute top-0 w-[250px]" /> <Loading withOverlay={true} small class="absolute top-0 w-[280px]" />
{/if} {/if}
</div> </div>
</Column> </Column>
@@ -10,6 +10,7 @@
import { newOrgModal } from '../store'; import { newOrgModal } from '../store';
import { snackbar } from '$lib/components/Snackbar/store'; import { snackbar } from '$lib/components/Snackbar/store';
import { createOrgValidation } from '$lib/utils/functions/validator'; import { createOrgValidation } from '$lib/utils/functions/validator';
import { goto } from '$app/navigation';
type Error = { type Error = {
orgName: string; orgName: string;
@@ -97,6 +98,7 @@
resetForm(); resetForm();
goto(`/org/${siteName}`);
$newOrgModal.open = false; $newOrgModal.open = false;
} }
} }
@@ -6,6 +6,7 @@
import { goto } from '$app/navigation'; import { goto } from '$app/navigation';
import { newOrgModal } from '$lib/components/Org/store'; import { newOrgModal } from '$lib/components/Org/store';
import type { CurrentOrg } from '$lib/utils/types/org'; import type { CurrentOrg } from '$lib/utils/types/org';
import { setTheme } from '$lib/utils/functions/theme';
export let canAddOrg = true; export let canAddOrg = true;
let open = false; let open = false;
@@ -18,6 +19,7 @@
function onClick(org: CurrentOrg) { function onClick(org: CurrentOrg) {
localStorage.setItem('classroomio_org_sitename', org.siteName); localStorage.setItem('classroomio_org_sitename', org.siteName);
currentOrg.set(org); currentOrg.set(org);
setTheme(org.theme);
goto($currentOrgPath); goto($currentOrgPath);
open = false; open = false;
} }
@@ -47,7 +49,7 @@
{#each $orgs as org} {#each $orgs as org}
<OrgSelectorItem <OrgSelectorItem
size="sm" size="sm"
active={$currentOrg.shortName === org.shortName} active={$currentOrg.id === org.id}
avatar={org.avatar_url} avatar={org.avatar_url}
avatarText={org.shortName} avatarText={org.shortName}
text={org.name} text={org.name}
@@ -15,7 +15,8 @@
<div class="relative"> <div class="relative">
<button <button
class="{disabled && 'opacity-25'} flex items-center w-[14rem] py-2 px-3 {hasDivider && class="{disabled &&
'opacity-25'} flex items-center text-start w-[14rem] py-2 px-3 {hasDivider &&
'border-b border-gray-100'} {active && 'bg-primary-100 dark:bg-gray-500'}" 'border-b border-gray-100'} {active && 'bg-primary-100 dark:bg-gray-500'}"
on:click={onClick} on:click={onClick}
> >