fix: mod edit route
This commit is contained in:
parent
c55dc03382
commit
6c0ac7d59d
@ -15,7 +15,7 @@ import { toast } from 'react-toastify'
|
|||||||
import { BlogCard } from '../../components/BlogCard'
|
import { BlogCard } from '../../components/BlogCard'
|
||||||
import { ProfileSection } from '../../components/ProfileSection'
|
import { ProfileSection } from '../../components/ProfileSection'
|
||||||
import { useAppSelector, useBodyScrollDisable } from '../../hooks'
|
import { useAppSelector, useBodyScrollDisable } from '../../hooks'
|
||||||
import { getGamePageRoute } from '../../routes'
|
import { getGamePageRoute, getModsEditPageRoute } from '../../routes'
|
||||||
import '../../styles/comments.css'
|
import '../../styles/comments.css'
|
||||||
import '../../styles/downloads.css'
|
import '../../styles/downloads.css'
|
||||||
import '../../styles/innerPage.css'
|
import '../../styles/innerPage.css'
|
||||||
@ -185,6 +185,7 @@ export const ModPage = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Game = () => {
|
const Game = () => {
|
||||||
|
const { naddr } = useParams()
|
||||||
const navigation = useNavigation()
|
const navigation = useNavigation()
|
||||||
const { mod, isAddedToNSFW, isBlocked, isRepost } =
|
const { mod, isAddedToNSFW, isBlocked, isRepost } =
|
||||||
useLoaderData() as ModPageLoaderResult
|
useLoaderData() as ModPageLoaderResult
|
||||||
@ -245,6 +246,7 @@ const Game = () => {
|
|||||||
|
|
||||||
const game = mod?.game || ''
|
const game = mod?.game || ''
|
||||||
const gameRoute = getGamePageRoute(game)
|
const gameRoute = getGamePageRoute(game)
|
||||||
|
const editRoute = getModsEditPageRoute(naddr ? naddr : '')
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -281,7 +283,7 @@ const Game = () => {
|
|||||||
{userState.auth && userState.user?.pubkey === mod?.author && (
|
{userState.auth && userState.user?.pubkey === mod?.author && (
|
||||||
<ReactRouterLink
|
<ReactRouterLink
|
||||||
className='dropdown-item dropdownMainMenuItem'
|
className='dropdown-item dropdownMainMenuItem'
|
||||||
to={'edit'}
|
to={editRoute}
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
xmlns='http://www.w3.org/2000/svg'
|
xmlns='http://www.w3.org/2000/svg'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user