ux improvements in course creation
This commit is contained in:
@@ -211,16 +211,16 @@
|
|||||||
hideSortIcon: true
|
hideSortIcon: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Settings',
|
label: 'Landing Page',
|
||||||
to: getNavItemRoute($course.id, 'settings'),
|
to: getNavItemRoute($course.id, 'landingpage'),
|
||||||
hideSortIcon: true,
|
hideSortIcon: true,
|
||||||
show() {
|
show() {
|
||||||
return !isStudent;
|
return !isStudent;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Landing Page',
|
label: 'Settings',
|
||||||
to: getNavItemRoute($course.id, 'landingpage'),
|
to: getNavItemRoute($course.id, 'settings'),
|
||||||
hideSortIcon: true,
|
hideSortIcon: true,
|
||||||
show() {
|
show() {
|
||||||
return !isStudent;
|
return !isStudent;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
import { Grid, Row, Column, Toggle } from 'carbon-components-svelte';
|
import { CodeSnippet, Grid, Row, Column, Toggle } from 'carbon-components-svelte';
|
||||||
|
|
||||||
import SectionTitle from '$lib/components/Org/SectionTitle.svelte';
|
import SectionTitle from '$lib/components/Org/SectionTitle.svelte';
|
||||||
import TextField from '$lib/components/Form/TextField.svelte';
|
import TextField from '$lib/components/Form/TextField.svelte';
|
||||||
@@ -212,7 +212,7 @@
|
|||||||
|
|
||||||
<Row class="flex lg:flex-row flex-col py-7 border-bottom-c">
|
<Row class="flex lg:flex-row flex-col py-7 border-bottom-c">
|
||||||
<Column sm={8} md={8} lg={8}>
|
<Column sm={8} md={8} lg={8}>
|
||||||
<SectionTitle>Update course details</SectionTitle>
|
<SectionTitle>Course details</SectionTitle>
|
||||||
</Column>
|
</Column>
|
||||||
|
|
||||||
<Column sm={8} md={8} lg={8}>
|
<Column sm={8} md={8} lg={8}>
|
||||||
@@ -230,6 +230,18 @@
|
|||||||
bind:value={$settings.course_description}
|
bind:value={$settings.course_description}
|
||||||
errorMessage={errors.description}
|
errorMessage={errors.description}
|
||||||
/>
|
/>
|
||||||
|
<div class="">
|
||||||
|
<p class="text-md">Course Link</p>
|
||||||
|
{#if $course.slug}
|
||||||
|
<CodeSnippet
|
||||||
|
wrapText
|
||||||
|
type="multi"
|
||||||
|
code={`https://${$currentOrg.siteName}.classroomio.com/course/${$course.slug}`}
|
||||||
|
/>
|
||||||
|
{:else}
|
||||||
|
<CodeSnippet code="Setup landing page to get course link" />
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
</Column>
|
</Column>
|
||||||
</Row>
|
</Row>
|
||||||
<Row class="flex lg:flex-row flex-col py-7 border-bottom-c">
|
<Row class="flex lg:flex-row flex-col py-7 border-bottom-c">
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
import Modal from '$lib/components/Modal/index.svelte';
|
import Modal from '$lib/components/Modal/index.svelte';
|
||||||
import { handleOpenWidget } from '$lib/components/CourseLandingPage/store';
|
import { handleOpenWidget } from '$lib/components/CourseLandingPage/store';
|
||||||
import { queryUnsplash } from './utils';
|
import { queryUnsplash } from './utils';
|
||||||
|
import PrimaryButton from '$lib/components/PrimaryButton/index.svelte';
|
||||||
|
|
||||||
export let imageURL = '';
|
export let imageURL = '';
|
||||||
|
|
||||||
@@ -16,6 +17,7 @@
|
|||||||
{ label: 'Upload', value: 'upload' }
|
{ label: 'Upload', value: 'upload' }
|
||||||
];
|
];
|
||||||
|
|
||||||
|
let isUploading = false;
|
||||||
let currentTab = tabs[0].value;
|
let currentTab = tabs[0].value;
|
||||||
let searchQuery = '';
|
let searchQuery = '';
|
||||||
let unsplashImages: {
|
let unsplashImages: {
|
||||||
@@ -30,7 +32,6 @@
|
|||||||
alt_description: string;
|
alt_description: string;
|
||||||
}[] = [];
|
}[] = [];
|
||||||
let fileInput: HTMLInputElement;
|
let fileInput: HTMLInputElement;
|
||||||
let imagebuffer;
|
|
||||||
|
|
||||||
const onChange = (tabValue: string) => () => (currentTab = tabValue);
|
const onChange = (tabValue: string) => () => (currentTab = tabValue);
|
||||||
|
|
||||||
@@ -45,13 +46,13 @@
|
|||||||
let reader = new FileReader();
|
let reader = new FileReader();
|
||||||
reader.readAsDataURL(file);
|
reader.readAsDataURL(file);
|
||||||
reader.onload = (e) => {
|
reader.onload = (e) => {
|
||||||
imagebuffer = file;
|
|
||||||
uploadImage(file);
|
uploadImage(file);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const uploadImage = async (image: File) => {
|
const uploadImage = async (image: File) => {
|
||||||
|
isUploading = true;
|
||||||
if (!image) {
|
if (!image) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -65,6 +66,7 @@
|
|||||||
const { data: response } = await supabase.storage.from('avatars').getPublicUrl(filename);
|
const { data: response } = await supabase.storage.from('avatars').getPublicUrl(filename);
|
||||||
imageURL = response.publicUrl;
|
imageURL = response.publicUrl;
|
||||||
}
|
}
|
||||||
|
isUploading = false;
|
||||||
|
|
||||||
snackbar.success(`Complete :)`);
|
snackbar.success(`Complete :)`);
|
||||||
$handleOpenWidget.open = false;
|
$handleOpenWidget.open = false;
|
||||||
@@ -104,11 +106,14 @@
|
|||||||
style="display: none;"
|
style="display: none;"
|
||||||
bind:this={fileInput}
|
bind:this={fileInput}
|
||||||
on:change={onFileSelected}
|
on:change={onFileSelected}
|
||||||
|
disabled={isUploading}
|
||||||
|
/>
|
||||||
|
<PrimaryButton
|
||||||
|
label="Upload Image"
|
||||||
|
onClick={handleUpload}
|
||||||
|
isLoading={isUploading}
|
||||||
|
className="w-full font-semibold m-auto"
|
||||||
/>
|
/>
|
||||||
<button
|
|
||||||
on:click={handleUpload}
|
|
||||||
class="py-2 w-full font-semibold hover:bg-gray-200 border-[1px]">Upload Image</button
|
|
||||||
>
|
|
||||||
<p class="text-center text-sm text-gray-500 my-2">
|
<p class="text-center text-sm text-gray-500 my-2">
|
||||||
Images wider than 1500 pixels work best.
|
Images wider than 1500 pixels work best.
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user