Skip to content

Commit

Permalink
refactor: expose collectiviteId as a CollectiviteProvider prop instea…
Browse files Browse the repository at this point in the history
…d of unsafeCollectiviteId

refactor: update ScoreEvolutions default export to named export
  • Loading branch information
elisfainstein committed Feb 18, 2025
1 parent 5ef2d0d commit c5f8f4c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default async function Layout({
const { collectiviteId } = await params;

return (
<CollectiviteProvider unsafeCollectiviteId={collectiviteId}>
<CollectiviteProvider collectiviteId={collectiviteId}>
{children}
</CollectiviteProvider>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ScoreEvolutions from '@/app/referentiels/evolutions';
import { ScoreEvolutions } from '@/app/referentiels/evolutions';

export default function Page() {
return <ScoreEvolutions />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ type ContextProps = {
const CollectiviteContext = createContext<ContextProps | null>(null);

export function CollectiviteProvider({
unsafeCollectiviteId,
collectiviteId: unsafeCollectiviteId,
children,
}: {
unsafeCollectiviteId: number;
collectiviteId: number;
children: ReactNode;
}) {
const collectiviteId = z.coerce.number().parse(unsafeCollectiviteId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,3 @@ export const ScoreEvolutions = () => {
</>
);
};

export default ScoreEvolutions;

0 comments on commit c5f8f4c

Please sign in to comment.