diff --git a/web/src/Routes.tsx b/web/src/Routes.tsx index 73b2244..61ebf83 100644 --- a/web/src/Routes.tsx +++ b/web/src/Routes.tsx @@ -6,7 +6,6 @@ import { FilterContextProvider } from 'src/contexts/filter' import { TagContextProvider } from 'src/contexts/tags' import { SelectContextProvider } from 'src/contexts/select' import { ApluContextProvider } from 'src/contexts/aplu' -import PhotosPage from 'src/pages/PhotosPage/PhotosPage' const contexts = [FilterContextProvider, TagContextProvider, SelectContextProvider, ApluContextProvider] diff --git a/web/src/pages/PhotoPage/PhotoPage.tsx b/web/src/components/Image/ImageOverlay.tsx similarity index 52% rename from web/src/pages/PhotoPage/PhotoPage.tsx rename to web/src/components/Image/ImageOverlay.tsx index 430430e..7b6db71 100644 --- a/web/src/pages/PhotoPage/PhotoPage.tsx +++ b/web/src/components/Image/ImageOverlay.tsx @@ -3,12 +3,14 @@ import ImageCell from 'src/components/Image/ImageCell' import { useFilterContext } from 'src/contexts/filter' import { useCallback, useState } from 'react' import { RightPanelOptions } from 'src/components/Image/RightPanel' +import { Modal, ModalOverlay, ModalContent } from '@chakra-ui/react' +import { routes, navigate } from '@redwoodjs/router' -type PhotoPageProps = { - id: string +type ImageOverlayProps = { + photoId: string } -const PhotoPage = ({ id }: PhotoPageProps) => { +const ImageOverlay = ({ photoId }: ImageOverlayProps) => { const { filter } = useFilterContext() const [rightPanel, setRightPanel] = useState(null) @@ -25,14 +27,25 @@ const PhotoPage = ({ id }: PhotoPageProps) => { <> - + navigate(routes.photos())} + size="full" + isOpen={!!photoId} + > + + + {photoId && ( + + )} + + ) } -export default PhotoPage +export default ImageOverlay diff --git a/web/src/pages/PhotoPage/PhotoPage.stories.tsx b/web/src/pages/PhotoPage/PhotoPage.stories.tsx deleted file mode 100644 index b738bb1..0000000 --- a/web/src/pages/PhotoPage/PhotoPage.stories.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import PhotoPage from './PhotoPage' - -export const generated = () => { - return -} - -export default { title: 'Pages/PhotoPage' } diff --git a/web/src/pages/PhotoPage/PhotoPage.test.tsx b/web/src/pages/PhotoPage/PhotoPage.test.tsx deleted file mode 100644 index 96322af..0000000 --- a/web/src/pages/PhotoPage/PhotoPage.test.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { render } from '@redwoodjs/testing/web' - -import PhotoPage from './PhotoPage' - -describe('PhotoPage', () => { - it('renders successfully', () => { - expect(() => { - render() - }).not.toThrow() - }) -}) diff --git a/web/src/pages/PhotosPage/PhotosPage.tsx b/web/src/pages/PhotosPage/PhotosPage.tsx index 0e8caf5..60ffa7e 100644 --- a/web/src/pages/PhotosPage/PhotosPage.tsx +++ b/web/src/pages/PhotosPage/PhotosPage.tsx @@ -7,34 +7,24 @@ import { useMemo } from 'react' import { HorizontalCollapse } from 'src/design-system' import { ChevronLeftIcon, ChevronRightIcon } from '@chakra-ui/icons' import { SelectBar } from 'src/components/Images/SelectBar' -import { useLocation, useParams } from '@redwoodjs/router' +import ImageOverlay from 'src/components/Image/ImageOverlay' -const PhotosPage = ({ photoId }) => { +const PhotosPanel = () => { const { filter } = useFilterContext() const variables = useMemo(() => ({ filter }), [filter]) const filterPanelDisclosure = useDisclosure({ defaultIsOpen: true }) - const a = useLocation() - const b = useParams() - console.log(a, b) - return ( - - - {photoId ? ( - p:{photoId} - ) : ( - - - - )} + + + @@ -69,4 +59,16 @@ const PhotosPage = ({ photoId }) => { ) } +const PhotosPage = ({ photoId }) => { + return ( + <> + + + + + + + ) +} + export default PhotosPage