fix routing for mod edit page
All checks were successful
Release to Staging / build_and_release (push) Successful in 42s

This commit is contained in:
daniyal 2024-08-19 11:41:11 +05:00
parent 012e868ad3
commit da88a969f3
2 changed files with 16 additions and 11 deletions

View File

@ -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 = () => {
<div className='IBMSMSplitMain'>
<div className='IBMSMSplitMainBigSide'>
<div className='IBMSMSplitMainBigSideSec'>
<Game game={modData.game} author={modData.author} />
<Game
nevent={nevent!}
game={modData.game}
author={modData.author}
/>
<Body
featuredImageUrl={modData.featuredImageUrl}
title={modData.title}
@ -170,7 +175,9 @@ export const InnerModPage = () => {
</div>
<div className='IBMSMSplitMainBigSideSec'>
<div className='IBMSMSMBSSPostsWrapper'>
<h4 className='IBMSMSMBSSPostsTitle'>Creator's Blog Posts (WIP)</h4>
<h4 className='IBMSMSMBSSPostsTitle'>
Creator's Blog Posts (WIP)
</h4>
<div className='IBMSMList IBMSMListAlt'>
<BlogCard backgroundLink='/assets/img/DEGMods%20Placeholder%20Img.png' />
<BlogCard backgroundLink='/assets/img/DEGMods%20Placeholder%20Img.png' />
@ -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 && (
<a
className='dropdown-item dropdownMainMenuItem'
onClick={() =>
navigate(
window.location.pathname.replace('mods-inner', 'edit-mod')
)
}
onClick={() => navigate(getModsEditPageRoute(nevent))}
>
<svg
xmlns='http://www.w3.org/2000/svg'
@ -879,9 +883,7 @@ const Comments = () => {
</div>
</div>
<div className='IBMSMSMBSSCL_CommentBottom'>
<p className='IBMSMSMBSSCL_CBText'>
Example user comment
</p>
<p className='IBMSMSMBSSCL_CBText'>Example user comment</p>
</div>
<div className='IBMSMSMBSSCL_CommentActions'>
<div className='IBMSMSMBSSCL_CommentActionsInside'>

View File

@ -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,