diff --git a/frontend/pages/_app.tsx b/frontend/pages/_app.tsx index 471768f..e972de1 100755 --- a/frontend/pages/_app.tsx +++ b/frontend/pages/_app.tsx @@ -10,6 +10,17 @@ function MyApp({ Component, pageProps }: AppProps) { pronouns.cc + + + + + + + diff --git a/frontend/pages/u/[user]/index.tsx b/frontend/pages/u/[user]/index.tsx index a1aa3bd..5f95216 100644 --- a/frontend/pages/u/[user]/index.tsx +++ b/frontend/pages/u/[user]/index.tsx @@ -32,9 +32,7 @@ interface Props { export default function Index({ user, partialMembers }: Props) { return ( <> - - {`@${user.username} - pronouns.cc`} - +
{ } }; +function UserHead({ user }: { user: User }) { + let description = ""; + if ( + user.names?.filter((name) => name.status === WordStatus.Favourite) + ?.length && + user.pronouns?.filter((pronoun) => pronoun.status === WordStatus.Favourite) + ?.length + ) { + description = `@${user.username} goes by ${user.names + .filter((name) => name.status === WordStatus.Favourite) + .join(", ")} and uses ${user.pronouns + .filter((pronoun) => pronoun.status === WordStatus.Favourite) + .join(", ")} pronouns.`; + } else if ( + user.names?.filter((name) => name.status === WordStatus.Favourite)?.length + ) { + description = `@${user.username} goes by ${user.names + .filter((name) => name.status === WordStatus.Favourite) + .join(", ")}.`; + } else if ( + user.pronouns?.filter((pronoun) => pronoun.status === WordStatus.Favourite) + ?.length + ) { + description = `@${user.username} uses ${user.pronouns + .filter((pronoun) => pronoun.status === WordStatus.Favourite) + .join(", ")} pronouns.`; + } + + if (user.bio && user.bio !== "") { + description += `\n\n${user.bio.slice(0, 500)}`; + description.trim(); + } + + return ( + + {`@${user.username} - pronouns.cc`} + + + + {user.avatar_urls && user.avatar_urls.length > 0 ? ( + + ) : ( + <> + )} + + + + ); +} + function IsOwnPageNotice({ user }: { user: User }) { const isThisMyPage = useRecoilValue(userState)?.id === user.id; return isThisMyPage || true ? (