feat(frontend): show user profile fields
This commit is contained in:
parent
4ba28bbfde
commit
4732451040
7 changed files with 95 additions and 55 deletions
|
@ -8,15 +8,14 @@ import {
|
|||
import classNames from "classnames";
|
||||
import { ReactNode } from "react";
|
||||
import StatusIcon from "~/components/StatusIcon";
|
||||
import PronounLink from "~/components/PronounLink";
|
||||
|
||||
export default function StatusLine({
|
||||
entry,
|
||||
preferences,
|
||||
children,
|
||||
}: {
|
||||
entry: FieldEntry | Pronoun;
|
||||
preferences: Record<string, CustomPreference>;
|
||||
children: ReactNode;
|
||||
}) {
|
||||
const mergedPrefs = Object.assign({}, defaultPreferences, preferences);
|
||||
const currentPref =
|
||||
|
@ -28,9 +27,19 @@ export default function StatusLine({
|
|||
"fs-6": currentPref.size == PreferenceSize.Small,
|
||||
});
|
||||
|
||||
if ("display_text" in entry) {
|
||||
const pronoun = entry as Pronoun;
|
||||
return (
|
||||
<span className={classes}>
|
||||
<StatusIcon preferences={preferences} status={entry.status} />{" "}
|
||||
<PronounLink pronoun={pronoun} />
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<span className={classes}>
|
||||
<StatusIcon preferences={preferences} status={entry.status} /> {children}
|
||||
<StatusIcon preferences={preferences} status={entry.status} /> {entry.value}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue