chore: final layout
This commit is contained in:
10
app/components/EmptyState.tsx
Normal file
10
app/components/EmptyState.tsx
Normal file
@@ -0,0 +1,10 @@
|
||||
export function EmptyState() {
|
||||
return (
|
||||
<div className="mt-5 flex flex-col items-center">
|
||||
<div className="mb-5 font-bold">
|
||||
I haven't post anything yet! So here's a pic of my cat
|
||||
</div>
|
||||
<img src="/cat.jpg" className="rounded-md" />
|
||||
</div>
|
||||
);
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
import { Link as RemixLink } from "@remix-run/react";
|
||||
|
||||
type LinkProps = React.PropsWithChildren<{ to: string }>;
|
||||
|
||||
export function Link({ to, children }: LinkProps) {
|
||||
return (
|
||||
<RemixLink to={to} className="mt-5 hover:text-[#e6c2bf] text-xl font-bold">
|
||||
{children}
|
||||
</RemixLink>
|
||||
);
|
||||
}
|
32
app/components/Post.tsx
Normal file
32
app/components/Post.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import { Link } from "@remix-run/react";
|
||||
|
||||
type PostProps = {
|
||||
id: string;
|
||||
title: string;
|
||||
createdAt: string;
|
||||
description: string | null;
|
||||
};
|
||||
|
||||
export function Post({ title, description, id, createdAt }: PostProps) {
|
||||
return (
|
||||
<div className="mx-5 md:mx-0 md:w-1/2 lg:w-1/3">
|
||||
<div className="p-5 border-gray-600 border-2 rounded-lg">
|
||||
<Link to={id}>
|
||||
<div className="text-center font-bold">
|
||||
<span className="text-[#ffff00] hover:text-[#e6c2bf] md:text-2xl">
|
||||
{title}
|
||||
</span>
|
||||
<span className="ml-2">{`(${new Date(
|
||||
createdAt
|
||||
).toLocaleDateString()})`}</span>
|
||||
</div>
|
||||
{description && (
|
||||
<div className="mt-5 italic md:text-xl max-w-3xl text-center">
|
||||
{description}
|
||||
</div>
|
||||
)}
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
7
app/components/Title.tsx
Normal file
7
app/components/Title.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
export function Title({ children }: React.PropsWithChildren) {
|
||||
return (
|
||||
<div className="mt-5 mx-5 lg:mx-0 text-xl sm:text-3xl text-[#ffff00] font-bold">
|
||||
<span>{children}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user