From f564e9629f77654a7f1c74f87103feafea242bdb Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Sun, 3 Aug 2025 23:28:14 +0200 Subject: [PATCH] Improve images --- app/complete-profile/page.tsx | 45 +++++++++++++++++------------------ lib/client/profile.tsx | 21 +++++++++------- 2 files changed, 35 insertions(+), 31 deletions(-) diff --git a/app/complete-profile/page.tsx b/app/complete-profile/page.tsx index 78c60fd4..df5def99 100644 --- a/app/complete-profile/page.tsx +++ b/app/complete-profile/page.tsx @@ -210,14 +210,9 @@ function RegisterComponent() { return; } - if (file.size > 10 * 1024 * 1024) { - setError('Image size must be less than 10MB'); - return; - } - // Compression options const options = { - maxSizeMB: 10, // Target max size in MB + maxSizeMB: 1, // Target max size in MB maxWidthOrHeight: 1024, // Resize to fit within this dimension useWebWorker: true, }; @@ -610,6 +605,24 @@ function RegisterComponent() { } + function errorBlock() { + return
+
+
+ + + +
+
+

{error}

+
+
+
+ } + return (
@@ -619,23 +632,7 @@ function RegisterComponent() {
- {error && ( -
-
-
- - - -
-
-

{error}

-
-
-
- )} + {error && errorBlock()}
@@ -966,6 +963,8 @@ function RegisterComponent() { )}
+ {error && errorBlock()} +
) : @@ -232,7 +234,8 @@ export function getProfile(url: string, header: any = null) { { userData?.profile?.introversion && (
-

Introversion - Extroversion

+

Introversion - + Extroversion

< p className="mt-1 capitalize"> {100 - userData.profile.introversion}%

@@ -311,13 +314,15 @@ export function getProfile(url: string, header: any = null) { {Array.from(new Set(images)).map((img, index) => ( // Set is a hack to avoid a bug where duplicates fill in images when we navigate different pages
- {`Uploaded + + {`Uploaded +
))}