iconDirEasy
UI/组件

卡片

如何自定义项目卡片

DirEasy的项目卡片默认以列表样式显示,适合像Product Hunter这样的应用,但如果你想构建一个目录应用,可以使用网格大卡片样式并隐藏评论按钮点赞按钮排名文本

lib/constants.ts
// custom project card style
export const PROJECT_CARD_STYLE = {
  HIDE_COMMENT: false, // Hide the comment button
  HIDE_UPVOTE: false, // Hide the upvote button
  HIDE_RANK: false, // Hide the rank text
  COLLECTION_PROJECT_BIG_CARD: true, // Big card for projects in collection
  BIG_CARD: false, // Big card for projects, which is recommended to be set to true for directory apps
} as const
 
// custom project list style
export const PROJECT_LIST_STYLE = {
  GRID_COLUMNS: 1, // Number of columns in the grid
} as const
 
// custom collections list style
export const COLLECTION_LIST_STYLE = {
  GRID_COLUMNS: 3, // Number of columns in the grid for collections
} as const
 
// custom collection project list style
export const COLLECTION_PROJECT_LIST_STYLE = {
  GRID_COLUMNS: 3, // Number of columns in the grid for collections
} as const

大卡片 Card