Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
hidaviddong committed Jun 18, 2024
1 parent 6a47c30 commit 8b45373
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 61 deletions.
62 changes: 31 additions & 31 deletions src/config/project.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
const Works = [
{
name: "Large Language Model",
description: "Medical field chat application.",
href: "/project/llm",
background: "/1.png",
},
{
name: "Data Visualization",
description: "Chart and 3D models.",
href: "/project/data-visualization",
background: "/1.png",
},
{
name: "Hybrid Mobile App",
description: "QQ Music / We Sing Living Room.",
href: "/project/tme",
background: "/1.png",
},
{
name: "Large Language Model",
description: "Medical field chat application.",
href: "/project/llm",
background: "/1.png",
},
{
name: "Data Visualization",
description: "Chart and 3D models.",
href: "/project/data-visualization",
background: "/1.png",
},
{
name: "Hybrid Mobile App",
description: "QQ Music / We Sing Living Room.",
href: "/project/tme",
background: "/1.png",
},
];

const OpenSourceProjects = [
{
name: "Comments",
description: "Add comments to your website.",
href: "/project/comments",
background: "/1.png",
},
{
name: "daviddong.me",
description: "Personal website template.",
href: "/project/website",
background: "/1.png",
},
{
name: "Comments",
description: "Add comments to your website.",
href: "/project/comments",
background: "/1.png",
},
{
name: "daviddong.me",
description: "Personal website template.",
href: "/project/website",
background: "/1.png",
},
];

export { Works, OpenSourceProjects }
export { Works, OpenSourceProjects };
8 changes: 4 additions & 4 deletions src/pages/project/@name/+Page.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { usePageContext } from 'vike-react/usePageContext'
import { usePageContext } from "vike-react/usePageContext";
export default function Page() {
const pageContext = usePageContext()
const pageContext = usePageContext();
return (
<div className='h-screen w-full flex justify-center items-center'>
<h1 className='text-3xl'> Hello {pageContext.routeParams.name}</h1>
<div className="h-screen w-full flex justify-center items-center">
<h1 className="text-3xl"> Hello {pageContext.routeParams.name}</h1>
</div>
);
}
47 changes: 25 additions & 22 deletions src/pages/project/index/+Page.jsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
import React from 'react'
import { Button } from "@/components/ui/button";
import { OpenSourceProjects, Works } from "@/config/project";
import { Button } from '@/components/ui/button';
import { navigate } from 'vike/client/router';
import React from "react";
import { navigate } from "vike/client/router";

const ProjectLists = ({ title, items }) => (
<section>
<h3>{title}</h3>
<ul>
{items.map(({ name, href }) => (
<li key={name}>
<Button variant="link" className="text-md text-neutral-500 hover:text-neutral-800" onClick={() => navigate(href)}>
{name}
</Button>
</li>
))}
</ul>
</section>
<section>
<h3>{title}</h3>
<ul>
{items.map(({ name, href }) => (
<li key={name}>
<Button
variant="link"
className="text-md text-neutral-500 hover:text-neutral-800"
onClick={() => navigate(href)}
>
{name}
</Button>
</li>
))}
</ul>
</section>
);


export default function Page() {
return (
<main className="prose prose-p:text-neutral-500 p-12 h-screen">
<ProjectLists title="Works" items={Works} />
<ProjectLists title="Open Source Projects" items={OpenSourceProjects} />
</main>
)
return (
<main className="prose prose-p:text-neutral-500 p-12 h-screen">
<ProjectLists title="Works" items={Works} />
<ProjectLists title="Open Source Projects" items={OpenSourceProjects} />
</main>
);
}
8 changes: 4 additions & 4 deletions src/pages/project/index/+onBeforePrerenderStart.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Environment: Node.js
import { OpenSourceProjects, Works } from "@/config/project";
export { onBeforePrerenderStart }
export { onBeforePrerenderStart };
async function onBeforePrerenderStart() {
const lists = [...OpenSourceProjects, ...Works]
return lists.map(list => list.href)
}
const lists = [...OpenSourceProjects, ...Works];
return lists.map((list) => list.href);
}

0 comments on commit 8b45373

Please sign in to comment.