feat: add the feature to zap admin/app account #4

Merged
s merged 3 commits from zap into master 2024-08-08 17:02:12 +00:00
3 changed files with 5 additions and 3 deletions
Showing only changes of commit 44d0100341 - Show all commits

View File

@ -1 +1,2 @@
export const T_TAG_VALUE = 'GameMod' export const T_TAG_VALUE = 'GameMod'
export const MOD_FILTER_LIMIT = 20

View File

@ -19,6 +19,7 @@ import '../styles/search.css'
import '../styles/styles.css' import '../styles/styles.css'
import { ModDetails, MuteLists } from '../types' import { ModDetails, MuteLists } from '../types'
import { fetchMods } from '../utils' import { fetchMods } from '../utils'
import { MOD_FILTER_LIMIT } from '../constants'
enum SortBy { enum SortBy {
Latest = 'Latest', Latest = 'Latest',
@ -190,7 +191,7 @@ export const ModsPage = () => {
<Pagination <Pagination
page={page} page={page}
disabledNext={mods.length < 20} disabledNext={mods.length < MOD_FILTER_LIMIT}
handlePrev={handlePrev} handlePrev={handlePrev}
handleNext={handleNext} handleNext={handleNext}
/> />

View File

@ -4,7 +4,7 @@ import { ModFormState, ModDetails } from '../types'
import { RelayController } from '../controllers' import { RelayController } from '../controllers'
import { log, LogType } from './utils' import { log, LogType } from './utils'
import { toast } from 'react-toastify' import { toast } from 'react-toastify'
import { T_TAG_VALUE } from '../constants' import { MOD_FILTER_LIMIT, T_TAG_VALUE } from '../constants'
/** /**
* Extracts and normalizes mod data from an event. * Extracts and normalizes mod data from an event.
@ -151,7 +151,7 @@ export const fetchMods = async (
// Define the filter criteria for fetching mods // Define the filter criteria for fetching mods
const filter: Filter = { const filter: Filter = {
kinds: [kinds.ClassifiedListing], // Specify the kind of events to fetch kinds: [kinds.ClassifiedListing], // Specify the kind of events to fetch
limit: 20, // Limit the number of events fetched to 20 limit: MOD_FILTER_LIMIT, // Limit the number of events fetched to 20
'#t': [T_TAG_VALUE], '#t': [T_TAG_VALUE],
until, // Optional filter to fetch events until this timestamp until, // Optional filter to fetch events until this timestamp
since // Optional filter to fetch events from this timestamp since // Optional filter to fetch events from this timestamp