Refactor search page, migrate to /discover/ (#4862)

This commit is contained in:
Prospector
2025-12-09 14:25:45 -08:00
committed by GitHub
parent 251e89fe5a
commit 1d64b2e22a
22 changed files with 1252 additions and 973 deletions

View File

@@ -433,6 +433,10 @@ export const commonProjectTypeCategoryMessages = defineMessages({
id: 'project-type.shader.category',
defaultMessage: 'Shaders',
},
server: {
id: 'project-type.server.category',
defaultMessage: 'Servers',
},
})
export const commonProjectTypeTitleMessages = defineMessages({
@@ -460,6 +464,10 @@ export const commonProjectTypeTitleMessages = defineMessages({
id: 'project-type.shader.capital',
defaultMessage: '{count, plural, one {Shader} other {Shaders}}',
},
server: {
id: 'project-type.server.capital',
defaultMessage: '{count, plural, one {Server} other {Servers}}',
},
})
export const commonProjectTypeSentenceMessages = defineMessages({
@@ -487,6 +495,10 @@ export const commonProjectTypeSentenceMessages = defineMessages({
id: 'project-type.shader.lowercase',
defaultMessage: '{count, plural, one {shader} other {shaders}}',
},
server: {
id: 'project-type.server.lowercase',
defaultMessage: '{count, plural, one {server} other {servers}}',
},
})
export const commonSettingsMessages = defineMessages({

View File

@@ -1,3 +1,4 @@
import type { Labrinth } from '@modrinth/api-client'
import { ClientIcon, ServerIcon } from '@modrinth/assets'
import { formatCategory, formatCategoryHeader, sortByNameOrNumber } from '@modrinth/utils'
import { defineMessage, useVIntl } from '@vintl/vintl'
@@ -67,25 +68,10 @@ const ALL_PROJECT_TYPES: ProjectType[] = [
'plugin',
]
export interface Platform {
name: string
icon: string
supported_project_types: ProjectType[]
default: boolean
formatted_name: string
}
export interface Category {
icon: string
name: string
project_type: ProjectType
header: string
}
export interface Tags {
gameVersions: GameVersion[]
loaders: Platform[]
categories: Category[]
gameVersions: Labrinth.Tags.v2.GameVersion[]
loaders: Labrinth.Tags.v2.Loader[]
categories: Labrinth.Tags.v2.Category[]
}
export interface SortType {