diff --git a/src/controllers/modals/components/legacy/UserProfile.tsx b/src/controllers/modals/components/legacy/UserProfile.tsx index 0ec0eebd..e7f82328 100644 --- a/src/controllers/modals/components/legacy/UserProfile.tsx +++ b/src/controllers/modals/components/legacy/UserProfile.tsx @@ -41,8 +41,8 @@ import { ModalProps } from "../../types"; export const UserProfile = observer( ({ user_id, - dummy, - dummyProfile, + isPlaceholder, + placeholderProfile, ...props }: ModalProps<"user_profile">) => { const [profile, setProfile] = useState< @@ -87,21 +87,21 @@ export const UserProfile = observer( }, [user_id]); useEffect(() => { - if (dummy) { - setProfile(dummyProfile); + if (isPlaceholder) { + setProfile(placeholderProfile); } - }, [dummy, dummyProfile]); + }, [isPlaceholder, placeholderProfile]); useEffect(() => { - if (dummy) return; + if (isPlaceholder) return; if (session.state === "Online" && typeof mutual === "undefined") { setMutual(null); user.fetchMutual().then(setMutual); } - }, [mutual, session.state, dummy, user]); + }, [mutual, session.state, isPlaceholder, user]); useEffect(() => { - if (dummy) return; + if (isPlaceholder) return; if (session.state === "Online" && typeof profile === "undefined") { setProfile(null); @@ -109,7 +109,7 @@ export const UserProfile = observer( user.fetchProfile().then(setProfile).catch(noop); } } - }, [profile, session.state, dummy, user]); + }, [profile, session.state, isPlaceholder, user]); useEffect(() => { if ( @@ -169,7 +169,8 @@ export const UserProfile = observer( onClick={() => modalController.writeText(user.username) }> - @{user.username} + {"@"} + {user.username} {user.status?.text && ( @@ -184,11 +185,11 @@ export const UserProfile = observer( palette="accent" compact onClick={props.onClose}> - Add to server + {"Add to server" /* FIXME: i18n */} )} - {user.relationship === "Friend" && ( + {(user.relationship === "Friend" || user.bot) && ( )} - {user.relationship === "User" && !dummy && ( + {user.relationship === "User" && !isPlaceholder && ( { props.onClose?.(); @@ -237,11 +238,13 @@ export const UserProfile = observer( {user.relationship !== "User" && ( <> -
setTab("friends")}> - -
+ {!user.bot && ( +
setTab("friends")}> + +
+ )}
setTab("groups")}> @@ -281,8 +284,9 @@ export const UserProfile = observer( ) : undefined} {user.bot ? ( <> + {/* FIXME: this too */}
- bot owner + {"bot owner"}
@@ -432,12 +436,12 @@ export const UserProfile = observer( ); - if (dummy) return
{children}
; + if (isPlaceholder) return
{children}
; return ( {children} diff --git a/src/controllers/modals/types.ts b/src/controllers/modals/types.ts index 1275fe4c..033776a6 100644 --- a/src/controllers/modals/types.ts +++ b/src/controllers/modals/types.ts @@ -98,8 +98,8 @@ export type Modal = { | { type: "user_profile"; user_id: string; - dummy?: boolean; - dummyProfile?: API.UserProfile; + isPlaceholder?: boolean; + placeholderProfile?: API.UserProfile; } | { type: "create_bot"; diff --git a/src/pages/settings/panes/Profile.tsx b/src/pages/settings/panes/Profile.tsx index 76f68e37..75b01403 100644 --- a/src/pages/settings/panes/Profile.tsx +++ b/src/pages/settings/panes/Profile.tsx @@ -72,8 +72,8 @@ export const Profile = observer(() => {