Add authenticated user profile page with locked-down account endpoint (#315)

This commit is contained in:
Aaron Po
2026-09-23 00:58:54 -04:00
committed by GitHub
parent a6a9046457
commit 0ff42c3c70
45 changed files with 1418 additions and 80 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 ?? undefined,
initials: username ? initials(username) : 'YO',
rating: yourRating,
time: 'just now',