diff --git a/README.md b/README.md index 0113245..a03ed44 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,10 @@ - [x] Email - [x] Pasword - [x] Delete Account - - [ ] Password Recovery - - [ ] Custom Error Pages from Supabase Reponse (400) - - [ ] 2FA Support - - [ ] Passwordless Login (OTP Email) - - [ ] Banners (Success and Error Messages) + - [x] Banners (Success and Error Messages) + - [ ] ~~Password Recovery~~ (Failed) + - [ ] ~~Custom Error Pages from Supabase Reponse (400)~~ (FAILED) + - [ ] ~~Passwordless Login (OTP Email)~~ (FAILED) ## Setting Up Supabase ### Selfhosting diff --git a/src/components/Banner.astro b/src/components/Banner.astro new file mode 100644 index 0000000..8d22332 --- /dev/null +++ b/src/components/Banner.astro @@ -0,0 +1,71 @@ +--- +if (Astro.url.href.endsWith('CheckEmail')) {var MessageCheckEmail = true} +else {var MessageCheckEmail = false} + +if (Astro.url.href.endsWith('AvatarUpdated')) {var MessageAvatarUpdated = true} +else {var MessageAvatarUpdated = false} + +if (Astro.url.href.endsWith('NameUpdated')) {var MessageNameUpdated = true} +else {var MessageNameUpdated = false} + +if (Astro.url.href.endsWith('EmailConfirmed')) {var MessageEmailConfirmed = true} +else {var MessageEmailConfirmed = false} + +if (Astro.url.href.endsWith('PasswordReset')) {var MessagePasswordReset = true} +else {var MessagePasswordReset = false} +--- + +{MessageCheckEmail ? + + : + null +} + +{MessageAvatarUpdated ? + + : + null +} + +{MessageNameUpdated ? + + : + null +} + +{MessageEmailConfirmed ? + + : + null +} + +{MessagePasswordReset ? + + : + null +} + + + \ No newline at end of file diff --git a/src/layouts/Base.astro b/src/layouts/Base.astro index 8763377..16a19eb 100644 --- a/src/layouts/Base.astro +++ b/src/layouts/Base.astro @@ -1,5 +1,6 @@ --- const {Title} = Astro.props +import Banner from "@components/Banner.astro" import Head from "@components/Head.astro" import Header from "@components/Header.astro" import '@styles/root.scss' @@ -10,6 +11,7 @@ import '@styles/root.scss'
+
diff --git a/src/layouts/Error.astro b/src/layouts/Error.astro new file mode 100644 index 0000000..6a22a92 --- /dev/null +++ b/src/layouts/Error.astro @@ -0,0 +1,16 @@ +--- +const {Title, Message} = Astro.props +import Head from "@components/Head.astro" +import Header from "@components/Header.astro" +import '@styles/root.scss' +--- + + + +
+ +
+

{Message}

+
+ + \ No newline at end of file diff --git a/src/layouts/Settings.astro b/src/layouts/Settings.astro index 0247212..6bae45c 100644 --- a/src/layouts/Settings.astro +++ b/src/layouts/Settings.astro @@ -1,5 +1,6 @@ --- const {Title} = Astro.props +import Banner from "@components/Banner.astro" import Head from "@components/Head.astro" import Header from "@components/Header.astro" import '@styles/root.scss' @@ -10,6 +11,7 @@ import '@styles/root.scss'
+
Account diff --git a/src/pages/500.astro b/src/pages/500.astro new file mode 100644 index 0000000..883b631 --- /dev/null +++ b/src/pages/500.astro @@ -0,0 +1,12 @@ +--- +import Base from "@layouts/Base.astro" +interface Props { + error: unknown +} + +const { error } = Astro.props +--- + + +
{error instanceof Error ? error.message : 'Unknown error'}
+ \ No newline at end of file diff --git a/src/pages/e/[...slug].astro b/src/pages/e/[...slug].astro new file mode 100644 index 0000000..9936974 --- /dev/null +++ b/src/pages/e/[...slug].astro @@ -0,0 +1,5 @@ +--- +import Base from "@layouts/Base.astro" +--- + + \ No newline at end of file diff --git a/src/pages/index.astro b/src/pages/index.astro index be21bd4..52ecc50 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -19,16 +19,10 @@ const id = user?.id const { data: channels, error } = await supabase .from('channels') .select('*') - - - - let { data: subs } = await supabase +let { data: subs } = await supabase .from('subs') .select("*") .eq('UserSubscribed', id) - - -console.log(subs) ---