From 31cde43278f6497aa72443b68f30c08ae1e09696 Mon Sep 17 00:00:00 2001 From: Ahmed Rowaihi Date: Mon, 13 Feb 2023 08:52:32 +0300 Subject: [PATCH 1/4] HTML auto direction for specific textual content --- src/Element/Text.tsx | 2 +- src/Element/Textarea.tsx | 1 + src/Pages/ProfilePage.tsx | 12 +++++++----- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Element/Text.tsx b/src/Element/Text.tsx index a7ab2c4d..a460b674 100644 --- a/src/Element/Text.tsx +++ b/src/Element/Text.tsx @@ -128,7 +128,7 @@ export default function Text({ content, tags, creator, users }: TextProps) { function transformParagraph(frag: TextFragment) { const fragments = transformText(frag); if (fragments.every(f => typeof f === "string")) { - return

{fragments}

; + return

{fragments}

; } return <>{fragments}; } diff --git a/src/Element/Textarea.tsx b/src/Element/Textarea.tsx index 7d5923e2..0c012758 100644 --- a/src/Element/Textarea.tsx +++ b/src/Element/Textarea.tsx @@ -72,6 +72,7 @@ const Textarea = (props: TextareaProps) => { return ( // @ts-expect-error If anybody can figure out how to type this, please do Loading...} placeholder={formatMessage(messages.NotePlaceholder)} diff --git a/src/Pages/ProfilePage.tsx b/src/Pages/ProfilePage.tsx index 26bce38f..a4a85ba5 100644 --- a/src/Pages/ProfilePage.tsx +++ b/src/Pages/ProfilePage.tsx @@ -1,5 +1,5 @@ import "./ProfilePage.css"; -import { useEffect, useMemo, useState } from "react"; +import React, { useEffect, useMemo, useState } from "react"; import { useIntl, FormattedMessage } from "react-intl"; import { useSelector } from "react-redux"; import { useNavigate, useParams } from "react-router-dom"; @@ -150,10 +150,12 @@ export default function ProfilePage() { function bio() { return ( - aboutText.length > 0 && ( - <> -
{about}
- + aboutText.length && ( + +
+ {about} +
+
) ); } -- 2.45.2 From 24bf31342037e0547c94e7fbcfcf71dece8635ff Mon Sep 17 00:00:00 2001 From: Alejandro Gomez Date: Mon, 13 Feb 2023 11:10:53 +0100 Subject: [PATCH 2/4] fix: remove unneeded fragment --- src/Pages/ProfilePage.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Pages/ProfilePage.tsx b/src/Pages/ProfilePage.tsx index a4a85ba5..da2d5994 100644 --- a/src/Pages/ProfilePage.tsx +++ b/src/Pages/ProfilePage.tsx @@ -151,11 +151,9 @@ export default function ProfilePage() { function bio() { return ( aboutText.length && ( - -
- {about} -
-
+
+ {about} +
) ); } -- 2.45.2 From 5d7481e1bb4609bd58524e635c38f0690668b0af Mon Sep 17 00:00:00 2001 From: Alejandro Gomez Date: Mon, 13 Feb 2023 11:28:29 +0100 Subject: [PATCH 3/4] fix: onboarding lang settings --- src/Element/Collapsed.tsx | 26 ++++++++++---------------- src/Pages/new/DiscoverFollows.tsx | 4 ++-- src/Pages/new/GetVerified.tsx | 2 +- src/Pages/new/ImportFollows.tsx | 24 +++++++++++++----------- src/Pages/new/NewUserFlow.tsx | 2 +- src/Pages/new/NewUsername.tsx | 2 +- src/index.css | 8 ++++---- 7 files changed, 32 insertions(+), 36 deletions(-) diff --git a/src/Element/Collapsed.tsx b/src/Element/Collapsed.tsx index c96202d7..04593766 100644 --- a/src/Element/Collapsed.tsx +++ b/src/Element/Collapsed.tsx @@ -22,19 +22,11 @@ const Collapsed = ({ text, children, collapsed, setCollapsed }: CollapsedProps) interface CollapsedIconProps { icon: ReactNode; - children: ReactNode; collapsed: boolean; } -export const CollapsedIcon = ({ icon, children, collapsed }: CollapsedIconProps) => { - return collapsed ? ( -
{icon}
- ) : ( -
- {icon} - {children} -
- ); +export const CollapsedIcon = ({ icon, collapsed }: CollapsedIconProps) => { + return collapsed ?
{icon}
:
{icon}
; }; interface CollapsedSectionProps { @@ -50,12 +42,14 @@ export const CollapsedSection = ({ title, children }: CollapsedSectionProps) => ); return ( -
-

setCollapsed(!collapsed)}>{title}

- - {children} - -
+ <> +
+

setCollapsed(!collapsed)}>{title}

+ +
+ + {collapsed ? null : children} + ); }; diff --git a/src/Pages/new/DiscoverFollows.tsx b/src/Pages/new/DiscoverFollows.tsx index 9bd8993b..32c3d72f 100644 --- a/src/Pages/new/DiscoverFollows.tsx +++ b/src/Pages/new/DiscoverFollows.tsx @@ -13,7 +13,7 @@ export default function DiscoverFollows() { }, []); return ( -
+
@@ -26,7 +26,7 @@ export default function DiscoverFollows() {

- {sortedReccomends.length > 0 && } +
{sortedReccomends.length > 0 && }
); } diff --git a/src/Pages/new/GetVerified.tsx b/src/Pages/new/GetVerified.tsx index 166be02a..1b68db13 100644 --- a/src/Pages/new/GetVerified.tsx +++ b/src/Pages/new/GetVerified.tsx @@ -24,7 +24,7 @@ export default function GetVerified() { }; return ( -
+
diff --git a/src/Pages/new/ImportFollows.tsx b/src/Pages/new/ImportFollows.tsx index 94922cea..45d57bd3 100644 --- a/src/Pages/new/ImportFollows.tsx +++ b/src/Pages/new/ImportFollows.tsx @@ -49,7 +49,7 @@ export default function ImportFollows() { } return ( -
+
@@ -84,16 +84,18 @@ export default function ImportFollows() {
{error.length > 0 && {error}} - {sortedTwitterFollows.length > 0 && ( - - - - } - pubkeys={sortedTwitterFollows} - /> - )} +
+ {sortedTwitterFollows.length > 0 && ( + + + + } + pubkeys={sortedTwitterFollows} + /> + )} +