Skip to content

Commit

Permalink
Updated to files structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Midlou committed Jan 16, 2024
1 parent b2a99b8 commit 6de6938
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 55 deletions.
6 changes: 1 addition & 5 deletions src/body/base-body.astro
@@ -1,6 +1,4 @@
---
import MainLayout from '../components/layouts/main-layout';
interface Props {
title: string;
}
Expand All @@ -23,8 +21,6 @@ import '../styles/glow-hover.css';
<title>{title}</title>
</head>
<body>
<!-- <MainLayout title={title} client:load> -->
<slot />
<!-- </MainLayout> -->
<slot />
</body>
</html>
51 changes: 51 additions & 0 deletions src/pages-content/projects-content.jsx
@@ -0,0 +1,51 @@
import _ from "lodash";

// constants
import { PROJECT_ITEMS } from '../constants/projects'

function ProjectsContent() {
let projects = _.orderBy(PROJECT_ITEMS, (project) => {
let release_date = project.release_date;
if (!release_date) return 0;

let date = new Date(release_date);

return date.getTime();
}, 'desc');

return <div className="grid container mx-auto py-3 px-5 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-5">
{
projects.map(project => {
return <div key={project.name} className="w-full">
<div className="flex flex-col gap-2 justify-center container mx-auto">
{
project.thumbnail_path
? (
<div>
<a href={project.page_link}>
<div className="min-w-fit rounded-md">
<img src={project.thumbnail_path} alt={project.description || ''} />
</div>
</a>
</div>
) : (null)
}
<div>
<a href={project.page_link} className="stylized-link text-2xl">
<b>{project.label}</b>
</a>
</div>
<div>
<span className="text-justify">
{project.description}
</span>
</div>

</div>
</div>
})
}
</div>;
}

export default ProjectsContent
Expand Up @@ -3,9 +3,6 @@ import React, { useEffect, useState } from "react";
import { loadSlim } from "@tsparticles/slim";
import Particles, { initParticlesEngine } from "@tsparticles/react";

// components
import MiceblocksLayout from "../../components/layouts/miceblocks-layout";

// images
import MiceblocksTextImage from "../../assets/images/miceblocks/miceblocks-text-1024x256.png";

Expand Down
49 changes: 3 additions & 46 deletions src/pages/projects.astro
@@ -1,58 +1,15 @@
---
import _ from "lodash";
// astro
import BaseBody from '../body/base-body.astro';
// components
import MainLayout from "../components/layouts/main-layout";
// constants
import { PROJECT_ITEMS } from "../constants/projects";
let projects = _.orderBy(PROJECT_ITEMS, (project) => {
let release_date = project.release_date;
if (!release_date) return 0;
let date = new Date(release_date);
return date.getTime();
}, 'desc');
import ProjectsContent from "../pages-content/projects-content.jsx";
---

<BaseBody title="Projects">
<MainLayout title={"Projects"} client:load>
<div class="grid container mx-auto py-3 px-5 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-5">
{
projects.map(project => {
return <div class="w-full">
<div class="flex flex-col gap-2 justify-center container mx-auto">
{
project.thumbnail_path
? (
<div>
<a href={project.page_link}>
<div class="min-w-fit rounded-md">
<img src={project.thumbnail_path} alt={project.description || ''} />
</div>
</a>
</div>
) : (null)
}
<div>
<a href={project.page_link} class="stylized-link text-2xl">
<b>{project.label}</b>
</a>
</div>
<div>
<span class="text-justify">
{project.description}
</span>
</div>

</div>
</div>
})
}
</div>
<ProjectsContent client:load/>
</MainLayout>
</BaseBody>

2 changes: 1 addition & 1 deletion src/pages/projects/miceblocks.astro
Expand Up @@ -3,7 +3,7 @@ import MiceblocksBody from "../../body/miceblocks-body.astro";
// components
import MiceblocksLayout from "../../components/layouts/miceblocks-layout";
import MiceblocksContent from "../../content/projects/miceblocks-content";
import MiceblocksContent from "../../pages-content/projects/miceblocks-content";
---

Expand Down

0 comments on commit 6de6938

Please sign in to comment.