Skip to content

Commit

Permalink
feat: 优化文件列表页样式
Browse files Browse the repository at this point in the history
  • Loading branch information
huayemao committed Jun 21, 2024
1 parent 215cf1a commit e464631
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 13 deletions.
49 changes: 41 additions & 8 deletions app/admin/files/page.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,51 @@
import prisma from "@/lib/prisma";
import {
BaseButtonIcon,
BaseCard,
BaseDropdown,
BaseDropdownItem,
BaseList,
BaseListItem,
} from "@shuriken-ui/react";
import { EllipsisIcon, FileIcon, TrashIcon } from "lucide-react";
import { UploadForm } from "../../../components/UploadForm";

export default async function UploadTest() {
const list = await prisma.file.findMany();
const list = await prisma.file.findMany({
select: {
id: true,
name: true,
},
});

return (
<div className="py-4 pt-20 md:px-12">
{list.map((e) => (
<div key={e.id}>{e.name}</div>
))}

<div>
<BaseCard className="py-4 pt-20 md:px-12 bg-white">
<BaseList className="max-w-xl">
{list.map((e) => (
<BaseListItem
key={e.id}
title={e.name}
end={
<BaseDropdown
renderButton={
<BaseButtonIcon size="sm" rounded="full" className="h-5 w-5">
<EllipsisIcon></EllipsisIcon>
</BaseButtonIcon>
}
>
<BaseDropdownItem>
<TrashIcon></TrashIcon>
</BaseDropdownItem>
</BaseDropdown>
}
>
<FileIcon className="h-6 w-6"></FileIcon>
</BaseListItem>
))}
</BaseList>
</BaseCard>
<UploadForm />
</div>
);
}


2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"comlink": "^4.4.1",
"dayjs": "^1.11.10",
"localforage": "^1.10.0",
"lucide-react": "^0.303.0",
"lucide-react": "^0.396.0",
"mime": "^4.0.3",
"next": "^14.0.4",
"next-mdx-remote": "^4.4.1",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2623,10 +2623,10 @@ lru-cache@^6.0.0:
dependencies:
yallist "^4.0.0"

lucide-react@^0.303.0:
version "0.303.0"
resolved "https://registry.npmmirror.com/lucide-react/-/lucide-react-0.303.0.tgz#48409f43b68fc930ac74f3de24c99614a2dc05c2"
integrity sha512-B0B9T3dLEFBYPCUlnUS1mvAhW1craSbF9HO+JfBjAtpFUJ7gMIqmEwNSclikY3RiN2OnCkj/V1ReAQpaHae8Bg==
lucide-react@^0.396.0:
version "0.396.0"
resolved "https://registry.npmmirror.com/lucide-react/-/lucide-react-0.396.0.tgz#f9a7afdfa0911bcd6eb3107d4bc60564f0399cf5"
integrity sha512-N/zP+9vEfEYHiMWMpjwH/M5diaV0e4UFe07BpgdzaRYce5QvXi87hixf7F0Xqdr3zuX/9u7H/2D4MVXIK22O0A==

lz-string@^1.4.4:
version "1.5.0"
Expand Down

0 comments on commit e464631

Please sign in to comment.