diff --git a/src/App.tsx b/src/App.tsx index 421867a..a294013 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3,14 +3,12 @@ import { useEffect } from 'react'; import { Toaster } from 'react-hot-toast'; import { createBrowserRouter, RouterProvider } from 'react-router'; import AppErrorBoundary from './components/common/AppErrorBoundary'; -import { useNavigationTiming } from './hooks/useNavigationTiming'; import { routes } from './routes'; import { useRouteChangeLogging } from './hooks/useRouteChangeLogging'; const router = createBrowserRouter(routes); function App() { - useNavigationTiming(); useRouteChangeLogging(); useEffect(() => { diff --git a/src/components/common/CreatorCard.tsx b/src/components/common/CreatorCard.tsx index 43c82eb..65781d5 100644 --- a/src/components/common/CreatorCard.tsx +++ b/src/components/common/CreatorCard.tsx @@ -12,6 +12,7 @@ import { ExternalLink, } from 'lucide-react'; import { Sparkline } from '@/components/ui/sparkline'; +import SectionErrorBoundary from '@/components/common/SectionErrorBoundary'; import { DropdownMenu, DropdownMenuContent, @@ -367,29 +368,36 @@ const CreatorCard: React.FC = ({ else if (latest < earliest) lineColor = '#ef4444'; return ( -
- - - - - - - - - - - {priceChartAccessibility.points.map(point => ( - - - + +
+ +
{priceChartAccessibility.summary}
PointKey price
{point.label}{point.value}
+ + + + + - ))} - -
{priceChartAccessibility.summary}
PointKey price
-
+ + + {priceChartAccessibility.points.map(point => ( + + {point.label} + {point.value} + + ))} + + + + ); })()} diff --git a/src/components/common/CreatorMarketplaceInfiniteList.tsx b/src/components/common/CreatorMarketplaceInfiniteList.tsx index e92a74f..9de6aac 100644 --- a/src/components/common/CreatorMarketplaceInfiniteList.tsx +++ b/src/components/common/CreatorMarketplaceInfiniteList.tsx @@ -23,6 +23,7 @@ export default function CreatorMarketplaceInfiniteList({ hasMore, isLoadingFirstPage, isFetchingNextPage, + isRefreshing, fetchNextPage, } = useInfiniteCreatorMarketplace(params); @@ -44,6 +45,16 @@ export default function CreatorMarketplaceInfiniteList({ return (
+ {isRefreshing && ( +
+ Refreshing… +
+ )}
{creators.map(creator => ( diff --git a/src/components/common/SectionErrorBoundary.tsx b/src/components/common/SectionErrorBoundary.tsx index 9749403..8e195b6 100644 --- a/src/components/common/SectionErrorBoundary.tsx +++ b/src/components/common/SectionErrorBoundary.tsx @@ -8,6 +8,17 @@ interface Props { sectionName?: string; minHeight?: string | number; className?: string; + /** + * Overrides the default "Something went wrong in this section" heading. + * Use for a short, section-specific message (e.g. "Chart unavailable — + * try refreshing"). + */ + title?: string; + /** + * Overrides the default explanatory paragraph. Pass an empty string to + * show only the title (no secondary copy). + */ + description?: string; } interface State { @@ -48,14 +59,16 @@ class SectionErrorBoundary extends Component {

- Something went wrong in this section + {this.props.title ?? 'Something went wrong in this section'}

-

- {this.props.sectionName - ? `We encountered an error while loading the ${this.props.sectionName}.` - : 'We encountered an error while loading this content.'} - Please try again or contact support if the issue persists. -

+ {this.props.description !== '' && ( +

+ {this.props.description ?? + (this.props.sectionName + ? `We encountered an error while loading the ${this.props.sectionName}. Please try again or contact support if the issue persists.` + : 'We encountered an error while loading this content. Please try again or contact support if the issue persists.')} +

+ )}