You've already forked AstralRinth
forked from didirus/AstralRinth
Refactor search page, migrate to /discover/ (#4862)
This commit is contained in:
@@ -56,6 +56,16 @@ const emit = defineEmits(['onOpen', 'onClose'])
|
||||
|
||||
const slots = useSlots()
|
||||
|
||||
watch(
|
||||
() => props.openByDefault,
|
||||
(newValue) => {
|
||||
if (newValue !== toggledOpen.value) {
|
||||
toggledOpen.value = newValue
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
)
|
||||
|
||||
function open() {
|
||||
toggledOpen.value = true
|
||||
emit('onOpen')
|
||||
|
||||
@@ -55,7 +55,6 @@ onUnmounted(() => {
|
||||
}
|
||||
})
|
||||
function updateFade(scrollTop, offsetHeight, scrollHeight) {
|
||||
console.log(scrollTop, offsetHeight, scrollHeight)
|
||||
scrollableAtBottom.value = Math.ceil(scrollTop + offsetHeight) >= scrollHeight
|
||||
scrollableAtTop.value = scrollTop <= 0
|
||||
}
|
||||
|
||||
@@ -560,6 +560,15 @@
|
||||
"project-type.resourcepack.lowercase": {
|
||||
"defaultMessage": "{count, plural, one {resource pack} other {resource packs}}"
|
||||
},
|
||||
"project-type.server.capital": {
|
||||
"defaultMessage": "{count, plural, one {Server} other {Servers}}"
|
||||
},
|
||||
"project-type.server.category": {
|
||||
"defaultMessage": "Servers"
|
||||
},
|
||||
"project-type.server.lowercase": {
|
||||
"defaultMessage": "{count, plural, one {server} other {servers}}"
|
||||
},
|
||||
"project-type.shader.capital": {
|
||||
"defaultMessage": "{count, plural, one {Shader} other {Shaders}}"
|
||||
},
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user