feat: setup drizzle (#594)
* chore: migration to SvelteKit 2 * stage 1: migrate to svelte 5 and fix rerendering issues * stage 2: fix more $: reactivity across dashboard * fix merge conflicts * chore: migrate code in main to svelte 5 * chore: update preventDefault * chore: simplify tsconfig and remove unused mobileMenuRef in MobileMenu.svelte * chore: enforce .ts across dashboard * rename from classroomio-com to website * stage-3: Replace carbon icon svelte with lucide icon * update lock file * chore: finish icon replacement * fix: settings and setup page multiple rerender * stage 3: More icon and rerendering fixes * feat: setup drizzle and better auth * fix: onboarding validation error showing translation key #586 (#593) * fix: onboarding validation error showing translation key #586 * fix: remove debug log for profile update errors * chore: add a clean command * fix: remove message from email verification response
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { Grid, Column, Row } from 'carbon-components-svelte';
|
||||
import CheckmarkFilled from 'carbon-icons-svelte/lib/CheckmarkFilled.svelte';
|
||||
import CircleCheckIcon from '$lib/components/Icons/CircleCheckIcon.svelte';
|
||||
import { supabase } from '$lib/utils/functions/supabase';
|
||||
import { profile } from '$lib/utils/store/user';
|
||||
import { snackbar } from '$lib/components/Snackbar/store';
|
||||
@@ -11,7 +11,7 @@
|
||||
import ArrowUpRightIcon from '$lib/components/Icons/ArrowTopRight.svelte';
|
||||
import { t } from '$lib/utils/functions/translations';
|
||||
|
||||
let chatId: number | null;
|
||||
let chatId: number | null = $state(null);
|
||||
|
||||
async function addChatId() {
|
||||
if (!chatId || `${chatId}`.length < 5) return;
|
||||
@@ -34,10 +34,7 @@
|
||||
}
|
||||
|
||||
async function deleteChatId() {
|
||||
const { error } = await supabase
|
||||
.from('profile')
|
||||
.update({ telegram_chat_id: null })
|
||||
.match({ id: $profile.id });
|
||||
const { error } = await supabase.from('profile').update({ telegram_chat_id: null }).match({ id: $profile.id });
|
||||
|
||||
if (error) {
|
||||
snackbar.error('snackbar.course_settings.error.failed_deletion');
|
||||
@@ -49,18 +46,18 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<Grid class="border-c rounded border-gray-200 dark:border-neutral-600 w-full mt-5">
|
||||
<Row class="flex lg:flex-row flex-col justify-center lg:justify-start py-7 border-bottom-c">
|
||||
<Grid class="border-c mt-5 w-full rounded border-gray-200 dark:border-neutral-600">
|
||||
<Row class="border-bottom-c flex flex-col justify-center py-7 lg:flex-row lg:justify-start">
|
||||
<Column sm={4} md={4} lg={4} class="flex items-center justify-center">
|
||||
<img src="/telegram-svg.svg" alt="" class="w-10 mr-2" />
|
||||
<img src="/telegram-svg.svg" alt="" class="mr-2 w-10" />
|
||||
<SectionTitle>{$t('settings.integrations.heading')}</SectionTitle></Column
|
||||
>
|
||||
|
||||
<Column sm={8} md={8} lg={8} class="mt-2 lg:mt-0 flex flex-col items-center lg:items-start">
|
||||
<Column sm={8} md={8} lg={8} class="mt-2 flex flex-col items-center lg:mt-0 lg:items-start">
|
||||
{#if $profile.telegram_chat_id !== null}
|
||||
<div class="flex flex-col items-center w-full">
|
||||
<div class="flex w-full flex-col items-center">
|
||||
<div class="flex items-center">
|
||||
<CheckmarkFilled size={32} class="mr-2" style="fill: green;" />
|
||||
<CircleCheckIcon size={16} filled />
|
||||
<SectionTitle>{$t('settings.integrations.success_message')}</SectionTitle>
|
||||
</div>
|
||||
<PrimaryButton className="mt-3" variant={VARIANTS.CONTAINED_DANGER} onClick={deleteChatId}
|
||||
@@ -69,7 +66,7 @@
|
||||
</div>
|
||||
{:else}
|
||||
<div>
|
||||
<h3 class="font-normal text-lg">
|
||||
<h3 class="text-lg font-normal">
|
||||
{$t('settings.integrations.sub_heading')}
|
||||
</h3>
|
||||
<h4 class="font-normal">{$t('settings.integrations.step_authenticate')}</h4>
|
||||
@@ -78,7 +75,7 @@
|
||||
variant={VARIANTS.OUTLINED}
|
||||
onClick={() => window.open('https://t.me/classroomio_bot', '_blank')}
|
||||
><span class="mr-2">{$t('settings.integrations.open_bot_button')}</span>
|
||||
<ArrowUpRightIcon /></PrimaryButton
|
||||
<ArrowUpRightIcon size={16} /></PrimaryButton
|
||||
>
|
||||
<h4 class="font-normal">{$t('settings.integrations.step_chatId')}</h4>
|
||||
<TextField
|
||||
@@ -88,9 +85,7 @@
|
||||
type="number"
|
||||
isRequired
|
||||
/>
|
||||
<PrimaryButton onClick={addChatId}
|
||||
>{$t('settings.integrations.connect_button')}</PrimaryButton
|
||||
>
|
||||
<PrimaryButton onClick={addChatId}>{$t('settings.integrations.connect_button')}</PrimaryButton>
|
||||
</div>
|
||||
{/if}
|
||||
</Column>
|
||||
|
||||
Reference in New Issue
Block a user