diff --git a/src/components/Posts/Posts.tsx b/src/components/Posts/Posts.tsx index cc52abef..a2a1c263 100644 --- a/src/components/Posts/Posts.tsx +++ b/src/components/Posts/Posts.tsx @@ -20,7 +20,7 @@ export const Posts: FC = () => { }) const posts = postsData?.data ?? [] - const [activePostDetailIndex, setActivePostDetailIndex] = useState(undefined) + const [activePostDetailIndex, setActivePostDetailIndex] = useState() if (postsIsLoading) return @@ -28,6 +28,9 @@ export const Posts: FC = () => { return ( <> + {/* detail prispevku chceme zobrazit na urovni toho prispevku - `activePostDetailIndex` teda rozdeluje prispevky na dva gridy: + - prvy grid su vsetky prispevky do rozbaleneho prispevku - len jeden grid item ako jeden stlpec prispevkov (`xs={4}` ako 4 stlpce z 12) + - druhy grid su prispevky od rozbaleneho prispevku - dva grid itemy ako jeden stlpec prispevkov (`xs={4}`) a druhy stlpec ako detail prispevku (`xs={5}` - detail je sirsi) */} {activePostDetailIndex !== 0 && (