diff --git a/src/app/dashboard/_allExercisesTimeline/allExercisesGrid.tsx b/src/app/dashboard/_allExercisesTimeline/allExercisesGrid.tsx index 1fbfdd4..e09c6db 100644 --- a/src/app/dashboard/_allExercisesTimeline/allExercisesGrid.tsx +++ b/src/app/dashboard/_allExercisesTimeline/allExercisesGrid.tsx @@ -10,7 +10,7 @@ import { SortableGrid } from "./sortableGrid"; import { pluralize } from "@/lib/utils"; import { useDashboardSearchParams } from "../_components/useDashboardSearchParams"; import { GridLayout } from "@/components/ui/gridLayout"; -import { Card, CardErrorFallback } from "@/components/ui/card"; +import { Card } from "@/components/ui/card"; import { ExerciseOverviewCard } from "@/components/cards/exerciseOverviewCard"; import { ExercisesRadarCard } from "@/components/cards/exercisesRadarCard"; import { UserRandomFactsCard } from "@/components/cards/userRandomFactsCard"; @@ -69,14 +69,14 @@ export const AllExercisesGrid = () => { gridItems={exercises.map((exercise) => ({ id: exercise.id, component: ( - + ), }))} /> - + ({ exerciseName: exercise.name, @@ -85,7 +85,7 @@ export const AllExercisesGrid = () => { /> - + diff --git a/src/app/dashboard/_monthlyExercisesTimelines/monthlyExercisesTimelines.tsx b/src/app/dashboard/_monthlyExercisesTimelines/monthlyExercisesTimelines.tsx index 47cf00c..efa827d 100644 --- a/src/app/dashboard/_monthlyExercisesTimelines/monthlyExercisesTimelines.tsx +++ b/src/app/dashboard/_monthlyExercisesTimelines/monthlyExercisesTimelines.tsx @@ -4,7 +4,7 @@ import { Badge } from "@/components/ui/badge"; import { dateAsYearMonthDayFormat } from "@/lib/date"; import type { RouterOutputs } from "@/trpc/react"; import { GridLayout, GridSkeleton } from "@/components/ui/gridLayout"; -import { CardErrorFallback } from "@/components/ui/card"; +import { Card } from "@/components/ui/card"; import { Timeline, TimelineErrorFallback } from "@/components/ui/timeline"; import { ErrorBoundary } from "react-error-boundary"; import { QueryErrorResetBoundary } from "@tanstack/react-query"; @@ -56,7 +56,7 @@ const Content = () => { {group.exercises.map((exercise) => ( { ))} - + ({ exerciseName: exercise.name, @@ -75,13 +75,13 @@ const Content = () => { /> - + - + diff --git a/src/app/exercises/[id]/_components/card.tsx b/src/app/exercises/[id]/_components/card.tsx index f946e54..20a2a29 100644 --- a/src/app/exercises/[id]/_components/card.tsx +++ b/src/app/exercises/[id]/_components/card.tsx @@ -48,17 +48,7 @@ const ErrorMessage = (props: ComponentPropsWithoutRef<"code">) => { return ; }; -export const Card = { - Root, - Header, - Body, - Title, - Footer, - ErrorMessage, -}; - -//TODO: move this to the card obj -export const CardSkeleton = () => { +const SkeletonFallback = () => { return ( @@ -69,7 +59,7 @@ export const CardSkeleton = () => { ); }; -export const CardErrorFallback = (props: FallbackProps) => { +const ErrorFallback = (props: FallbackProps) => { const errorMessage = props.error instanceof Error ? props.error.message @@ -89,3 +79,14 @@ export const CardErrorFallback = (props: FallbackProps) => { ); }; + +export const Card = { + Root, + Header, + Body, + Title, + Footer, + ErrorMessage, + SkeletonFallback, + ErrorFallback, +}; diff --git a/src/app/exercises/[id]/content.tsx b/src/app/exercises/[id]/content.tsx index e3bdc4d..3d1705f 100644 --- a/src/app/exercises/[id]/content.tsx +++ b/src/app/exercises/[id]/content.tsx @@ -8,7 +8,7 @@ import { import { ExercisePageContextProvider } from "./_components/exercisePageContext"; import { QueryErrorResetBoundary } from "@tanstack/react-query"; import { ErrorBoundary, type FallbackProps } from "react-error-boundary"; -import { CardErrorFallback, CardSkeleton } from "./_components/card"; +import { Card } from "./_components/card"; import { useExercisePageParams } from "./_components/useExercisePageParams"; import { ExerciseDataGraphCard } from "./_exerciseDataGraph/exerciseDataGraphCard"; import { ExerciseDataTableCard } from "./_exerciseDataTable/exerciseDataTableCard"; @@ -25,11 +25,11 @@ export const Content = () => { > }> - + - + @@ -45,23 +45,23 @@ const ContentContainer = (props: ComponentPropsWithoutRef<"div">) => { return (
); }; const ContentErrorFallback = (props: FallbackProps) => ( <> - - + + ); const ContentSkeleton = () => { return ( <> - - + + ); }; diff --git a/src/app/teams/[id]/_teamMembersExercises/teamMembersExercises.tsx b/src/app/teams/[id]/_teamMembersExercises/teamMembersExercises.tsx index b6192f8..fc39a6a 100644 --- a/src/app/teams/[id]/_teamMembersExercises/teamMembersExercises.tsx +++ b/src/app/teams/[id]/_teamMembersExercises/teamMembersExercises.tsx @@ -6,7 +6,7 @@ import { QueryErrorResetBoundary } from "@tanstack/react-query"; import { ErrorBoundary } from "react-error-boundary"; import { useTeam } from "../_components/useTeam"; import { GridLayout, GridSkeleton } from "@/components/ui/gridLayout"; -import { CardErrorFallback } from "@/components/ui/card"; +import { Card } from "@/components/ui/card"; import { useTeamPageParams } from "../_components/useTeamPageParams"; import { Suspense } from "react"; import { prepareUserRandomFactsData } from "@/lib/math"; @@ -50,14 +50,14 @@ const Content = () => { {userToTeam.user.exercises.map((exercise) => ( ))} - + ({ exerciseName: exercise.name, @@ -66,7 +66,7 @@ const Content = () => { /> - + diff --git a/src/app/teams/[id]/_teamMetedata/teamMetadata.tsx b/src/app/teams/[id]/_teamMetedata/teamMetadata.tsx index a05df31..7abcaad 100644 --- a/src/app/teams/[id]/_teamMetedata/teamMetadata.tsx +++ b/src/app/teams/[id]/_teamMetedata/teamMetadata.tsx @@ -1,6 +1,6 @@ "use client"; -import { CardErrorFallback, CardSkeleton } from "@/components/ui/card"; +import { Card } from "@/components/ui/card"; import { GridLayout } from "@/components/ui/gridLayout"; import { Badge } from "@/components/ui/badge"; import { Timeline, TimelineErrorFallback } from "@/components/ui/timeline"; @@ -37,20 +37,20 @@ export const TeamMetadata = () => { const Content = () => { return ( - - }> + + }> - - }> + + }> - - }> + + }> diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsx index 4fd5414..a89bd61 100644 --- a/src/components/ui/card.tsx +++ b/src/components/ui/card.tsx @@ -66,16 +66,7 @@ const Root = forwardRef>((props, ref) => { }); Root.displayName = "Card"; -export const Card = { - Root, - Header, - ActionContainer, - ActionButton, - Title, - Anchor, -}; - -export const CardErrorFallback = (props: FallbackProps) => { +export const ErrorFallback = (props: FallbackProps) => { const errorMessage = props.error instanceof Error ? props.error.message @@ -99,10 +90,21 @@ export const CardErrorFallback = (props: FallbackProps) => { ); }; -export const CardSkeleton = () => { +const SkeletonFallback = () => { return ( ); }; + +export const Card = { + Root, + Header, + ActionContainer, + ActionButton, + Title, + Anchor, + SkeletonFallback, + ErrorFallback, +};