diff --git a/src/pages/innerMod.tsx b/src/pages/innerMod.tsx index 493aa10..bb205bc 100644 --- a/src/pages/innerMod.tsx +++ b/src/pages/innerMod.tsx @@ -37,6 +37,7 @@ import { } from '../utils' import { ZapButtons, ZapPresets, ZapQR } from '../components/Zap' +import { getModsEditPageRoute } from '../routes' export const InnerModPage = () => { const { nevent } = useParams() @@ -113,7 +114,11 @@ export const InnerModPage = () => {
- + {
-

Creator's Blog Posts (WIP)

+

+ Creator's Blog Posts (WIP) +

@@ -191,11 +198,12 @@ export const InnerModPage = () => { } type GameProps = { + nevent: string game: string author: string } -const Game = ({ game, author }: GameProps) => { +const Game = ({ nevent, game, author }: GameProps) => { const navigate = useNavigate() const userState = useAppSelector((state) => state.user) @@ -233,11 +241,7 @@ const Game = ({ game, author }: GameProps) => { {userState.auth && userState.user?.pubkey === author && ( - navigate( - window.location.pathname.replace('mods-inner', 'edit-mod') - ) - } + onClick={() => navigate(getModsEditPageRoute(nevent))} > {
-

- Example user comment -

+

Example user comment

diff --git a/src/routes/index.tsx b/src/routes/index.tsx index 5fcf1a3..e380edf 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -28,6 +28,9 @@ export const appRoutes = { export const getModsInnerPageRoute = (eventId: string) => appRoutes.modsInner.replace(':nevent', eventId) +export const getModsEditPageRoute = (eventId: string) => + appRoutes.editMod.replace(':nevent', eventId) + export const routes = [ { path: appRoutes.index,