Compare commits

..

No commits in common. "8227de2d802dcd5a622fed397d6e9db7ad376ea1" and "a23b0a23043516ae74439dba1437b01b9baa2c51" have entirely different histories.

5 changed files with 18 additions and 20 deletions

View File

@ -26,7 +26,7 @@ import {
import { CheckboxField, InputError, InputField } from './Inputs' import { CheckboxField, InputError, InputField } from './Inputs'
import { RelayController } from '../controllers' import { RelayController } from '../controllers'
import { useLocation, useNavigate } from 'react-router-dom' import { useLocation, useNavigate } from 'react-router-dom'
import { appRoutes, getModPageRoute } from '../routes' import { appRoutes, getModsInnerPageRoute } from '../routes'
import { DownloadUrl, ModFormState, ModDetails } from '../types' import { DownloadUrl, ModFormState, ModDetails } from '../types'
import { LoadingSpinner } from './LoadingSpinner' import { LoadingSpinner } from './LoadingSpinner'
import { T_TAG_VALUE } from '../constants' import { T_TAG_VALUE } from '../constants'
@ -281,7 +281,7 @@ export const ModForm = ({ existingModData }: ModFormProps) => {
relays: publishedOnRelays relays: publishedOnRelays
}) })
navigate(getModPageRoute(naddr)) navigate(getModsInnerPageRoute(naddr))
} }
setIsPublishing(false) setIsPublishing(false)

View File

@ -9,7 +9,7 @@ import { ModCard } from '../components/ModCard'
import { LANDING_PAGE_DATA } from '../constants' import { LANDING_PAGE_DATA } from '../constants'
import { RelayController } from '../controllers' import { RelayController } from '../controllers'
import { useDidMount } from '../hooks' import { useDidMount } from '../hooks'
import { appRoutes, getModPageRoute } from '../routes' import { appRoutes, getModsInnerPageRoute } from '../routes'
import { ModDetails } from '../types' import { ModDetails } from '../types'
import { import {
extractModData, extractModData,
@ -182,7 +182,7 @@ const SlideContent = ({ naddr }: SlideContentProps) => {
<a <a
className='btn btnMain IBMSMSliderContainerWrapperSliderActionbtn' className='btn btnMain IBMSMSliderContainerWrapperSliderActionbtn'
role='button' role='button'
onClick={() => navigate(getModPageRoute(naddr))} onClick={() => navigate(getModsInnerPageRoute(naddr))}
> >
Check it out Check it out
</a> </a>
@ -230,7 +230,7 @@ const DisplayMod = ({ naddr }: DisplayModProps) => {
if (!mod) return <Spinner /> if (!mod) return <Spinner />
const route = getModPageRoute(naddr) const route = getModsInnerPageRoute(naddr)
return ( return (
<ModCard <ModCard
@ -249,12 +249,10 @@ const DisplayLatestMods = () => {
const [latestMods, setLatestMods] = useState<ModDetails[]>([]) const [latestMods, setLatestMods] = useState<ModDetails[]>([])
useDidMount(() => { useDidMount(() => {
fetchMods({ source: window.location.host }) fetchMods({ source: window.location.host, limit: 4 })
.then((res) => { .then((res) => {
const mods = res res.sort((a, b) => b.published_at - a.published_at)
.sort((a, b) => b.published_at - a.published_at) setLatestMods(res)
.slice(0, 4)
setLatestMods(mods)
}) })
.finally(() => { .finally(() => {
setIsFetchingLatestMods(false) setIsFetchingLatestMods(false)
@ -271,7 +269,7 @@ const DisplayLatestMods = () => {
<Spinner /> <Spinner />
) : ( ) : (
latestMods.map((mod) => { latestMods.map((mod) => {
const route = getModPageRoute( const route = getModsInnerPageRoute(
nip19.naddrEncode({ nip19.naddrEncode({
identifier: mod.aTag, identifier: mod.aTag,
pubkey: mod.author, pubkey: mod.author,

View File

@ -53,7 +53,7 @@ import {
} from '../utils' } from '../utils'
import FsLightbox from 'fslightbox-react' import FsLightbox from 'fslightbox-react'
export const ModPage = () => { export const InnerModPage = () => {
const { naddr } = useParams() const { naddr } = useParams()
const [modData, setModData] = useState<ModDetails>() const [modData, setModData] = useState<ModDetails>()
const [isFetching, setIsFetching] = useState(true) const [isFetching, setIsFetching] = useState(true)

View File

@ -12,7 +12,7 @@ import { LoadingSpinner } from '../components/LoadingSpinner'
import { ModCard } from '../components/ModCard' import { ModCard } from '../components/ModCard'
import { MetadataController } from '../controllers' import { MetadataController } from '../controllers'
import { useAppSelector, useDidMount } from '../hooks' import { useAppSelector, useDidMount } from '../hooks'
import { getModPageRoute } from '../routes' import { getModsInnerPageRoute } from '../routes'
import '../styles/filters.css' import '../styles/filters.css'
import '../styles/pagination.css' import '../styles/pagination.css'
import '../styles/search.css' import '../styles/search.css'
@ -208,7 +208,7 @@ export const ModsPage = () => {
<div className='IBMSecMain IBMSMListWrapper'> <div className='IBMSecMain IBMSMListWrapper'>
<div className='IBMSMList'> <div className='IBMSMList'>
{filteredModList.map((mod) => { {filteredModList.map((mod) => {
const route = getModPageRoute( const route = getModsInnerPageRoute(
nip19.naddrEncode({ nip19.naddrEncode({
identifier: mod.aTag, identifier: mod.aTag,
pubkey: mod.author, pubkey: mod.author,

View File

@ -2,7 +2,7 @@ import { AboutPage } from '../pages/about'
import { BlogsPage } from '../pages/blogs' import { BlogsPage } from '../pages/blogs'
import { GamesPage } from '../pages/games' import { GamesPage } from '../pages/games'
import { HomePage } from '../pages/home' import { HomePage } from '../pages/home'
import { ModPage } from '../pages/mod' import { InnerModPage } from '../pages/innerMod'
import { ModsPage } from '../pages/mods' import { ModsPage } from '../pages/mods'
import { ProfilePage } from '../pages/profile' import { ProfilePage } from '../pages/profile'
import { SettingsPage } from '../pages/settings' import { SettingsPage } from '../pages/settings'
@ -14,7 +14,7 @@ export const appRoutes = {
home: '/home', home: '/home',
games: '/games', games: '/games',
mods: '/mods', mods: '/mods',
mod: '/mod/:naddr', modsInner: '/mods-inner/:naddr',
about: '/about', about: '/about',
blog: '/blog', blog: '/blog',
submitMod: '/submit-mod', submitMod: '/submit-mod',
@ -27,8 +27,8 @@ export const appRoutes = {
profile: '/profile/:nprofile' profile: '/profile/:nprofile'
} }
export const getModPageRoute = (eventId: string) => export const getModsInnerPageRoute = (eventId: string) =>
appRoutes.mod.replace(':naddr', eventId) appRoutes.modsInner.replace(':naddr', eventId)
export const getModsEditPageRoute = (eventId: string) => export const getModsEditPageRoute = (eventId: string) =>
appRoutes.editMod.replace(':naddr', eventId) appRoutes.editMod.replace(':naddr', eventId)
@ -54,8 +54,8 @@ export const routes = [
element: <ModsPage /> element: <ModsPage />
}, },
{ {
path: appRoutes.mod, path: appRoutes.modsInner,
element: <ModPage /> element: <InnerModPage />
}, },
{ {
path: appRoutes.about, path: appRoutes.about,