Skip to content

Commit a6fa713

Browse files
committed
feat(): add bot and smart nft categories
1 parent cebe1cf commit a6fa713

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

prisma/schema.prisma

+2
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ enum Category {
148148
Infrastructure
149149
Social
150150
Others
151+
SmartNFT
152+
Bot
151153
}
152154

153155
enum ProjectBlockchain {

src/components/project/ProjectCard.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { type Project } from '@prisma/client'
22
import { Box, Text, Image, Group } from '@mantine/core'
33
import { Tag } from '@/components/common/Tag'
44
import Link from 'next/link'
5+
import { categoryLabelMapping } from '@/schemas'
56

67
type Props = {
78
project: Project
@@ -70,7 +71,7 @@ export const ProjectCard = ({ project }: Props) => {
7071
{project.categories.map(category => (
7172
<Tag
7273
key={category}
73-
label={category}
74+
label={categoryLabelMapping[category]}
7475
/>
7576
))}
7677
</Group>

src/components/project/ProjectDetailForm.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { FormTextArea } from '@/components/form/FormTextArea'
88
import { FormTag } from '@/components/form/FormTag'
99
import { pascalToNormal } from '@/utils/string'
1010
import { useProjectFormStore } from '@/store'
11+
import { categoryLabelMapping } from '@/schemas'
1112

1213
type Props = {
1314
isDisabled: boolean
@@ -20,7 +21,7 @@ export const ProjectDetailForm = ({ isDisabled }: Props) => {
2021
}))
2122
const categoriesSelectData = Object.values(Category).map(category => ({
2223
value: category,
23-
label: category,
24+
label: categoryLabelMapping[category],
2425
}))
2526

2627
const stageData = Object.values(ProjectStage).map(stage => ({

src/pages/project/[id].tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { Tag } from '@/components/common/Tag'
1212
import dayjs from 'dayjs'
1313
import { pascalToNormal } from '@/utils/string'
1414
import { api } from '@/utils/api'
15+
import { categoryLabelMapping } from '@/schemas'
1516

1617
const LabelText = ({ children }: { children: ReactNode }) => {
1718
return (
@@ -268,7 +269,7 @@ export default function ProjectDetailPage() {
268269
{project.categories.map((category, index) => (
269270
<Tag
270271
key={index}
271-
label={category}
272+
label={categoryLabelMapping[category]}
272273
/>
273274
))}
274275
</Group>

src/schemas/project.ts

+13
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,16 @@ export const projectCreateOrUpdateSchema = z.object({
3030
})
3131

3232
export type ProjectCreateOrUpdateSchemaType = z.infer<typeof projectCreateOrUpdateSchema>
33+
34+
export const categoryLabelMapping: Record<Category, string> = {
35+
[Category.DeFi]: 'DeFi',
36+
[Category.NFT]: 'NFT',
37+
[Category.Game]: 'Game',
38+
[Category.Infrastructure]: 'Infrastructure',
39+
[Category.Social]: 'Social',
40+
[Category.SmartNFT]: 'Smart NFT',
41+
[Category.Others]: 'Other',
42+
[Category.Bot]: 'Bot',
43+
[Category.Tooling]: 'Tooling',
44+
[Category.Dao]: 'Dao',
45+
}

0 commit comments

Comments
 (0)