mirror of
https://github.com/Xevion/xevion.dev.git
synced 2025-12-06 01:16:58 -06:00
Remove projects list from index page
This commit is contained in:
@@ -1,24 +1,20 @@
|
|||||||
import AppWrapper from "@/components/AppWrapper";
|
import AppWrapper from "@/components/AppWrapper";
|
||||||
import ItemCard from "@/components/ItemCard";
|
import directus from "@/utils/directus";
|
||||||
import directus, { type Project } from "@/utils/directus";
|
import { readSingleton } from "@directus/sdk";
|
||||||
import { useBreakpointValue } from "@/utils/helpers";
|
|
||||||
import { readItems, readSingleton } from "@directus/sdk";
|
|
||||||
import { GetStaticPropsResult, type NextPage } from "next";
|
import { GetStaticPropsResult, type NextPage } from "next";
|
||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useEffect } from "react";
|
|
||||||
import Balancer from "react-wrap-balancer";
|
import Balancer from "react-wrap-balancer";
|
||||||
|
|
||||||
type IndexProps = {
|
type IndexProps = {
|
||||||
tagline: string;
|
tagline: string;
|
||||||
projects: Project[];
|
|
||||||
buttons: { text: string; href: string }[];
|
buttons: { text: string; href: string }[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export async function getStaticProps(): Promise<
|
export async function getStaticProps(): Promise<
|
||||||
GetStaticPropsResult<IndexProps>
|
GetStaticPropsResult<IndexProps>
|
||||||
> {
|
> {
|
||||||
const [metadata, projects] = await Promise.all([directus.request(readSingleton("metadata")), directus.request(readItems("project"))]);
|
const metadata = await directus.request(readSingleton("metadata"));
|
||||||
|
|
||||||
const resumeUrl = `${directus.url}assets/${metadata.resume}/${
|
const resumeUrl = `${directus.url}assets/${metadata.resume}/${
|
||||||
metadata.resumeFilename ?? "resume.pdf"
|
metadata.resumeFilename ?? "resume.pdf"
|
||||||
@@ -27,7 +23,6 @@ export async function getStaticProps(): Promise<
|
|||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
tagline: metadata.tagline,
|
tagline: metadata.tagline,
|
||||||
projects,
|
|
||||||
buttons: [
|
buttons: [
|
||||||
{ text: "GitHub", href: "https://github.com/Xevion" },
|
{ text: "GitHub", href: "https://github.com/Xevion" },
|
||||||
{ text: "Projects", href: "/projects" },
|
{ text: "Projects", href: "/projects" },
|
||||||
@@ -42,17 +37,8 @@ export async function getStaticProps(): Promise<
|
|||||||
|
|
||||||
const Home: NextPage<IndexProps> = ({
|
const Home: NextPage<IndexProps> = ({
|
||||||
tagline,
|
tagline,
|
||||||
projects,
|
|
||||||
buttons,
|
buttons,
|
||||||
}: IndexProps) => {
|
}: IndexProps) => {
|
||||||
const useLong = useBreakpointValue("sm", true, false);
|
|
||||||
|
|
||||||
// use-tailwind-breakpoint
|
|
||||||
useEffect(() => {
|
|
||||||
if (typeof window !== "undefined")
|
|
||||||
window.dispatchEvent(new Event("resize"));
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Head>
|
<Head>
|
||||||
@@ -85,20 +71,6 @@ const Home: NextPage<IndexProps> = ({
|
|||||||
<Balancer>{tagline}</Balancer>
|
<Balancer>{tagline}</Balancer>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
|
||||||
id="projects"
|
|
||||||
className="flex min-h-screen flex-row justify-center py-12 sm:py-8 md:items-center"
|
|
||||||
>
|
|
||||||
<div className="mx-auto h-full w-full max-w-[95%] lg:max-w-[85%] xl:max-w-[70%]">
|
|
||||||
<div className="m-1 flex h-full flex-col justify-start gap-y-1">
|
|
||||||
{projects.map((project) => {
|
|
||||||
return (<ItemCard key={project.id}
|
|
||||||
description={useLong ? project.description : project.shortDescription} banner={`${directus.url}assets/${project.bannerImage}`} title={project.name} location={`/${project.id}/`} />
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</AppWrapper>
|
</AppWrapper>
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user