diff --git a/src/layouts/sharing/SharedFromMe.tsx b/src/layouts/sharing/SharedFromMe.tsx index 4973a0dc..7238da4e 100644 --- a/src/layouts/sharing/SharedFromMe.tsx +++ b/src/layouts/sharing/SharedFromMe.tsx @@ -1,6 +1,6 @@ import { Group, Stack, Tabs, Text, Title } from "@mantine/core"; import React, { useEffect } from "react"; -import { useParams } from "react-router-dom"; +import { useNavigate, useParams } from "react-router-dom"; import { fetchUserAlbumsSharedFromMe } from "../../actions/albumsActions"; import { fetchPhotosSharedFromMe } from "../../actions/photosActions"; @@ -12,6 +12,7 @@ import { PhotosShared } from "./PhotosShared"; export function SharedFromMe() { const dispatch = useAppDispatch(); + const navigate = useNavigate(); const { albums } = useAppSelector(store => store); const { photosFlat, photosGroupedByUser, fetchedPhotosetType } = useAppSelector(store => store.photos); const { which } = useParams(); @@ -45,7 +46,7 @@ export function SharedFromMe() { - + navigate(`/shared/fromme/${value}/`)}> Photos Albums diff --git a/src/layouts/sharing/SharedToMe.tsx b/src/layouts/sharing/SharedToMe.tsx index ddcca045..e3578370 100644 --- a/src/layouts/sharing/SharedToMe.tsx +++ b/src/layouts/sharing/SharedToMe.tsx @@ -1,6 +1,6 @@ import { Group, Stack, Tabs, Text, Title } from "@mantine/core"; import React, { useEffect } from "react"; -import { useParams } from "react-router-dom"; +import { useNavigate, useParams } from "react-router-dom"; import { fetchUserAlbumsSharedToMe } from "../../actions/albumsActions"; import { fetchPhotosSharedToMe } from "../../actions/photosActions"; @@ -12,6 +12,7 @@ import { PhotosShared } from "./PhotosShared"; export function SharedToMe() { const dispatch = useAppDispatch(); + const navigate = useNavigate(); const { albums } = useAppSelector(store => store); const { photosFlat, photosGroupedByUser, fetchedPhotosetType } = useAppSelector(store => store.photos); const { which } = useParams(); @@ -52,7 +53,7 @@ export function SharedToMe() { - + navigate(`/shared/tome/${value}/`)}> Photos Albums