2021-10-17 18:27:44 +00:00
|
|
|
import { For, Show } from 'solid-js';
|
|
|
|
import Icons from './Icons';
|
2021-10-17 18:41:15 +00:00
|
|
|
import { Project } from '../types/project';
|
2021-10-17 18:27:44 +00:00
|
|
|
import { NavLink } from 'solid-app-router';
|
|
|
|
import { convertCase } from '../config/case';
|
|
|
|
|
|
|
|
function ProjectCard(project: Project) {
|
|
|
|
return (
|
2022-08-06 08:44:27 +00:00
|
|
|
<div class='rounded-lg bg-steel-100 hover:bg-wisteria-200 lg:(opacity-70 p-4) p-3 hover:opacity-100 dark:(bg-steel-900 hover:bg-wisteria-900) transition duration-500 ease-in-out'>
|
|
|
|
<div class='flex flex-col'>
|
|
|
|
<div class='flex-1 py-2'>
|
2021-10-17 18:27:44 +00:00
|
|
|
<NavLink href={'/project/' + convertCase(project.title)}>
|
2022-08-06 08:44:27 +00:00
|
|
|
<h2 class='text-xl font-bold'>{project.title}</h2>
|
|
|
|
<p class='text-base'>{project.description}</p>
|
2021-10-17 18:27:44 +00:00
|
|
|
</NavLink>
|
|
|
|
</div>
|
2022-08-06 08:44:27 +00:00
|
|
|
<div class='flex-1 py-2'>
|
|
|
|
<div class='flex-col md:flex-row items-center'>
|
|
|
|
<p class='text-xs text-gray-300 inline pr-2'>{project.type.toUpperCase()}</p>
|
|
|
|
<p class='text-xs text-gray-300 inline pr-2'>{project.role.toUpperCase()}</p>
|
2021-10-17 18:27:44 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-08-06 08:44:27 +00:00
|
|
|
<div class='flex-1 py-2'>
|
|
|
|
<div class='flex flex-row flex-wrap items-center'>
|
2021-10-17 18:27:44 +00:00
|
|
|
<For each={project.stack}>
|
2022-08-06 08:44:27 +00:00
|
|
|
{item => <div class='flex-initial pr-2'><Icons name={item} /></div>}
|
2021-10-17 18:27:44 +00:00
|
|
|
</For>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-08-06 08:44:27 +00:00
|
|
|
<div class='flex-1 py-2'>
|
|
|
|
<div class='flex flex-row flex-wrap items-center'>
|
2021-10-17 18:27:44 +00:00
|
|
|
<Show when={project.repository}>
|
2022-08-06 08:44:27 +00:00
|
|
|
<div class='flex-initial pr-2'>
|
2021-10-17 18:27:44 +00:00
|
|
|
<a href={project.repository}>
|
2022-08-06 08:44:27 +00:00
|
|
|
<Icons name='github' />
|
2021-10-17 18:27:44 +00:00
|
|
|
</a>
|
|
|
|
</div>
|
2022-08-06 08:44:27 +00:00
|
|
|
<div class='flex-initial pr-4 text-xs'>
|
2021-10-17 18:27:44 +00:00
|
|
|
<a href={project.repository}>Repository</a>
|
|
|
|
</div>
|
|
|
|
</Show>
|
|
|
|
<Show when={project.website}>
|
2022-08-06 08:44:27 +00:00
|
|
|
<div class='flex-initial pr-2'>
|
2021-10-17 18:27:44 +00:00
|
|
|
<a href={project.website}>
|
2022-08-06 08:44:27 +00:00
|
|
|
<Icons name='arrow-right' />
|
2021-10-17 18:27:44 +00:00
|
|
|
</a>
|
|
|
|
</div>
|
2022-08-06 08:44:27 +00:00
|
|
|
<div class='flex-initial pr-2 text-xs'>
|
2021-10-17 18:27:44 +00:00
|
|
|
<a href={project.website}>Website</a>
|
|
|
|
</div>
|
|
|
|
</Show>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-10-17 18:41:15 +00:00
|
|
|
);
|
2021-10-17 18:27:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default ProjectCard;
|