diff --git a/apps/desktop/layer/renderer/src/modules/profile/user-profile-modal/UserProfileModalContent.tsx b/apps/desktop/layer/renderer/src/modules/profile/user-profile-modal/UserProfileModalContent.tsx index 1a3a3ccd5..7b036db86 100644 --- a/apps/desktop/layer/renderer/src/modules/profile/user-profile-modal/UserProfileModalContent.tsx +++ b/apps/desktop/layer/renderer/src/modules/profile/user-profile-modal/UserProfileModalContent.tsx @@ -1,5 +1,4 @@ import { Spring } from "@follow/components/constants/spring.js" -import { FollowIcon } from "@follow/components/icons/follow.jsx" import { Avatar, AvatarFallback, AvatarImage } from "@follow/components/ui/avatar/index.jsx" import { ActionButton, Button } from "@follow/components/ui/button/index.js" import { LoadingCircle } from "@follow/components/ui/loading/index.jsx" @@ -229,102 +228,112 @@ export const UserProfileModalContent: FC = ({ use type PickedUser = ReturnType const UserInfo = ({ userInfo }: { userInfo: PickedUser }) => { - const { t } = useTranslation() const whoami = useWhoami() const follow = useFollow() + + // It's a string value when it's from the store + if (typeof userInfo.socialLinks === "string") { + userInfo.socialLinks = JSON.parse(userInfo.socialLinks) + } + return ( -
-
- - - - {userInfo.name?.slice(0, 2)} - - -
-

{userInfo.name}

-

+

+
+
+
+ + + + {userInfo.name?.slice(0, 2)} + + + + {whoami?.id !== userInfo.id && ( + + )} +
+
+

+ {userInfo.name} +

+

+ @{userInfo.handle} +

+
+
+ +
+ {userInfo.bio && ( +

{userInfo.bio}

)} - > - @{userInfo.handle} -

- {whoami?.id !== userInfo.id && ( - - )} + {userInfo.website && ( + + {userInfo.website.replace(/^https?:\/\//, "")} + + + )} +
-
-
- ) -} -const UserSocialSection = ({ user }: { user: PickedUser }) => { - const { t } = useTranslation() - if (!user || (!user.bio && !user.website && !user.socialLinks)) return null + {userInfo.socialLinks && Object.values(userInfo.socialLinks).filter(Boolean).length > 0 && ( +
+

+ Social Media +

+
+ {Object.entries(userInfo.socialLinks).map(([platform, id]) => { + if (!id || !(platform in socialIconClassNames) || typeof id !== "string") + return null - return ( -
-

- {t("user_profile.about")} -

- {user.bio &&

{user.bio}

} -
- {user.website && ( - - - {user.website.replace(/^https?:\/\//, "")} - - )} - {user.socialLinks && ( -
- {Object.entries(user.socialLinks).map(([platform, id]) => { - if (!id || !(platform in socialIconClassNames)) return null - - return ( - - - - - - - - {socialCopyMap[platform as keyof typeof socialCopyMap]} - - - ) - })} + return ( + + + + + + + + {socialCopyMap[platform as keyof typeof socialCopyMap]} + + + ) + })} +
)}
@@ -338,7 +347,7 @@ const Subscriptions = ({ userId }: { userId: string }) => { return ( <> -
+

{t("user_profile.subscriptions")}

{ - {!lists.isLoading && ( -
+
{/* Lists Section */} {lists.data && lists.data.length > 0 && } {/* Subscriptions Section */}