From 73624d06f128f9398d1d686803006d60e1f2a7e3 Mon Sep 17 00:00:00 2001 From: sickelap Date: Mon, 6 Nov 2023 20:58:03 +0000 Subject: [PATCH] deeplink album sharing tabs --- src/layouts/sharing/SharedFromMe.tsx | 5 +++-- src/layouts/sharing/SharedToMe.tsx | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) 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