Link commenter and following names to their user profile pages

This commit is contained in:
Aaron Po
2026-09-12 18:04:11 -04:00
parent 66ba43888b
commit 5449b284cb
7 changed files with 29 additions and 5 deletions

View File

@@ -28,13 +28,14 @@ export const loader = async ({ request, params }: Route.LoaderArgs) => {
brewery,
loggedIn: auth !== null,
username: auth?.username ?? null,
userAccountId: auth?.userAccountId ?? null,
};
};
const initials = (username: string) => username.slice(0, 2).toUpperCase();
const BreweryDetail = ({ loaderData }: Route.ComponentProps) => {
const { brewery, loggedIn, username } = loaderData;
const { brewery, loggedIn, username, userAccountId } = loaderData;
const [liked, setLiked] = useState(false);
const [likeCount, setLikeCount] = useState(FILLER_BREWERY_META.likeCount);
@@ -57,6 +58,7 @@ const BreweryDetail = ({ loaderData }: Route.ComponentProps) => {
{
id: crypto.randomUUID(),
user: username ?? 'you',
userAccountId: userAccountId ?? '',
initials: username ? initials(username) : 'YO',
rating: yourRating,
time: 'just now',