From 00a77bebd5121a45cdcb4d890e0a57c4f727d7ba Mon Sep 17 00:00:00 2001 From: Aryan Singh Date: Sun, 15 Oct 2023 20:40:21 +0530 Subject: [PATCH 1/5] fix: can't update user profile bio passed 256 chars --- .../organisms/UserSettingsPage/user-settings-page.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/organisms/UserSettingsPage/user-settings-page.tsx b/components/organisms/UserSettingsPage/user-settings-page.tsx index 26d7fd8eac..9a02fe4503 100644 --- a/components/organisms/UserSettingsPage/user-settings-page.tsx +++ b/components/organisms/UserSettingsPage/user-settings-page.tsx @@ -51,6 +51,7 @@ const UserSettingsPage = ({ user }: userSettingsPageProps) => { const [timezone, setTimezone] = useState(""); const [userInfo, setUserInfo] = useState(); const [email, setEmail] = useState(""); + const [bio, setBio] = useState(""); const [emailPreference, setEmailPreference] = useState({ // eslint-disable-next-line camelcase display_email: false, @@ -71,7 +72,8 @@ const UserSettingsPage = ({ user }: userSettingsPageProps) => { setEmail(response.email); setDisplayLocalTime(response.display_local_time); setCoupon(response.coupon_code); - formRef.current!.bio.value = response.bio; + //formRef.current!.bio.value = response.bio; + setBio(response.bio); formRef.current!.url.value = response.url; formRef.current!.twitter_username.value = response.twitter_username; formRef.current!.company.value = response.company; @@ -162,7 +164,7 @@ const UserSettingsPage = ({ user }: userSettingsPageProps) => { const payload: UpdateUserPayload = { name: formRef.current!.nameInput.value, email, - bio: formRef.current!.bio.value, + bio: bio, // eslint-disable-next-line camelcase twitter_username: formRef.current!.twitter_username.value, company: formRef.current!.company.value, @@ -223,11 +225,15 @@ const UserSettingsPage = ({ user }: userSettingsPageProps) => {
+
{bio?.length}/255
Date: Mon, 16 Oct 2023 23:54:25 +0530 Subject: [PATCH 2/5] requested changes --- .../organisms/UserSettingsPage/user-settings-page.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/organisms/UserSettingsPage/user-settings-page.tsx b/components/organisms/UserSettingsPage/user-settings-page.tsx index 9a02fe4503..525907a4ae 100644 --- a/components/organisms/UserSettingsPage/user-settings-page.tsx +++ b/components/organisms/UserSettingsPage/user-settings-page.tsx @@ -51,7 +51,7 @@ const UserSettingsPage = ({ user }: userSettingsPageProps) => { const [timezone, setTimezone] = useState(""); const [userInfo, setUserInfo] = useState(); const [email, setEmail] = useState(""); - const [bio, setBio] = useState(""); + const [bio, setBio] = useState(""); const [emailPreference, setEmailPreference] = useState({ // eslint-disable-next-line camelcase display_email: false, @@ -72,7 +72,6 @@ const UserSettingsPage = ({ user }: userSettingsPageProps) => { setEmail(response.email); setDisplayLocalTime(response.display_local_time); setCoupon(response.coupon_code); - //formRef.current!.bio.value = response.bio; setBio(response.bio); formRef.current!.url.value = response.url; formRef.current!.twitter_username.value = response.twitter_username; @@ -164,7 +163,7 @@ const UserSettingsPage = ({ user }: userSettingsPageProps) => { const payload: UpdateUserPayload = { name: formRef.current!.nameInput.value, email, - bio: bio, + bio, // eslint-disable-next-line camelcase twitter_username: formRef.current!.twitter_username.value, company: formRef.current!.company.value, @@ -233,7 +232,7 @@ const UserSettingsPage = ({ user }: userSettingsPageProps) => { value={bio} onChange={(e) => setBio(e.target.value)} > -
{bio?.length}/255
+

{bio?.length}/255

Date: Tue, 17 Oct 2023 10:52:47 +0530 Subject: [PATCH 3/5] added bio too long message --- .../organisms/UserSettingsPage/user-settings-page.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/organisms/UserSettingsPage/user-settings-page.tsx b/components/organisms/UserSettingsPage/user-settings-page.tsx index 525907a4ae..446f24a31e 100644 --- a/components/organisms/UserSettingsPage/user-settings-page.tsx +++ b/components/organisms/UserSettingsPage/user-settings-page.tsx @@ -224,7 +224,6 @@ const UserSettingsPage = ({ user }: userSettingsPageProps) => {
-

{bio?.length}/255

+ {bio?.length > 255 ? ( +

Bio too long

+ ) : ( +

{bio?.length}/255

+ )}
Date: Tue, 17 Oct 2023 21:31:51 +0530 Subject: [PATCH 4/5] Update components/organisms/UserSettingsPage/user-settings-page.tsx Co-authored-by: Nick Taylor --- components/organisms/UserSettingsPage/user-settings-page.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/organisms/UserSettingsPage/user-settings-page.tsx b/components/organisms/UserSettingsPage/user-settings-page.tsx index 446f24a31e..30442a6ad5 100644 --- a/components/organisms/UserSettingsPage/user-settings-page.tsx +++ b/components/organisms/UserSettingsPage/user-settings-page.tsx @@ -232,9 +232,9 @@ const UserSettingsPage = ({ user }: userSettingsPageProps) => { onChange={(e) => setBio(e.target.value)} > {bio?.length > 255 ? ( -

Bio too long

+

Bio too long

) : ( -

{bio?.length}/255

+

{bio?.length}/255

)} Date: Tue, 17 Oct 2023 21:39:21 +0530 Subject: [PATCH 5/5] fixed lint issues --- .../organisms/UserSettingsPage/user-settings-page.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/organisms/UserSettingsPage/user-settings-page.tsx b/components/organisms/UserSettingsPage/user-settings-page.tsx index 30442a6ad5..bed31403aa 100644 --- a/components/organisms/UserSettingsPage/user-settings-page.tsx +++ b/components/organisms/UserSettingsPage/user-settings-page.tsx @@ -232,9 +232,13 @@ const UserSettingsPage = ({ user }: userSettingsPageProps) => { onChange={(e) => setBio(e.target.value)} > {bio?.length > 255 ? ( -

Bio too long

+

+ Bio too long +

) : ( -

{bio?.length}/255

+

+ {bio?.length}/255 +

)}