fix routing for mod edit page #13

Merged
s merged 1 commits from staging into master 2024-08-19 06:42:49 +00:00
2 changed files with 16 additions and 11 deletions
Showing only changes of commit da88a969f3 - Show all commits

View File

@ -37,6 +37,7 @@ import {
} from '../utils' } from '../utils'
import { ZapButtons, ZapPresets, ZapQR } from '../components/Zap' import { ZapButtons, ZapPresets, ZapQR } from '../components/Zap'
import { getModsEditPageRoute } from '../routes'
export const InnerModPage = () => { export const InnerModPage = () => {
const { nevent } = useParams() const { nevent } = useParams()
@ -113,7 +114,11 @@ export const InnerModPage = () => {
<div className='IBMSMSplitMain'> <div className='IBMSMSplitMain'>
<div className='IBMSMSplitMainBigSide'> <div className='IBMSMSplitMainBigSide'>
<div className='IBMSMSplitMainBigSideSec'> <div className='IBMSMSplitMainBigSideSec'>
<Game game={modData.game} author={modData.author} /> <Game
nevent={nevent!}
game={modData.game}
author={modData.author}
/>
<Body <Body
featuredImageUrl={modData.featuredImageUrl} featuredImageUrl={modData.featuredImageUrl}
title={modData.title} title={modData.title}
@ -170,7 +175,9 @@ export const InnerModPage = () => {
</div> </div>
<div className='IBMSMSplitMainBigSideSec'> <div className='IBMSMSplitMainBigSideSec'>
<div className='IBMSMSMBSSPostsWrapper'> <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'> <div className='IBMSMList IBMSMListAlt'>
<BlogCard backgroundLink='/assets/img/DEGMods%20Placeholder%20Img.png' /> <BlogCard backgroundLink='/assets/img/DEGMods%20Placeholder%20Img.png' />
<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 = { type GameProps = {
nevent: string
game: string game: string
author: string author: string
} }
const Game = ({ game, author }: GameProps) => { const Game = ({ nevent, game, author }: GameProps) => {
const navigate = useNavigate() const navigate = useNavigate()
const userState = useAppSelector((state) => state.user) const userState = useAppSelector((state) => state.user)
@ -233,11 +241,7 @@ const Game = ({ game, author }: GameProps) => {
{userState.auth && userState.user?.pubkey === author && ( {userState.auth && userState.user?.pubkey === author && (
<a <a
className='dropdown-item dropdownMainMenuItem' className='dropdown-item dropdownMainMenuItem'
onClick={() => onClick={() => navigate(getModsEditPageRoute(nevent))}
navigate(
window.location.pathname.replace('mods-inner', 'edit-mod')
)
}
> >
<svg <svg
xmlns='http://www.w3.org/2000/svg' xmlns='http://www.w3.org/2000/svg'
@ -879,9 +883,7 @@ const Comments = () => {
</div> </div>
</div> </div>
<div className='IBMSMSMBSSCL_CommentBottom'> <div className='IBMSMSMBSSCL_CommentBottom'>
<p className='IBMSMSMBSSCL_CBText'> <p className='IBMSMSMBSSCL_CBText'>Example user comment</p>
Example user comment
</p>
</div> </div>
<div className='IBMSMSMBSSCL_CommentActions'> <div className='IBMSMSMBSSCL_CommentActions'>
<div className='IBMSMSMBSSCL_CommentActionsInside'> <div className='IBMSMSMBSSCL_CommentActionsInside'>

View File

@ -28,6 +28,9 @@ export const appRoutes = {
export const getModsInnerPageRoute = (eventId: string) => export const getModsInnerPageRoute = (eventId: string) =>
appRoutes.modsInner.replace(':nevent', eventId) appRoutes.modsInner.replace(':nevent', eventId)
export const getModsEditPageRoute = (eventId: string) =>
appRoutes.editMod.replace(':nevent', eventId)
export const routes = [ export const routes = [
{ {
path: appRoutes.index, path: appRoutes.index,