svelte-firekit 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -87
- package/dist/{firebase/auth → auth}/auth.js +1 -2
- package/dist/auth/user.svelte.d.ts +94 -0
- package/dist/auth/user.svelte.js +134 -0
- package/dist/config.d.ts +2 -2
- package/dist/config.js +44 -28
- package/dist/{firebase/firebase.d.ts → firebase.d.ts} +1 -2
- package/dist/{firebase/firebase.js → firebase.js} +1 -4
- package/dist/{firebase/firestore → firestore}/awaitable-doc.svelte.js +1 -1
- package/dist/{firebase/firestore → firestore}/collection.svelte.js +1 -1
- package/dist/{firebase/firestore → firestore}/doc.svelte.js +1 -1
- package/dist/{firebase/firestore → firestore}/document-mutations.svelte.js +11 -11
- package/dist/index.d.ts +10 -23
- package/dist/index.js +10 -28
- package/package.json +10 -26
- package/dist/auth/auth.svelte +0 -65
- package/dist/auth/auth.svelte.d.ts +0 -2
- package/dist/auth/require-auth.svelte +0 -52
- package/dist/auth/require-auth.svelte.d.ts +0 -11
- package/dist/auth/require-no-auth.svelte +0 -42
- package/dist/auth/require-no-auth.svelte.d.ts +0 -6
- package/dist/auth/reset-password.svelte +0 -32
- package/dist/auth/reset-password.svelte.d.ts +0 -8
- package/dist/auth/sign-in.svelte +0 -58
- package/dist/auth/sign-in.svelte.d.ts +0 -14
- package/dist/auth/sign-up.svelte +0 -69
- package/dist/auth/sign-up.svelte.d.ts +0 -17
- package/dist/components/app/nav/app-sidebar.svelte +0 -35
- package/dist/components/app/nav/app-sidebar.svelte.d.ts +0 -8
- package/dist/components/app/nav/breadcrumb.svelte +0 -42
- package/dist/components/app/nav/breadcrumb.svelte.d.ts +0 -19
- package/dist/components/auth/google-sign-in.svelte +0 -62
- package/dist/components/auth/google-sign-in.svelte.d.ts +0 -4
- package/dist/components/auth/reset-password-form.svelte +0 -59
- package/dist/components/auth/reset-password-form.svelte.d.ts +0 -4
- package/dist/components/auth/sign-in-form.svelte +0 -94
- package/dist/components/auth/sign-in-form.svelte.d.ts +0 -8
- package/dist/components/auth/sign-up-form.svelte +0 -136
- package/dist/components/auth/sign-up-form.svelte.d.ts +0 -11
- package/dist/components/auth/user-button/profile-section/avatar-user.svelte +0 -107
- package/dist/components/auth/user-button/profile-section/avatar-user.svelte.d.ts +0 -2
- package/dist/components/auth/user-button/profile-section/connect-user.svelte +0 -45
- package/dist/components/auth/user-button/profile-section/connect-user.svelte.d.ts +0 -18
- package/dist/components/auth/user-button/profile-section/email-user.svelte +0 -81
- package/dist/components/auth/user-button/profile-section/email-user.svelte.d.ts +0 -2
- package/dist/components/auth/user-button/profile-section/phone-user.svelte +0 -122
- package/dist/components/auth/user-button/profile-section/phone-user.svelte.d.ts +0 -2
- package/dist/components/auth/user-button/profile-section/profile-section.svelte +0 -17
- package/dist/components/auth/user-button/profile-section/profile-section.svelte.d.ts +0 -18
- package/dist/components/auth/user-button/settings-dialog.svelte +0 -88
- package/dist/components/auth/user-button/settings-dialog.svelte.d.ts +0 -2
- package/dist/components/auth/user-button/type-account.svelte +0 -35
- package/dist/components/auth/user-button/type-account.svelte.d.ts +0 -4
- package/dist/components/auth/user-button/user-button.svelte +0 -131
- package/dist/components/auth/user-button/user-button.svelte.d.ts +0 -5
- package/dist/components/firestore/collection.svelte +0 -45
- package/dist/components/firestore/collection.svelte.d.ts +0 -25
- package/dist/components/firestore/doc.svelte +0 -39
- package/dist/components/firestore/doc.svelte.d.ts +0 -25
- package/dist/components/nav/app-sidebar.svelte +0 -46
- package/dist/components/nav/app-sidebar.svelte.d.ts +0 -8
- package/dist/components/nav/breadcrumb.svelte +0 -42
- package/dist/components/nav/breadcrumb.svelte.d.ts +0 -19
- package/dist/components/nav/dark-mode-toggle.svelte +0 -16
- package/dist/components/nav/dark-mode-toggle.svelte.d.ts +0 -18
- package/dist/components/nav/nav-main.svelte +0 -70
- package/dist/components/nav/nav-main.svelte.d.ts +0 -18
- package/dist/components/nav/nav.d.ts +0 -11
- package/dist/components/nav/nav.js +0 -157
- package/dist/components/nav/search-form.svelte +0 -21
- package/dist/components/nav/search-form.svelte.d.ts +0 -4
- package/dist/components/nav/version-switcher.svelte +0 -48
- package/dist/components/nav/version-switcher.svelte.d.ts +0 -5
- package/dist/components/public/footer-main.svelte +0 -0
- package/dist/components/public/footer-main.svelte.d.ts +0 -26
- package/dist/components/public/nav-main.svelte +0 -136
- package/dist/components/public/nav-main.svelte.d.ts +0 -18
- package/dist/components/storage/upload.svelte +0 -134
- package/dist/components/storage/upload.svelte.d.ts +0 -11
- package/dist/components/ui/alert-dialog/alert-dialog-action.svelte +0 -13
- package/dist/components/ui/alert-dialog/alert-dialog-action.svelte.d.ts +0 -3
- package/dist/components/ui/alert-dialog/alert-dialog-cancel.svelte +0 -17
- package/dist/components/ui/alert-dialog/alert-dialog-cancel.svelte.d.ts +0 -3
- package/dist/components/ui/alert-dialog/alert-dialog-content.svelte +0 -23
- package/dist/components/ui/alert-dialog/alert-dialog-content.svelte.d.ts +0 -2
- package/dist/components/ui/alert-dialog/alert-dialog-description.svelte +0 -16
- package/dist/components/ui/alert-dialog/alert-dialog-description.svelte.d.ts +0 -3
- package/dist/components/ui/alert-dialog/alert-dialog-footer.svelte +0 -20
- package/dist/components/ui/alert-dialog/alert-dialog-footer.svelte.d.ts +0 -4
- package/dist/components/ui/alert-dialog/alert-dialog-header.svelte +0 -20
- package/dist/components/ui/alert-dialog/alert-dialog-header.svelte.d.ts +0 -4
- package/dist/components/ui/alert-dialog/alert-dialog-overlay.svelte +0 -19
- package/dist/components/ui/alert-dialog/alert-dialog-overlay.svelte.d.ts +0 -3
- package/dist/components/ui/alert-dialog/alert-dialog-title.svelte +0 -18
- package/dist/components/ui/alert-dialog/alert-dialog-title.svelte.d.ts +0 -3
- package/dist/components/ui/alert-dialog/index.js +0 -15
- package/dist/components/ui/avatar/avatar-fallback.svelte +0 -16
- package/dist/components/ui/avatar/avatar-fallback.svelte.d.ts +0 -3
- package/dist/components/ui/avatar/avatar-image.svelte +0 -20
- package/dist/components/ui/avatar/avatar-image.svelte.d.ts +0 -3
- package/dist/components/ui/avatar/avatar.svelte +0 -18
- package/dist/components/ui/avatar/avatar.svelte.d.ts +0 -3
- package/dist/components/ui/avatar/index.d.ts +0 -4
- package/dist/components/ui/avatar/index.js +0 -6
- package/dist/components/ui/badge/badge.svelte +0 -49
- package/dist/components/ui/badge/badge.svelte.d.ts +0 -59
- package/dist/components/ui/badge/index.d.ts +0 -2
- package/dist/components/ui/badge/index.js +0 -2
- package/dist/components/ui/breadcrumb/breadcrumb-ellipsis.svelte +0 -23
- package/dist/components/ui/breadcrumb/breadcrumb-ellipsis.svelte.d.ts +0 -4
- package/dist/components/ui/breadcrumb/breadcrumb-item.svelte +0 -16
- package/dist/components/ui/breadcrumb/breadcrumb-item.svelte.d.ts +0 -4
- package/dist/components/ui/breadcrumb/breadcrumb-link.svelte +0 -31
- package/dist/components/ui/breadcrumb/breadcrumb-link.svelte.d.ts +0 -10
- package/dist/components/ui/breadcrumb/breadcrumb-list.svelte +0 -23
- package/dist/components/ui/breadcrumb/breadcrumb-list.svelte.d.ts +0 -4
- package/dist/components/ui/breadcrumb/breadcrumb-page.svelte +0 -23
- package/dist/components/ui/breadcrumb/breadcrumb-page.svelte.d.ts +0 -4
- package/dist/components/ui/breadcrumb/breadcrumb-separator.svelte +0 -27
- package/dist/components/ui/breadcrumb/breadcrumb-separator.svelte.d.ts +0 -4
- package/dist/components/ui/breadcrumb/breadcrumb.svelte +0 -15
- package/dist/components/ui/breadcrumb/breadcrumb.svelte.d.ts +0 -4
- package/dist/components/ui/breadcrumb/index.d.ts +0 -8
- package/dist/components/ui/breadcrumb/index.js +0 -10
- package/dist/components/ui/button/button.svelte +0 -75
- package/dist/components/ui/button/button.svelte.d.ts +0 -117
- package/dist/components/ui/button/index.d.ts +0 -2
- package/dist/components/ui/button/index.js +0 -4
- package/dist/components/ui/card/card-content.svelte +0 -16
- package/dist/components/ui/card/card-content.svelte.d.ts +0 -4
- package/dist/components/ui/card/card-description.svelte +0 -16
- package/dist/components/ui/card/card-description.svelte.d.ts +0 -4
- package/dist/components/ui/card/card-footer.svelte +0 -16
- package/dist/components/ui/card/card-footer.svelte.d.ts +0 -4
- package/dist/components/ui/card/card-header.svelte +0 -16
- package/dist/components/ui/card/card-header.svelte.d.ts +0 -4
- package/dist/components/ui/card/card-title.svelte +0 -25
- package/dist/components/ui/card/card-title.svelte.d.ts +0 -7
- package/dist/components/ui/card/card.svelte +0 -20
- package/dist/components/ui/card/card.svelte.d.ts +0 -4
- package/dist/components/ui/card/index.d.ts +0 -7
- package/dist/components/ui/card/index.js +0 -9
- package/dist/components/ui/checkbox/checkbox.svelte +0 -33
- package/dist/components/ui/checkbox/checkbox.svelte.d.ts +0 -3
- package/dist/components/ui/checkbox/index.d.ts +0 -2
- package/dist/components/ui/checkbox/index.js +0 -4
- package/dist/components/ui/collapsible/index.d.ts +0 -5
- package/dist/components/ui/collapsible/index.js +0 -7
- package/dist/components/ui/dialog/dialog-content.svelte +0 -36
- package/dist/components/ui/dialog/dialog-content.svelte.d.ts +0 -6
- package/dist/components/ui/dialog/dialog-description.svelte +0 -16
- package/dist/components/ui/dialog/dialog-description.svelte.d.ts +0 -3
- package/dist/components/ui/dialog/dialog-footer.svelte +0 -20
- package/dist/components/ui/dialog/dialog-footer.svelte.d.ts +0 -4
- package/dist/components/ui/dialog/dialog-header.svelte +0 -20
- package/dist/components/ui/dialog/dialog-header.svelte.d.ts +0 -4
- package/dist/components/ui/dialog/dialog-overlay.svelte +0 -19
- package/dist/components/ui/dialog/dialog-overlay.svelte.d.ts +0 -3
- package/dist/components/ui/dialog/dialog-title.svelte +0 -16
- package/dist/components/ui/dialog/dialog-title.svelte.d.ts +0 -3
- package/dist/components/ui/dialog/index.d.ts +0 -12
- package/dist/components/ui/dialog/index.js +0 -14
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +0 -40
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts +0 -6
- package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte +0 -22
- package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte.d.ts +0 -3
- package/dist/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +0 -19
- package/dist/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte.d.ts +0 -11
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte +0 -23
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte.d.ts +0 -18
- package/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte +0 -23
- package/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte.d.ts +0 -7
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +0 -30
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte.d.ts +0 -3
- package/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte +0 -16
- package/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte.d.ts +0 -3
- package/dist/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +0 -20
- package/dist/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte.d.ts +0 -4
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +0 -19
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte.d.ts +0 -3
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +0 -28
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte.d.ts +0 -5
- package/dist/components/ui/dropdown-menu/index.js +0 -17
- package/dist/components/ui/form/form-button.svelte +0 -7
- package/dist/components/ui/form/form-button.svelte.d.ts +0 -3
- package/dist/components/ui/form/form-description.svelte +0 -17
- package/dist/components/ui/form/form-description.svelte.d.ts +0 -3
- package/dist/components/ui/form/form-element-field.svelte +0 -30
- package/dist/components/ui/form/form-element-field.svelte.d.ts +0 -22
- package/dist/components/ui/form/form-field-errors.svelte +0 -30
- package/dist/components/ui/form/form-field-errors.svelte.d.ts +0 -5
- package/dist/components/ui/form/form-field.svelte +0 -30
- package/dist/components/ui/form/form-field.svelte.d.ts +0 -21
- package/dist/components/ui/form/form-fieldset.svelte +0 -21
- package/dist/components/ui/form/form-fieldset.svelte.d.ts +0 -19
- package/dist/components/ui/form/form-label.svelte +0 -21
- package/dist/components/ui/form/form-label.svelte.d.ts +0 -3
- package/dist/components/ui/form/form-legend.svelte +0 -17
- package/dist/components/ui/form/form-legend.svelte.d.ts +0 -3
- package/dist/components/ui/form/index.d.ts +0 -11
- package/dist/components/ui/form/index.js +0 -13
- package/dist/components/ui/input/index.d.ts +0 -2
- package/dist/components/ui/input/index.js +0 -4
- package/dist/components/ui/input/input.svelte +0 -22
- package/dist/components/ui/input/input.svelte.d.ts +0 -4
- package/dist/components/ui/label/index.d.ts +0 -2
- package/dist/components/ui/label/index.js +0 -4
- package/dist/components/ui/label/label.svelte +0 -19
- package/dist/components/ui/label/label.svelte.d.ts +0 -3
- package/dist/components/ui/separator/index.d.ts +0 -2
- package/dist/components/ui/separator/index.js +0 -4
- package/dist/components/ui/separator/separator.svelte +0 -22
- package/dist/components/ui/separator/separator.svelte.d.ts +0 -3
- package/dist/components/ui/sheet/index.js +0 -14
- package/dist/components/ui/sheet/sheet-content.svelte +0 -52
- package/dist/components/ui/sheet/sheet-content.svelte.d.ts +0 -59
- package/dist/components/ui/sheet/sheet-description.svelte +0 -16
- package/dist/components/ui/sheet/sheet-description.svelte.d.ts +0 -3
- package/dist/components/ui/sheet/sheet-footer.svelte +0 -20
- package/dist/components/ui/sheet/sheet-footer.svelte.d.ts +0 -4
- package/dist/components/ui/sheet/sheet-header.svelte +0 -20
- package/dist/components/ui/sheet/sheet-header.svelte.d.ts +0 -4
- package/dist/components/ui/sheet/sheet-overlay.svelte +0 -19
- package/dist/components/ui/sheet/sheet-overlay.svelte.d.ts +0 -3
- package/dist/components/ui/sheet/sheet-title.svelte +0 -16
- package/dist/components/ui/sheet/sheet-title.svelte.d.ts +0 -3
- package/dist/components/ui/sidebar/constants.d.ts +0 -6
- package/dist/components/ui/sidebar/constants.js +0 -6
- package/dist/components/ui/sidebar/context.svelte.d.ts +0 -42
- package/dist/components/ui/sidebar/context.svelte.js +0 -54
- package/dist/components/ui/sidebar/index.d.ts +0 -25
- package/dist/components/ui/sidebar/index.js +0 -27
- package/dist/components/ui/sidebar/sidebar-content.svelte +0 -24
- package/dist/components/ui/sidebar/sidebar-content.svelte.d.ts +0 -4
- package/dist/components/ui/sidebar/sidebar-footer.svelte +0 -21
- package/dist/components/ui/sidebar/sidebar-footer.svelte.d.ts +0 -4
- package/dist/components/ui/sidebar/sidebar-group-action.svelte +0 -36
- package/dist/components/ui/sidebar/sidebar-group-action.svelte.d.ts +0 -10
- package/dist/components/ui/sidebar/sidebar-group-content.svelte +0 -21
- package/dist/components/ui/sidebar/sidebar-group-content.svelte.d.ts +0 -4
- package/dist/components/ui/sidebar/sidebar-group-label.svelte +0 -34
- package/dist/components/ui/sidebar/sidebar-group-label.svelte.d.ts +0 -10
- package/dist/components/ui/sidebar/sidebar-group.svelte +0 -21
- package/dist/components/ui/sidebar/sidebar-group.svelte.d.ts +0 -4
- package/dist/components/ui/sidebar/sidebar-header.svelte +0 -21
- package/dist/components/ui/sidebar/sidebar-header.svelte.d.ts +0 -4
- package/dist/components/ui/sidebar/sidebar-input.svelte +0 -23
- package/dist/components/ui/sidebar/sidebar-input.svelte.d.ts +0 -4
- package/dist/components/ui/sidebar/sidebar-inset.svelte +0 -24
- package/dist/components/ui/sidebar/sidebar-inset.svelte.d.ts +0 -4
- package/dist/components/ui/sidebar/sidebar-menu-action.svelte +0 -43
- package/dist/components/ui/sidebar/sidebar-menu-action.svelte.d.ts +0 -11
- package/dist/components/ui/sidebar/sidebar-menu-badge.svelte +0 -29
- package/dist/components/ui/sidebar/sidebar-menu-badge.svelte.d.ts +0 -4
- package/dist/components/ui/sidebar/sidebar-menu-button.svelte +0 -97
- package/dist/components/ui/sidebar/sidebar-menu-button.svelte.d.ts +0 -91
- package/dist/components/ui/sidebar/sidebar-menu-item.svelte +0 -21
- package/dist/components/ui/sidebar/sidebar-menu-item.svelte.d.ts +0 -4
- package/dist/components/ui/sidebar/sidebar-menu-skeleton.svelte +0 -36
- package/dist/components/ui/sidebar/sidebar-menu-skeleton.svelte.d.ts +0 -7
- package/dist/components/ui/sidebar/sidebar-menu-sub-button.svelte +0 -43
- package/dist/components/ui/sidebar/sidebar-menu-sub-button.svelte.d.ts +0 -12
- package/dist/components/ui/sidebar/sidebar-menu-sub-item.svelte +0 -14
- package/dist/components/ui/sidebar/sidebar-menu-sub-item.svelte.d.ts +0 -4
- package/dist/components/ui/sidebar/sidebar-menu-sub.svelte +0 -25
- package/dist/components/ui/sidebar/sidebar-menu-sub.svelte.d.ts +0 -4
- package/dist/components/ui/sidebar/sidebar-menu.svelte +0 -21
- package/dist/components/ui/sidebar/sidebar-menu.svelte.d.ts +0 -4
- package/dist/components/ui/sidebar/sidebar-provider.svelte +0 -59
- package/dist/components/ui/sidebar/sidebar-provider.svelte.d.ts +0 -9
- package/dist/components/ui/sidebar/sidebar-rail.svelte +0 -36
- package/dist/components/ui/sidebar/sidebar-rail.svelte.d.ts +0 -4
- package/dist/components/ui/sidebar/sidebar-separator.svelte +0 -18
- package/dist/components/ui/sidebar/sidebar-separator.svelte.d.ts +0 -12
- package/dist/components/ui/sidebar/sidebar-trigger.svelte +0 -34
- package/dist/components/ui/sidebar/sidebar-trigger.svelte.d.ts +0 -9
- package/dist/components/ui/sidebar/sidebar.svelte +0 -98
- package/dist/components/ui/sidebar/sidebar.svelte.d.ts +0 -9
- package/dist/components/ui/skeleton/index.d.ts +0 -2
- package/dist/components/ui/skeleton/index.js +0 -4
- package/dist/components/ui/skeleton/skeleton.svelte +0 -17
- package/dist/components/ui/skeleton/skeleton.svelte.d.ts +0 -4
- package/dist/components/ui/sonner/index.d.ts +0 -1
- package/dist/components/ui/sonner/index.js +0 -1
- package/dist/components/ui/sonner/sonner.svelte +0 -20
- package/dist/components/ui/sonner/sonner.svelte.d.ts +0 -3
- package/dist/components/ui/tooltip/index.js +0 -8
- package/dist/components/ui/tooltip/tooltip-content.svelte +0 -21
- package/dist/components/ui/tooltip/tooltip-content.svelte.d.ts +0 -3
- package/dist/firebase/auth/auth-manager.svelte.d.ts +0 -85
- package/dist/firebase/auth/auth-manager.svelte.js +0 -386
- package/dist/firebase/config.d.ts +0 -2
- package/dist/firebase/config.js +0 -44
- package/dist/hooks/is-mobile.svelte.d.ts +0 -5
- package/dist/hooks/is-mobile.svelte.js +0 -23
- package/dist/schemas/reset-password.d.ts +0 -4
- package/dist/schemas/reset-password.js +0 -4
- package/dist/schemas/sign-in.d.ts +0 -5
- package/dist/schemas/sign-in.js +0 -5
- package/dist/schemas/sign-up.d.ts +0 -8
- package/dist/schemas/sign-up.js +0 -8
- package/dist/types/docs.d.ts +0 -50
- package/dist/types/docs.js +0 -1
- package/dist/types/nav.d.ts +0 -13
- package/dist/types/nav.js +0 -1
- package/dist/utils.d.ts +0 -29
- package/dist/utils.js +0 -92
- /package/dist/{firebase/auth → auth}/auth.d.ts +0 -0
- /package/dist/{firebase/firestore → firestore}/awaitable-doc.svelte.d.ts +0 -0
- /package/dist/{firebase/firestore → firestore}/collection.svelte.d.ts +0 -0
- /package/dist/{firebase/firestore → firestore}/doc.svelte.d.ts +0 -0
- /package/dist/{firebase/firestore → firestore}/document-mutations.svelte.d.ts +0 -0
- /package/dist/{firebase/storage → storage}/download-url.svelte.d.ts +0 -0
- /package/dist/{firebase/storage → storage}/download-url.svelte.js +0 -0
- /package/dist/{firebase/storage → storage}/storage-list.svelte.d.ts +0 -0
- /package/dist/{firebase/storage → storage}/storage-list.svelte.js +0 -0
- /package/dist/{firebase/storage → storage}/upload-task.svelte.d.ts +0 -0
- /package/dist/{firebase/storage → storage}/upload-task.svelte.js +0 -0
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { firekitAuth } from "../../firebase/auth/auth.js";
|
|
3
|
-
import { toast } from "svelte-sonner";
|
|
4
|
-
|
|
5
|
-
import Button from "../ui/button/button.svelte";
|
|
6
|
-
import { goto } from "$app/navigation";
|
|
7
|
-
let { label = "Sign in with" }: { label: string } = $props();
|
|
8
|
-
|
|
9
|
-
async function signInWithGoogle() {
|
|
10
|
-
try {
|
|
11
|
-
await firekitAuth.signInWithGoogle();
|
|
12
|
-
await goto("/dashboard");
|
|
13
|
-
} catch (error) {
|
|
14
|
-
if (error instanceof Error) {
|
|
15
|
-
toast.error(error.message);
|
|
16
|
-
} else {
|
|
17
|
-
toast.error("An error occurred");
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<Button onclick={signInWithGoogle} class="w-full gap-2" variant="outline">
|
|
24
|
-
<svg
|
|
25
|
-
class="h-4 w-4 flex-shrink-0"
|
|
26
|
-
width="33"
|
|
27
|
-
height="32"
|
|
28
|
-
viewBox="0 0 33 32"
|
|
29
|
-
fill="none"
|
|
30
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
31
|
-
>
|
|
32
|
-
<g clip-path="url(#clip0_4132_5805)">
|
|
33
|
-
<path
|
|
34
|
-
d="M32.2566 16.36C32.2566 15.04 32.1567 14.08 31.9171 13.08H16.9166V19.02H25.7251C25.5454 20.5 24.5866 22.72 22.4494 24.22L22.4294 24.42L27.1633 28.1L27.4828 28.14C30.5189 25.34 32.2566 21.22 32.2566 16.36Z"
|
|
35
|
-
fill="#4285F4"
|
|
36
|
-
/>
|
|
37
|
-
<path
|
|
38
|
-
d="M16.9166 32C21.231 32 24.8463 30.58 27.5028 28.12L22.4694 24.2C21.1111 25.14 19.3135 25.8 16.9366 25.8C12.7021 25.8 9.12677 23 7.84844 19.16L7.66867 19.18L2.71513 23L2.65521 23.18C5.2718 28.4 10.6648 32 16.9166 32Z"
|
|
39
|
-
fill="#34A853"
|
|
40
|
-
/>
|
|
41
|
-
<path
|
|
42
|
-
d="M7.82845 19.16C7.48889 18.16 7.28915 17.1 7.28915 16C7.28915 14.9 7.48889 13.84 7.80848 12.84V12.62L2.81499 8.73999L2.6552 8.81999C1.55663 10.98 0.937439 13.42 0.937439 16C0.937439 18.58 1.55663 21.02 2.63522 23.18L7.82845 19.16Z"
|
|
43
|
-
fill="#FBBC05"
|
|
44
|
-
/>
|
|
45
|
-
<path
|
|
46
|
-
d="M16.9166 6.18C19.9127 6.18 21.9501 7.48 23.0886 8.56L27.6027 4.16C24.8263 1.58 21.231 0 16.9166 0C10.6648 0 5.27181 3.6 2.63525 8.82L7.80851 12.84C9.10681 8.98 12.6821 6.18 16.9166 6.18Z"
|
|
47
|
-
fill="#EB4335"
|
|
48
|
-
/>
|
|
49
|
-
</g>
|
|
50
|
-
<defs>
|
|
51
|
-
<clipPath id="clip0_4132_5805">
|
|
52
|
-
<rect
|
|
53
|
-
width="32"
|
|
54
|
-
height="32"
|
|
55
|
-
fill="white"
|
|
56
|
-
transform="translate(0.937439)"
|
|
57
|
-
/>
|
|
58
|
-
</clipPath>
|
|
59
|
-
</defs>
|
|
60
|
-
</svg>
|
|
61
|
-
{label} Google
|
|
62
|
-
</Button>
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { goto } from "$app/navigation";
|
|
3
|
-
import { firekitAuth } from "../../firebase/auth/auth.js";
|
|
4
|
-
|
|
5
|
-
import * as Form from "../ui/form/index.js";
|
|
6
|
-
import { Input } from "../ui/input/index.js";
|
|
7
|
-
import { resetPasswordSchema } from "../../schemas/reset-password.js";
|
|
8
|
-
import { toast } from "svelte-sonner";
|
|
9
|
-
import { superForm, defaults } from "sveltekit-superforms";
|
|
10
|
-
import { valibot } from "sveltekit-superforms/adapters";
|
|
11
|
-
|
|
12
|
-
let { redirect }: { redirect: string } = $props();
|
|
13
|
-
|
|
14
|
-
const data = defaults(valibot(resetPasswordSchema));
|
|
15
|
-
|
|
16
|
-
const form = superForm(data, {
|
|
17
|
-
validators: valibot(resetPasswordSchema),
|
|
18
|
-
dataType: "json",
|
|
19
|
-
SPA: true,
|
|
20
|
-
resetForm: false,
|
|
21
|
-
clearOnSubmit: "errors-and-message",
|
|
22
|
-
async onUpdate({ form }) {
|
|
23
|
-
if (!form.valid) return;
|
|
24
|
-
try {
|
|
25
|
-
const { data } = form;
|
|
26
|
-
const { email } = data;
|
|
27
|
-
await firekitAuth.sendPasswordReset(email);
|
|
28
|
-
toast.success("Password reset email sent");
|
|
29
|
-
goto(redirect);
|
|
30
|
-
} catch (error) {
|
|
31
|
-
if (error instanceof Error) {
|
|
32
|
-
toast.error(error.message);
|
|
33
|
-
} else {
|
|
34
|
-
toast.error("An error occurred");
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
const { form: formData, enhance } = form;
|
|
41
|
-
</script>
|
|
42
|
-
|
|
43
|
-
<form method="POST" use:enhance class="space-y-4">
|
|
44
|
-
<Form.Field {form} name="email">
|
|
45
|
-
<Form.Control>
|
|
46
|
-
{#snippet children({ props })}
|
|
47
|
-
<Form.Label>Email address</Form.Label>
|
|
48
|
-
<Input
|
|
49
|
-
{...props}
|
|
50
|
-
bind:value={$formData.email}
|
|
51
|
-
placeholder="you@email.com"
|
|
52
|
-
/>
|
|
53
|
-
{/snippet}
|
|
54
|
-
</Form.Control>
|
|
55
|
-
<Form.FieldErrors />
|
|
56
|
-
</Form.Field>
|
|
57
|
-
|
|
58
|
-
<Form.Button class="w-full">Send Email</Form.Button>
|
|
59
|
-
</form>
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { firekitAuth } from "../../firebase/auth/auth.js";
|
|
3
|
-
import { signInSchema } from "../../schemas/sign-in.js";
|
|
4
|
-
import { superForm, defaults } from "sveltekit-superforms";
|
|
5
|
-
import { Input } from "../ui/input/index.js";
|
|
6
|
-
import Button from "../ui/button/button.svelte";
|
|
7
|
-
import { valibot } from "sveltekit-superforms/adapters";
|
|
8
|
-
|
|
9
|
-
let {
|
|
10
|
-
labelEmail = "Email",
|
|
11
|
-
labelPassword = "Password",
|
|
12
|
-
labellLinkEmailForm = "I forgot my password",
|
|
13
|
-
linkForgetPassword = "/reset-password",
|
|
14
|
-
labelBtnFormEmail = "Sign",
|
|
15
|
-
}: {
|
|
16
|
-
labelEmail: string;
|
|
17
|
-
labelPassword: string;
|
|
18
|
-
labellLinkEmailForm: string;
|
|
19
|
-
linkForgetPassword: string;
|
|
20
|
-
labelBtnFormEmail: string;
|
|
21
|
-
} = $props();
|
|
22
|
-
|
|
23
|
-
const data = defaults(valibot(signInSchema));
|
|
24
|
-
|
|
25
|
-
import * as Form from "../ui/form/index.js";
|
|
26
|
-
import { toast } from "svelte-sonner";
|
|
27
|
-
|
|
28
|
-
const form = superForm(data, {
|
|
29
|
-
validators: valibot(signInSchema),
|
|
30
|
-
dataType: "json",
|
|
31
|
-
SPA: true,
|
|
32
|
-
resetForm: false,
|
|
33
|
-
clearOnSubmit: "errors-and-message",
|
|
34
|
-
async onUpdate({ form }) {
|
|
35
|
-
if (!form.valid) return;
|
|
36
|
-
try {
|
|
37
|
-
const { data } = form;
|
|
38
|
-
const { email, password } = data;
|
|
39
|
-
await firekitAuth.signInWithEmail(email, password);
|
|
40
|
-
toast.success("Signed in successfully");
|
|
41
|
-
} catch (error) {
|
|
42
|
-
if (error instanceof Error) {
|
|
43
|
-
toast.error(error.message);
|
|
44
|
-
} else {
|
|
45
|
-
toast.error("An error occurred");
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
const { form: formData, enhance } = form;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</script>
|
|
55
|
-
|
|
56
|
-
<form method="POST" use:enhance class="space-y-2">
|
|
57
|
-
<Form.Field {form} name="email">
|
|
58
|
-
<Form.Control>
|
|
59
|
-
{#snippet children({ props })}
|
|
60
|
-
<Form.Label>{labelEmail}</Form.Label>
|
|
61
|
-
<Input
|
|
62
|
-
{...props}
|
|
63
|
-
bind:value={$formData.email}
|
|
64
|
-
placeholder="you@email.com"
|
|
65
|
-
/>
|
|
66
|
-
{/snippet}
|
|
67
|
-
</Form.Control>
|
|
68
|
-
<Form.FieldErrors />
|
|
69
|
-
</Form.Field>
|
|
70
|
-
<Form.Field {form} name="password">
|
|
71
|
-
<Form.Control>
|
|
72
|
-
{#snippet children({ props })}
|
|
73
|
-
<div class="flex w-full items-center justify-between">
|
|
74
|
-
<Form.Label>{labelPassword}</Form.Label>
|
|
75
|
-
<Button
|
|
76
|
-
variant="link"
|
|
77
|
-
class="text-sm"
|
|
78
|
-
href={linkForgetPassword}
|
|
79
|
-
>
|
|
80
|
-
{labellLinkEmailForm}
|
|
81
|
-
</Button>
|
|
82
|
-
</div>
|
|
83
|
-
<Input
|
|
84
|
-
{...props}
|
|
85
|
-
bind:value={$formData.password}
|
|
86
|
-
placeholder="*********"
|
|
87
|
-
type="password"
|
|
88
|
-
/>
|
|
89
|
-
{/snippet}
|
|
90
|
-
</Form.Control>
|
|
91
|
-
<Form.FieldErrors />
|
|
92
|
-
</Form.Field>
|
|
93
|
-
<Form.Button class="w-full">{labelBtnFormEmail}</Form.Button>
|
|
94
|
-
</form>
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { firekitAuth } from "../../firebase/auth/auth.js";
|
|
3
|
-
|
|
4
|
-
import * as Form from "../ui/form/index.js";
|
|
5
|
-
import { Input } from "../ui/input/index.js";
|
|
6
|
-
import { signUpSchema } from "../../schemas/sign-up.js";
|
|
7
|
-
import { toast } from "svelte-sonner";
|
|
8
|
-
import { superForm, defaults } from "sveltekit-superforms";
|
|
9
|
-
import { valibot } from "sveltekit-superforms/adapters";
|
|
10
|
-
import Button from "../ui/button/button.svelte";
|
|
11
|
-
import Checkbox from "../ui/checkbox/checkbox.svelte";
|
|
12
|
-
|
|
13
|
-
let {
|
|
14
|
-
labelFisrtName,
|
|
15
|
-
labelLastName,
|
|
16
|
-
labelEmail,
|
|
17
|
-
labelPassword,
|
|
18
|
-
linkTerms,
|
|
19
|
-
labelTerms,
|
|
20
|
-
labelLinkTerms,
|
|
21
|
-
labelBtnFormEmail,
|
|
22
|
-
}: {
|
|
23
|
-
labelFisrtName: string;
|
|
24
|
-
labelLastName: string;
|
|
25
|
-
labelEmail: string;
|
|
26
|
-
labelPassword: string;
|
|
27
|
-
linkTerms: string;
|
|
28
|
-
labelTerms: string;
|
|
29
|
-
labelLinkTerms: string;
|
|
30
|
-
labelBtnFormEmail: string;
|
|
31
|
-
} = $props();
|
|
32
|
-
|
|
33
|
-
const data = defaults(valibot(signUpSchema));
|
|
34
|
-
|
|
35
|
-
const form = superForm(data, {
|
|
36
|
-
validators: valibot(signUpSchema),
|
|
37
|
-
dataType: "json",
|
|
38
|
-
SPA: true,
|
|
39
|
-
resetForm: false,
|
|
40
|
-
clearOnSubmit: "errors-and-message",
|
|
41
|
-
async onUpdate({ form }) {
|
|
42
|
-
if (!form.valid) return;
|
|
43
|
-
try {
|
|
44
|
-
const { data } = form;
|
|
45
|
-
const { email, password, firstName, lastName } = data;
|
|
46
|
-
const displayName = `${firstName} ${lastName}`;
|
|
47
|
-
await firekitAuth.registerWithEmail(email, password, displayName);
|
|
48
|
-
toast.success("Account created successfully");
|
|
49
|
-
} catch (error) {
|
|
50
|
-
if (error instanceof Error) {
|
|
51
|
-
toast.error(error.message);
|
|
52
|
-
} else {
|
|
53
|
-
toast.error("An error occurred");
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
const { form: formData, enhance } = form;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
</script>
|
|
63
|
-
|
|
64
|
-
<form method="POST" use:enhance class="space-y-2">
|
|
65
|
-
<div class="grid grid-cols-2 gap-4">
|
|
66
|
-
<Form.Field {form} name="firstName">
|
|
67
|
-
<Form.Control>
|
|
68
|
-
{#snippet children({ props })}
|
|
69
|
-
<Form.Label>{labelFisrtName}</Form.Label>
|
|
70
|
-
<Input
|
|
71
|
-
{...props}
|
|
72
|
-
bind:value={$formData.firstName}
|
|
73
|
-
placeholder="John"
|
|
74
|
-
/>
|
|
75
|
-
{/snippet}
|
|
76
|
-
</Form.Control>
|
|
77
|
-
<Form.FieldErrors />
|
|
78
|
-
</Form.Field>
|
|
79
|
-
<Form.Field {form} name="lastName">
|
|
80
|
-
<Form.Control>
|
|
81
|
-
{#snippet children({ props })}
|
|
82
|
-
<Form.Label>{labelLastName}</Form.Label>
|
|
83
|
-
<Input
|
|
84
|
-
{...props}
|
|
85
|
-
bind:value={$formData.lastName}
|
|
86
|
-
placeholder="Smith"
|
|
87
|
-
/>
|
|
88
|
-
{/snippet}
|
|
89
|
-
</Form.Control>
|
|
90
|
-
<Form.FieldErrors />
|
|
91
|
-
</Form.Field>
|
|
92
|
-
</div>
|
|
93
|
-
<Form.Field {form} name="email">
|
|
94
|
-
<Form.Control>
|
|
95
|
-
{#snippet children({ props })}
|
|
96
|
-
<Form.Label>{labelEmail}</Form.Label>
|
|
97
|
-
<Input
|
|
98
|
-
{...props}
|
|
99
|
-
bind:value={$formData.email}
|
|
100
|
-
placeholder="you@email.com"
|
|
101
|
-
/>
|
|
102
|
-
{/snippet}
|
|
103
|
-
</Form.Control>
|
|
104
|
-
<Form.FieldErrors />
|
|
105
|
-
</Form.Field>
|
|
106
|
-
<Form.Field {form} name="password">
|
|
107
|
-
<Form.Control>
|
|
108
|
-
{#snippet children({ props })}
|
|
109
|
-
<Form.Label>{labelPassword}</Form.Label>
|
|
110
|
-
<Input
|
|
111
|
-
{...props}
|
|
112
|
-
bind:value={$formData.password}
|
|
113
|
-
placeholder="*********"
|
|
114
|
-
type="password"
|
|
115
|
-
/>
|
|
116
|
-
{/snippet}
|
|
117
|
-
</Form.Control>
|
|
118
|
-
<Form.FieldErrors />
|
|
119
|
-
</Form.Field>
|
|
120
|
-
<Form.Field {form} name="agreeToTerms">
|
|
121
|
-
<Form.Control>
|
|
122
|
-
{#snippet children({ props })}
|
|
123
|
-
<Checkbox {...props} bind:checked={$formData.agreeToTerms} />
|
|
124
|
-
|
|
125
|
-
<Form.Label>
|
|
126
|
-
{labelTerms}
|
|
127
|
-
<Button variant="link" href={linkTerms} class="p-0"
|
|
128
|
-
>{labelLinkTerms}</Button
|
|
129
|
-
>
|
|
130
|
-
</Form.Label>
|
|
131
|
-
{/snippet}
|
|
132
|
-
</Form.Control>
|
|
133
|
-
<Form.FieldErrors />
|
|
134
|
-
</Form.Field>
|
|
135
|
-
<Form.Button class="w-full">{labelBtnFormEmail}</Form.Button>
|
|
136
|
-
</form>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
declare const SignUpForm: import("svelte").Component<{
|
|
2
|
-
labelFisrtName: string;
|
|
3
|
-
labelLastName: string;
|
|
4
|
-
labelEmail: string;
|
|
5
|
-
labelPassword: string;
|
|
6
|
-
linkTerms: string;
|
|
7
|
-
labelTerms: string;
|
|
8
|
-
labelLinkTerms: string;
|
|
9
|
-
labelBtnFormEmail: string;
|
|
10
|
-
}, {}, "">;
|
|
11
|
-
export default SignUpForm;
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import * as Avatar from "../../../ui/avatar/index.js";
|
|
3
|
-
import { firekitAuthManager } from "../../../../firebase/auth/auth-manager.svelte.js";
|
|
4
|
-
|
|
5
|
-
import { firekitUploadTask } from "../../../../firebase/storage/upload-task.svelte.js";
|
|
6
|
-
import { getInitials } from "../../../../utils.js";
|
|
7
|
-
|
|
8
|
-
$effect(() => {
|
|
9
|
-
console.log(progress);
|
|
10
|
-
if (progress === 100 && uploadTask?.downloadURL) {
|
|
11
|
-
console.log("updated data");
|
|
12
|
-
firekitAuthManager.updateUserData({ photoURL: uploadTask?.downloadURL });
|
|
13
|
-
firekitAuthManager.updateProfileInfo({
|
|
14
|
-
displayName: firekitAuthManager.data?.displayName as string,
|
|
15
|
-
photoURL: uploadTask?.downloadURL,
|
|
16
|
-
});
|
|
17
|
-
progress = 0;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
// $effect(()=>{
|
|
22
|
-
// console.log(uploadTask?.downloadURL)
|
|
23
|
-
// })
|
|
24
|
-
|
|
25
|
-
let uploadTask: any = $state(null);
|
|
26
|
-
let progress: number = $derived(uploadTask?.progress || 0 * 1);
|
|
27
|
-
let imageUrl: string = $state("");
|
|
28
|
-
let selectedImage: File | null = $state(null);
|
|
29
|
-
let inputfile: any;
|
|
30
|
-
|
|
31
|
-
async function handleImageUpload(event: Event) {
|
|
32
|
-
const target = event.target as HTMLInputElement;
|
|
33
|
-
const file: File = target.files?.[0] as File;
|
|
34
|
-
|
|
35
|
-
if (file) {
|
|
36
|
-
imageUrl = URL.createObjectURL(file);
|
|
37
|
-
selectedImage = file;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
uploadTask = firekitUploadTask(
|
|
41
|
-
`users-profile/${firekitAuthManager.uid}/profile`,
|
|
42
|
-
file
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
// firekitAuthManager.updateUserData({ photoURL: uploadTask?.downloadURL });
|
|
47
|
-
// firekitAuthManager.updateProfileInfo({
|
|
48
|
-
// displayName: firekitAuthManager.data?.displayName as string,
|
|
49
|
-
// photoURL: uploadTask?.downloadURL,
|
|
50
|
-
// });
|
|
51
|
-
}
|
|
52
|
-
</script>
|
|
53
|
-
|
|
54
|
-
<section class="space-y-5 border-t-slate-200 border-t-[2px] pt-4">
|
|
55
|
-
<div class="grid sm:grid-cols-12 gap-y-1.5 sm:gap-y-0 sm:gap-x-5">
|
|
56
|
-
<div class="sm:col-span-4 xl:col-span-3">
|
|
57
|
-
<p class="sm:mt-2.5 inline-block text-sm text-foreground-500">Profile</p>
|
|
58
|
-
</div>
|
|
59
|
-
|
|
60
|
-
<div class="sm:col-span-8 xl:col-span-9">
|
|
61
|
-
<div class="flex flex-wrap justify-around items-center gap-3 sm:gap-5">
|
|
62
|
-
<div class="flex gap-2 items-center">
|
|
63
|
-
<button onclick={() => inputfile.click()}>
|
|
64
|
-
<Avatar.Root class="size-[70px]">
|
|
65
|
-
<Avatar.Image
|
|
66
|
-
src={firekitAuthManager.data?.photoURL}
|
|
67
|
-
alt="Avatar"
|
|
68
|
-
/>
|
|
69
|
-
<Avatar.Fallback>
|
|
70
|
-
{getInitials(firekitAuthManager.data?.displayName)}
|
|
71
|
-
</Avatar.Fallback>
|
|
72
|
-
</Avatar.Root>
|
|
73
|
-
</button>
|
|
74
|
-
<input
|
|
75
|
-
bind:this={inputfile}
|
|
76
|
-
onchange={handleImageUpload}
|
|
77
|
-
type="file"
|
|
78
|
-
accept="image/*"
|
|
79
|
-
class="hidden"
|
|
80
|
-
/>
|
|
81
|
-
<div class="grid flex-1 text-left text-sm leading-tight">
|
|
82
|
-
<span class="truncate font-semibold"
|
|
83
|
-
>{firekitAuthManager.data?.displayName}</span
|
|
84
|
-
>
|
|
85
|
-
<span class="truncate text-sm text-slate-400"
|
|
86
|
-
>{firekitAuthManager.data?.email}</span
|
|
87
|
-
>
|
|
88
|
-
{#if progress > 0 && !uploadTask?.completed}
|
|
89
|
-
<div
|
|
90
|
-
class="w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"
|
|
91
|
-
>
|
|
92
|
-
<div
|
|
93
|
-
class="bg-blue-600 h-2.5 rounded-full"
|
|
94
|
-
style="width: {progress}%"
|
|
95
|
-
></div>
|
|
96
|
-
</div>
|
|
97
|
-
<p class="text-xs text-gray-500 mt-1">
|
|
98
|
-
Progress: {progress.toFixed(2)}%
|
|
99
|
-
</p>
|
|
100
|
-
{/if}
|
|
101
|
-
</div>
|
|
102
|
-
</div>
|
|
103
|
-
<div></div>
|
|
104
|
-
</div>
|
|
105
|
-
</div>
|
|
106
|
-
</div>
|
|
107
|
-
</section>
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import Button from "../../../ui/button/button.svelte";
|
|
3
|
-
import { firekitAuthManager } from "../../../../firebase/auth/auth-manager.svelte.js";
|
|
4
|
-
|
|
5
|
-
import { Badge } from "../../../ui/badge/index.js";
|
|
6
|
-
import { Plus } from "lucide-svelte";
|
|
7
|
-
import TypeAccount from "../type-account.svelte";
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<section class="space-y-5 border-t-slate-200 border-t-[2px] pt-4">
|
|
11
|
-
<div class="grid sm:grid-cols-12 gap-y-1.5 sm:gap-y-0 sm:gap-x-5">
|
|
12
|
-
<div class="sm:col-span-4 xl:col-span-3 ">
|
|
13
|
-
<p class="sm:mt-2.5 inline-block text-sm text-foreground-500">
|
|
14
|
-
Connected accounts
|
|
15
|
-
</p>
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
<div class="sm:col-span-8 xl:col-span-9">
|
|
19
|
-
<div class="flex flex-wrap justify-around items-center gap-3 sm:gap-5">
|
|
20
|
-
<div class="flex flex-col gap-2 text-sm leading-tight items-start">
|
|
21
|
-
<div class="flex gap-2 items-center">
|
|
22
|
-
<TypeAccount
|
|
23
|
-
account={firekitAuthManager?.user?.providerData[0]?.providerId || "None"}
|
|
24
|
-
></TypeAccount>
|
|
25
|
-
|
|
26
|
-
<span class="truncate text-xs text-slate-600"
|
|
27
|
-
>{firekitAuthManager.email}</span
|
|
28
|
-
>
|
|
29
|
-
|
|
30
|
-
<Badge variant="outline">Primary</Badge>
|
|
31
|
-
</div>
|
|
32
|
-
<Button
|
|
33
|
-
variant="none"
|
|
34
|
-
class="flex justify-start px-0 hover:border-b-slate-500 hover:border-b-[2px] rounded-none"
|
|
35
|
-
>
|
|
36
|
-
<Plus class="size-4"></Plus>
|
|
37
|
-
Connect account
|
|
38
|
-
</Button>
|
|
39
|
-
</div>
|
|
40
|
-
<!-- <Button variant="ghost" size="sm">Edit Profile</Button> -->
|
|
41
|
-
<div></div>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
</section>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
-
$$bindings?: Bindings;
|
|
4
|
-
} & Exports;
|
|
5
|
-
(internal: unknown, props: {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
declare const ConnectUser: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
}, {}, {}, string>;
|
|
17
|
-
type ConnectUser = InstanceType<typeof ConnectUser>;
|
|
18
|
-
export default ConnectUser;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import Button from "../../../ui/button/button.svelte";
|
|
3
|
-
import { firekitAuthManager } from "../../../../firebase/auth/auth-manager.svelte.js";
|
|
4
|
-
|
|
5
|
-
import Input from "../../../ui/input/input.svelte";
|
|
6
|
-
import { toast } from "svelte-sonner";
|
|
7
|
-
|
|
8
|
-
let email: string = $state("");
|
|
9
|
-
let haserror = $state(false);
|
|
10
|
-
|
|
11
|
-
$effect(() => {
|
|
12
|
-
email = firekitAuthManager.data?.email as string;
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
async function handleChangeEmail() {
|
|
16
|
-
console.log(email);
|
|
17
|
-
haserror = false;
|
|
18
|
-
console.log(firekitAuthManager.data?.email);
|
|
19
|
-
if (email === firekitAuthManager.data?.email) {
|
|
20
|
-
toast.error("The email is the same as your current email.");
|
|
21
|
-
haserror = true;
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (!isValidEmail()) {
|
|
26
|
-
toast.error("Please enter a valid email address.");
|
|
27
|
-
haserror = true;
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
await firekitAuthManager.updateEmailUser(email);
|
|
32
|
-
// toast.success("Email updated successfully!");
|
|
33
|
-
// setTimeout(async () => {
|
|
34
|
-
// await firekitAuth.logOut();
|
|
35
|
-
// }, 4500);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function isValidEmail() {
|
|
39
|
-
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
40
|
-
return emailRegex.test(email);
|
|
41
|
-
}
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
<section class="space-y-5 border-t-slate-200 border-t-[2px] pt-4">
|
|
45
|
-
<div class="grid sm:grid-cols-12 gap-y-1.5 sm:gap-y-0 sm:gap-x-5">
|
|
46
|
-
<div class="sm:col-span-4 xl:col-span-3">
|
|
47
|
-
<p
|
|
48
|
-
class="sm:mt-2.5 inline-block text-sm {haserror
|
|
49
|
-
? 'text-red-500'
|
|
50
|
-
: 'text-foreground-500'}"
|
|
51
|
-
>
|
|
52
|
-
Email address
|
|
53
|
-
</p>
|
|
54
|
-
</div>
|
|
55
|
-
|
|
56
|
-
<div class="sm:col-span-8 xl:col-span-9">
|
|
57
|
-
<div class="flex flex-wrap items-center gap-3 sm:gap-5 ">
|
|
58
|
-
<div class="flex gap-2 items-center w-full ">
|
|
59
|
-
<div class="flex flex-col gap-2 text-sm leading-tight w-[250px]">
|
|
60
|
-
<div class=" space-y-1 my-2 w-auto ">
|
|
61
|
-
<!-- <Label class={haserror ? "text-red-500" : ""}>Email:</Label> -->
|
|
62
|
-
<Input
|
|
63
|
-
class=" w-full {haserror ? 'border border-red-500' : ''}"
|
|
64
|
-
bind:value={email}
|
|
65
|
-
placeholder="Introduce email"
|
|
66
|
-
/>
|
|
67
|
-
</div>
|
|
68
|
-
<Button
|
|
69
|
-
onclick={handleChangeEmail}
|
|
70
|
-
variant="default"
|
|
71
|
-
class="bg-blue-500 hover:bg-blue-600 text-white block ml-auto"
|
|
72
|
-
>
|
|
73
|
-
Save
|
|
74
|
-
</Button>
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
<div></div>
|
|
78
|
-
</div>
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
</section>
|