Skip to content

Commit

Permalink
fix: some bug
Browse files Browse the repository at this point in the history
  • Loading branch information
coderz-w committed Jul 16, 2024
1 parent db1d870 commit 1479fb8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 57 deletions.
19 changes: 14 additions & 5 deletions src/app/(main)/(router)/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,28 @@ const TemplateCardData = [
];
const LinkCardData = [
{
linkText: 'Node',
linkText: 'Node1',
LinkUrl: 'https://www.baidu.com',
linkDesc: 'ai帮助你学习前端后端运维安全',
},
{
linkText: 'Node',
linkText: 'Node2',
LinkUrl: 'https://www.baidu.com',
linkDesc: 'ai帮助你学习前端后端运维安全',
},
{
linkText: 'Node',
linkText: 'Node3',
LinkUrl: 'https://www.baidu.com',
linkDesc: 'ai帮助你学习前端后端运维安全',
},
];

function createTemplateCard(templateName: string, templateIconUrl: string) {
return (
<div className=" group relative h-[20vh] py-[16px] px-[16px] duration-200 transition-all rounded-[8px] hover:rounded-[16px] hover:bg-black/50 bg-black/40 overflow-hidden flex flex-col w-1/3 cursor-pointer">
<div
key={templateName}
className=" group relative h-[20vh] py-[16px] px-[16px] duration-200 transition-all rounded-[8px] hover:rounded-[16px] hover:bg-black/50 bg-black/40 overflow-hidden flex flex-col w-1/3 cursor-pointer"
>
<div className="flex items-center h-[28px]">
<div className="w-[28px] h-[28px] rounded-[6px] flex items-center justify-center">
<img className="rounded-[6px]" width="28" height="28" src={templateIconUrl} />
Expand All @@ -57,7 +60,13 @@ function createTemplateCard(templateName: string, templateIconUrl: string) {

function createLinkCard(linkText: string, linkUrl: string, linkDesc: string) {
return (
<a rel="noreferrer" className="w-1/3 cursor-pointer" href={linkUrl} target="_blank">
<a
key={linkText}
rel="noreferrer"
className="w-1/3 cursor-pointer"
href={linkUrl}
target="_blank"
>
<div className="relative group py-[20px] px-[20px] rounded-[8px] hover:rounded-[16px] hover:bg-[#282A2E] bg-[#1F2124] overflow-hidden flex flex-col transition-all duration-200">
<div className="flex items-center h-[16px] w-full place-content-between mb-[12px]">
<div className="font-[600] text-[16px] my-[12px] flex-1 leading-[20px] h-[20px]">
Expand Down
52 changes: 1 addition & 51 deletions src/app/edit/(main)/(router)/file/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,56 +8,6 @@ import { TreeViewElement } from '@/components/extension/tree-view-api';

const FileTree = dynamic(() => import('@/components/file/fileTree'), { ssr: false });

// const data = [
// {
// id: '1',
// filename: 'components',
// children: [
// {
// id: '2',
// filename: 'extension',
// children: [
// {
// id: '3',
// filename: 'tree-view.tsx',
// value: '我42424是page8',
// },
// {
// id: '4',
// filename: 'tree-view-api.tsx',
// value: '11111我是page8',
// },
// ],
// },
// {
// id: '5',
// filename: 'dashboard-tree.tsx',
// value: '我4242是page8',
// },
// ],
// },
// {
// id: '6',
// filename: 'pages',
// children: [
// {
// id: '7',
// filename: 'page.tsx',
// value: '我是page31318',
// },
// {
// id: '8',
// filename: 'page-guide.tsx',
// value: '我是page8',
// },
// ],
// },
// {
// id: '18',
// filename: 'env.ts',
// value: '我是page118',
// },
// ];
const PortsPage: React.FC = () => {
const { fileData } = useUploadFileDataStore();
if (fileData === null) return null;
Expand All @@ -66,7 +16,7 @@ const PortsPage: React.FC = () => {
if (!Array.isArray(fileData)) data = [fileData];

return (
<div className="h-full w-full flex flex-col bg-[#202327]">
<div className="h-[100vh] w-full flex flex-col bg-[#202327]">
<span className=" text-[11px] px-4 pt-2">资源管理器</span>
<div className=" px-0 flex flex-col w-full justify-start">
<FileTree data={data as unknown as TreeViewElement[]}></FileTree>
Expand Down
5 changes: 4 additions & 1 deletion src/components/modals/create-project-modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ export const CreateProjectModal = () => {
onClose();
setFileData(res);
router.push('edit/file');
setLoading(false);
}, 1000);
}

setTimeout(() => {
setLoading(false);
}, 1000);
}}
className="flex justify-center flex-col items-center mt-2 gap-x-2 py-6 border-white/20 border-[1px] rounded-sm cursor-pointer"
>
Expand Down

0 comments on commit 1479fb8

Please sign in to comment.