diff --git a/frontend/components/reviews/entity-reviews.tsx b/frontend/components/reviews/entity-reviews.tsx index b44b7f1..26b8e58 100644 --- a/frontend/components/reviews/entity-reviews.tsx +++ b/frontend/components/reviews/entity-reviews.tsx @@ -8,10 +8,17 @@ import { getApiUrl } from "@/lib/api-config" interface Review { id: number user_id: number - blurb: string - content: string - score: number + blurb?: string | null + content?: string | null + score?: number | null created_at: string + user?: { + id: number + username: string + display_name?: string | null + avatar_bg_color?: string + avatar_text?: string | null + } | null } export type EntityType = "show" | "venue" | "song" | "performance" | "tour" | "year" diff --git a/frontend/components/social/social-wrapper.tsx b/frontend/components/social/social-wrapper.tsx index 1eaf329..5d1ed2d 100644 --- a/frontend/components/social/social-wrapper.tsx +++ b/frontend/components/social/social-wrapper.tsx @@ -10,16 +10,13 @@ interface SocialWrapperProps { export function SocialWrapper({ type, children }: SocialWrapperProps) { const { preferences, loading } = usePreferences() - // Avoid flash of content or layout shift by checking loading? - // For now, let's just return null if loading to be safe, or maybe render nothing until we know. - if (loading) return null - - if (preferences.wiki_mode) return null - - if (type === "comments" && !preferences.show_comments) return null - if (type === "ratings" && !preferences.show_ratings) return null - // For reviews, we assume they are hidden if wiki_mode is on (handled above) - // or if we add a specific show_reviews preference later. + // While loading, show content (assume defaults: wiki_mode=false, show_comments=true, show_ratings=true) + // Only hide once we know the user's preference is explicitly set to hide + if (!loading) { + if (preferences.wiki_mode) return null + if (type === "comments" && !preferences.show_comments) return null + if (type === "ratings" && !preferences.show_ratings) return null + } return <>{children} }