Refactoring mods and adding repost functionality #162

Merged
enes merged 7 commits from 107-143-refactoring-mod-and-repost into staging 2024-11-28 16:33:15 +00:00
Showing only changes of commit 6c0ac7d59d - Show all commits

View File

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