Skip to content

Commit

Permalink
fix: fix icon
Browse files Browse the repository at this point in the history
  • Loading branch information
TinsFox committed Dec 1, 2024
1 parent b660790 commit 5b1a844
Show file tree
Hide file tree
Showing 54 changed files with 79 additions and 149 deletions.
2 changes: 1 addition & 1 deletion apps/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"dependencies": {
"@hookform/resolvers": "^3.9.1",
"@radix-ui/react-icons": "^1.3.2",
"@repo/pro-components": "workspace:*",
"@repo/pro-table": "workspace:*",
"@repo/ui": "workspace:*",
"@tanstack/react-query": "^5.59.17",
"@tanstack/react-table": "^8.20.5",
Expand Down
22 changes: 14 additions & 8 deletions apps/admin/src/lib/data-dictionary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
QuestionMarkCircledIcon,
StopwatchIcon,
} from "@radix-ui/react-icons"
import { FileWarning } from "lucide-react"

export const labels = [
{
Expand All @@ -26,27 +27,27 @@ export const labels = [

export const statuses = [
{
value: "backlog",
value: "BACKLOG",
label: "Backlog",
icon: QuestionMarkCircledIcon,
},
{
value: "todo",
value: "TODO",
label: "Todo",
icon: CircleIcon,
},
{
value: "in progress",
value: "IN_PROGRESS",
label: "In Progress",
icon: StopwatchIcon,
},
{
value: "done",
value: "DONE",
label: "Done",
icon: CheckCircledIcon,
},
{
value: "canceled",
value: "CANCELLED",
label: "Canceled",
icon: CrossCircledIcon,
},
Expand All @@ -55,17 +56,22 @@ export const statuses = [
export const priorities = [
{
label: "Low",
value: "low",
value: "LOW",
icon: ArrowDownIcon,
},
{
label: "Medium",
value: "medium",
value: "MEDIUM",
icon: ArrowRightIcon,
},
{
label: "High",
value: "high",
value: "HIGH",
icon: ArrowUpIcon,
},
{
label: "Urgent",
value: "URGENT",
icon: FileWarning,
},
]
40 changes: 0 additions & 40 deletions apps/admin/src/lib/jotai.ts

This file was deleted.

22 changes: 0 additions & 22 deletions apps/admin/src/lib/menu.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
import {
DataTablePagination,
DataTableSearch,
} from "@repo/pro-components/data-table"
} from "@repo/pro-table/data-table"
import { Avatar, AvatarFallback, AvatarImage } from "@repo/ui/avatar"
import { Button } from "@repo/ui/button"
import { Checkbox } from "@repo/ui/checkbox"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
DotsHorizontalIcon,
} from "@radix-ui/react-icons"
import type { ColumnDef, SearchParams } from "@repo/pro-components/pro-table"
import { ProTable } from "@repo/pro-components/pro-table"
import type { ColumnDef, SearchParams } from "@repo/pro-table/pro-table"
import { ProTable } from "@repo/pro-table/pro-table"
import { Avatar, AvatarFallback, AvatarImage } from "@repo/ui/avatar"
import { Button } from "@repo/ui/button"
import { Checkbox } from "@repo/ui/checkbox"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
DataTableFacetedFilter,
DataTablePagination,
DataTableViewOptions,
} from "@repo/pro-components/data-table"
} from "@repo/pro-table/data-table"
import { Badge } from "@repo/ui/badge"
import { Button } from "@repo/ui/button"
import { Checkbox } from "@repo/ui/checkbox"
Expand Down Expand Up @@ -134,6 +134,7 @@ const columns: ColumnDef<ITask>[] = [
},
{
id: "actions",
header: ({ column }) => <DataTableColumnHeader column={column} title="Actions" />,
cell: ({ row }) => {
const task = taskSchema.parse(row.original)
return (
Expand Down
5 changes: 0 additions & 5 deletions apps/admin/src/schema/menu.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { LucideIcon } from "lucide-react"
import { z } from "zod"

// 由于 LucideIcon 是一个类型,我们需要使用 custom 方法来验证
const LucideIconSchema = z.custom<LucideIcon>(
(data) => {
return typeof data === "function"
Expand All @@ -11,15 +10,13 @@ const LucideIconSchema = z.custom<LucideIcon>(
},
)

// 子菜单项 Schema
export const ChildrenMenuItemSchema = z.object({
title: z.string(),
label: z.string().optional(),
icon: LucideIconSchema,
to: z.string().url(),
})

// 菜单项 Schema
export const MenuItemSchema = z.object({
title: z.string(),
label: z.string().optional(),
Expand All @@ -28,10 +25,8 @@ export const MenuItemSchema = z.object({
children: z.array(ChildrenMenuItemSchema).optional(),
})

// 导出类型
export type IChildrenMenuItem = z.infer<typeof ChildrenMenuItemSchema>
export type MenuItem = z.infer<typeof MenuItemSchema>
export type IMenu = MenuItem

// 如果需要验证菜单数组
export const MenuArraySchema = z.array(MenuItemSchema)
1 change: 0 additions & 1 deletion apps/admin/src/test/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import "@testing-library/jest-dom"
import { cleanup } from "@testing-library/react"
import { afterEach } from "vitest"

// 每个测试后清理
afterEach(() => {
cleanup()
})
2 changes: 1 addition & 1 deletion apps/admin/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
darkMode: ["class"],
content: [
"../../packages/ui/src/**/*.{js,ts,jsx,tsx}",
"../../packages/pro-components/src/**/*.{js,ts,jsx,tsx}",
"../../packages/pro-table/src/**/*.{js,ts,jsx,tsx}",
"./pages/**/*.{ts,tsx}",
"./components/**/*.{ts,tsx}",
"./app/**/*.{ts,tsx}",
Expand Down
5 changes: 1 addition & 4 deletions apps/api/src/db/client.serverless.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { drizzle } from 'drizzle-orm/neon-http'

import { neon } from '@neondatabase/serverless'
import { config } from 'dotenv'
import * as schema from './schema'
config({ path: '../../.dev.vars' })

export const dbClient = drizzle(process.env.DATABASE_URL!, { schema })

export const dbClientInWorker = (DATABASE_URL: string) => {

const sql = neon(DATABASE_URL)
return drizzle(sql, { schema, logger: true })
}
2 changes: 1 addition & 1 deletion apps/api/src/module/tasks/enums.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { z } from 'zod'

export const TaskStatusEnum = ['TODO', 'IN_PROGRESS', 'DONE', 'CANCELLED'] as const
export const TaskStatusEnum = ['BACKLOG', 'TODO', 'IN_PROGRESS', 'DONE', 'CANCELLED'] as const

export const TaskStatusEnumSchema = z.enum(TaskStatusEnum)
export type TaskStatusType = z.infer<typeof TaskStatusEnumSchema>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@repo/pro-components",
"name": "@repo/pro-table",
"type": "module",
"version": "0.0.0",
"private": true,
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
darkMode: ["class"],
content: [
"../../packages/ui/src/**/*.{js,ts,jsx,tsx}",
"../../packages/pro-components/src/**/*.{js,ts,jsx,tsx}",
"../../packages/pro-table/src/**/*.{js,ts,jsx,tsx}",
"./pages/**/*.{ts,tsx}",
"./components/**/*.{ts,tsx}",
"./app/**/*.{ts,tsx}",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 5b1a844

Please sign in to comment.