feat: update gallery nags (#6999)

* update nag to require 3 images from shader projects.

* locales
This commit is contained in:
coolbot
2026-08-04 21:33:26 +00:00
committed by GitHub
parent f42a3bfde3
commit 474c6560fc
27 changed files with 36 additions and 120 deletions
+31 -19
View File
@@ -102,6 +102,23 @@ export const coreNags: Nag[] = [
description: (context: NagContext) => {
const { formatMessage } = useVIntl()
if (context.projectV3?.project_types.includes('resourcepack')) {
return formatMessage(
defineMessage({
id: 'nags.upload-gallery-image.description-resourcepack',
defaultMessage:
'At least one gallery image is required to showcase the content of your resource pack, except for audio or localization packs. If this describes your pack, please select the appropriate tag.',
}),
)
} else if (context.projectV3?.project_types.includes('shader')) {
return formatMessage(
defineMessage({
id: 'nags.upload-gallery-image.description-shader',
defaultMessage:
'At least three gallery images are required to showcase the content of your shader in a variety of situations and conditions.',
}),
)
}
return formatMessage(
defineMessage({
id: 'nags.upload-gallery-image.description',
@@ -109,31 +126,26 @@ export const coreNags: Nag[] = [
'At least one gallery image is required to showcase the content of your {type}.',
}),
{
type:
context.project.project_type === 'resourcepack'
? formatMessage(
defineMessage({
id: 'nags.upload-gallery-image.resourcepack-type',
defaultMessage:
'resource pack, except for audio or localization packs. If this describes your pack, please select the appropriate tag',
}),
)
: formatProjectTypeSentence(formatMessage, context.project.project_type),
type: formatProjectTypeSentence(formatMessage, context.project.project_type),
},
)
},
status: 'required',
shouldShow: (context: NagContext) => {
return (
(context.project.project_type === 'resourcepack' ||
context.project.project_type === 'shader') &&
(!context.project.gallery || context.project.gallery?.length === 0) &&
!(
context.project.categories.includes('audio') ||
context.project.additional_categories.includes('audio') ||
context.project.categories.includes('locale') ||
context.project.additional_categories.includes('locale')
)
(context.projectV3?.project_types.includes('shader') &&
context.project.gallery &&
context.project.gallery?.length < 3) ||
(context.projectV3?.project_types.includes('resourcepack') &&
context.project.gallery &&
context.project.gallery?.length === 0 &&
!(
context.project.categories.includes('audio') ||
context.project.additional_categories.includes('audio') ||
context.project.categories.includes('locale') ||
context.project.additional_categories.includes('locale')
)) ||
false
)
},
link: {