From 563384030926c21e29b40c8784d5fd01803e687e Mon Sep 17 00:00:00 2001 From: Bartek Paczesny Date: Fri, 22 Dec 2023 20:05:38 +0100 Subject: [PATCH] asd --- app/layout.tsx | 12 +- app/panel/settings/account.tsx | 442 ++++++++++++++++----------------- 2 files changed, 226 insertions(+), 228 deletions(-) diff --git a/app/layout.tsx b/app/layout.tsx index db80807..99ab12c 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -3,6 +3,8 @@ import type { Metadata } from "next"; import "@/app/tailwind.css"; import AuthProvider from "@/context/AuthProvider"; +import { EdgeStoreProvider } from "@/lib/edgestore"; + import { ToastContainer } from "react-toastify"; import "react-toastify/dist/ReactToastify.css"; @@ -29,10 +31,12 @@ export default function RootLayout({ return ( - - {children} - - + + + {children} + + + ); diff --git a/app/panel/settings/account.tsx b/app/panel/settings/account.tsx index 7ee535c..f68a082 100644 --- a/app/panel/settings/account.tsx +++ b/app/panel/settings/account.tsx @@ -5,7 +5,7 @@ import { signOut, useSession } from "next-auth/react"; import Image from "next/image"; import { useEffect, useState } from "react"; import { toast } from "react-toastify"; -import { EdgeStoreProvider, useEdgeStore } from "@/lib/edgestore"; +import { useEdgeStore } from "@/lib/edgestore"; import clsx from "clsx"; import { Loader2 } from "lucide-react"; @@ -93,262 +93,256 @@ function Account({}: Props) { }, [session?.user.avatar]); return ( - -
-
-
-

- Informacje osobiste -

-

- Użyj szkolnego adresu, aby otrzymywać powiadomienia. -

-
+
+
+
+

+ Informacje osobiste +

+

+ Użyj szkolnego adresu, aby otrzymywać powiadomienia. +

+
-
{ - await handleUserChange( - event, - session!, - setLoading, - edgestore, - avatarFile - ); - }} - className="md:col-span-2" - > -
-
- { + await handleUserChange( + event, + session!, + setLoading, + edgestore, + avatarFile + ); + }} + className="md:col-span-2" + > +
+
+ +
+ { + // add a constraint to accept only images that are smaller than 1MB + if ( + e.target.files?.[0].size! > 1000000 + ) { + toast.error( + "Wybrany plik jest za duży. Maksymalny rozmiar to 1MB." + ); + return; + } else { + setAvatarFile(e.target.files?.[0]); + setTemporaryUploadUrl( + URL.createObjectURL( + e.target.files?.[0]! + ) + ); + } + }} + className="hidden" /> -
- { - // add a constraint to accept only images that are smaller than 1MB - if ( - e.target.files?.[0].size! > - 1000000 - ) { - toast.error( - "Wybrany plik jest za duży. Maksymalny rozmiar to 1MB." - ); - return; - } else { - setAvatarFile( - e.target.files?.[0] - ); - setTemporaryUploadUrl( - URL.createObjectURL( - e.target.files?.[0]! - ) - ); - } - }} - className="hidden" - /> - -

- JPG, GIF lub PNG. 1MB max. -

-
-
- -
-
- -
+

+ JPG, GIF lub PNG. 1MB max. +

+
-
- -
- -
+
+ +
+
+
-
- -
- -
+
+ +
+
-
- + Adres email + +
+ +
- -
+
-
-
-

- Zaktualizuj hasło -

-

- Zaktualizuj hasło powiązane z Twoim kontem. -

+
+
+ +
-
-
-
- -
- -
-
+
+
+

+ Zaktualizuj hasło +

+

+ Zaktualizuj hasło powiązane z Twoim kontem. +

+
-
- -
- -
+ +
+
+ +
+
+
-
- -
- -
+
+ +
+
-
- + Potwierdź nowe hasło + +
+ +
- -
- -
-
-

- Usuń konto -

-

- Czy na pewno chcesz usunąć swoje konto? Ta akcja - jest nieodwracalna. Wszystkie informacje związane z - tym kontem zostaną trwale usunięte. -

-
+
- +
+ +
+ +
+
+

+ Usuń konto +

+

+ Czy na pewno chcesz usunąć swoje konto? Ta akcja jest + nieodwracalna. Wszystkie informacje związane z tym + kontem zostaną trwale usunięte. +

+ +
+ +
- +
); }