Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chris/post #9

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions src/components/Mainpage.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
import Willray from "../assets/Will.png";
import Mikelat from "../assets/Mike.png";
import Chrisf from "../assets/Chris.png";
import { PostPreview } from "./PostPreview";

const postOneImage =
"https://bucket.material-tailwind.com/magic-ai/06b38f84f9669f766048c469ce861b81880378273a11ae9badaedfc32868ef44.jpg";
const postTwoImage =
"https://bucket.material-tailwind.com/magic-ai/e7aa235a7bc5f504db1c66e27ece08f8118b1da6b21c013500391afcd572cf7d.jpg";
const postThreeImage =
"https://bucket.material-tailwind.com/magic-ai/dc74a867f21afc734166a6d37c08beaba4ff040664ba8ccce918e054264ad68d.jpg";
// import { PostPreview } from "./PostPreview";
import { data } from "../content/content";
import { Post } from "./Post";

export function Mainpage() {
return (
<main className="container m-0 flex h-[calc(100vh_-_12.5rem)] flex-col overflow-scroll bg-white p-4">
<PostPreview postImage={postOneImage} authorImage={Willray} />
<PostPreview postImage={postTwoImage} authorImage={Mikelat} />
<PostPreview postImage={postThreeImage} authorImage={Chrisf} />
{/* {data.map((post) => {
return <PostPreview post={post} />;
})} */}
<Post post={data[0]} />
</main>
);
}
94 changes: 94 additions & 0 deletions src/components/Post.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import type { PostData } from "../content/content";

type PostProps = { post: PostData };

export function Post({ post }: PostProps) {
return (
<main className="text-black">
<h2 className="p-2 text-xl">{post.author}</h2>
<h2 className="p-3">{post.title}</h2>
<em className="p-3 text-indigo-700">{post.content}</em>
<h1 className="text p-4 text-5xl">What is Lorem Ipsum?</h1>
<p>
Contrary to popular belief, Lorem Ipsum is not simply random text. It
has roots in a piece of classical Latin literature from 45 BC, making it
over 2000 years old. Richard McClintock, a Latin professor at
Hampden-Sydney College in Virginia, looked up one of the more obscure
Latin words, consectetur, from a Lorem Ipsum passage, and going through
the cites of the word in classical literature, discovered the
undoubtable source.
</p>
<br />
<p>
Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus
Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written
in 45 BC. This book is a treatise on the theory of ethics, very popular
during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum
dolor sit amet..", comes from a line in section 1.10.32.
</p>
<br />
<p>
The standard chunk of Lorem Ipsum used since the 1500s is reproduced
below for those interested. Sections 1.10.32 and 1.10.33 from "de
Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact
original form, accompanied by English versions from the 1914 translation
by H. Rackham.
</p>
<h2 className="p-3 text-3xl">Why do we use it?</h2>
<p>
It is a long established fact that a reader will be distracted by the
readable content of a page when looking at its layout. The point of
using Lorem Ipsum is that it has a more-or-less normal distribution of
letters, as opposed to using 'Content here, content here', making it
look like readable English.
</p>
<br />
<p>
Many desktop publishing packages and web page editors now use Lorem
Ipsum as their default model text, and a search for 'lorem ipsum' will
uncover many web sites still in their infancy. Various versions have
evolved over the years, sometimes by accident, sometimes on purpose
(injected humour and the like).
</p>
<h2 className="p-3 text-3xl">Where can I get some?</h2>
<p>
There are many variations of passages of Lorem Ipsum available, but the
majority have suffered alteration in some form, by injected humour, or
randomised words which don't look even slightly believable.
</p>
<br />
<p>
If you are going to use a passage of Lorem Ipsum, you need to be sure
there isn't anything <em>embarrassing hidden in the middle of text</em>.
All the Lorem Ipsum generators on the Internet tend to repeat predefined
chunks as necessary.{" "}
</p>
<br />
<a
href="https://www.lipsum.com/"
className="text-green-500 hover:text-indigo-700"
>
lipsum.com
</a>
<br />
<p>
Uses a dictionary of over 200 Latin words, combined with a handful of
model sentence structures, to generate Lorem Ipsum which looks
reasonable. The generated Lorem Ipsum is therefore always free from
repetition, injected humour, or non-characteristic words etc.
</p>
<br />
<em className="font-extrabold">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis suscipit
elementum quam. Vestibulum ante ipsum primis in faucibus orci luctus et
ultrices posuere cubilia curae; Sed vitae efficitur nibh. Vivamus
lacinia sapien nec lacus porta, id rutrum massa sollicitudin. Morbi
consequat massa sed tellus feugiat tempus. Vestibulum arcu velit,
elementum tincidunt ligula sed, eleifend tempus dolor. Etiam vitae
vestibulum dolor. Aenean semper tempus neque a varius. Suspendisse ac
odio eu nunc ornare fringilla. Donec cursus vel lorem ut feugiat.
</em>
<p>{post.author}</p>
</main>
);
}
28 changes: 15 additions & 13 deletions src/components/PostPreview.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
export function PostPreview({
postImage,
authorImage,
}: {
postImage: string;
authorImage: string;
}) {
import { type PostData } from "../content/content";

type PostPreviewProps = {
post: PostData;
};

export function PostPreview(props: PostPreviewProps) {
const { postImage, authorImage, content, title, author, publishedDate } =
props.post;
return (
<div className="flex flex-col text-gray-700">
<div className="relative m-0 overflow-hidden rounded-xl bg-white bg-clip-border text-gray-700 shadow-lg">
Expand All @@ -22,22 +24,22 @@ export function PostPreview({
href="#"
className="text-blue-gray-900 mb-2 block font-sans text-xl font-semibold normal-case leading-snug tracking-normal antialiased transition-colors hover:text-gray-700"
>
Revolutionizing Our Production Process
{title}
</a>
<p className="mb-8 block font-sans text-base font-normal leading-relaxed !text-gray-500 text-inherit antialiased">
Learn how our recent investment in new technology has revolutionized
our production process, leading to improved efficiency and product
quality.
{content}
</p>
<div className="flex items-center gap-4">
<img
src={authorImage}
className="relative inline-block h-12 w-12 !rounded-full object-cover object-center"
/>
<div>
<p className="text-blue-gray-900 mb-0.5 block font-sans text-base font-light leading-relaxed antialiased"></p>
<p className="text-blue-gray-900 mb-0.5 block font-sans text-base font-light leading-relaxed antialiased">
{author}
</p>
<p className="block font-sans text-sm font-normal leading-normal text-gray-700 antialiased">
2022-08-15
{publishedDate.toDateString()}
</p>
</div>
</div>
Expand Down
49 changes: 49 additions & 0 deletions src/content/content.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import Willray from "../assets/Will.png";
import Mikelat from "../assets/Mike.png";
import Chrisf from "../assets/Chris.png";

export type PostData = {
postImage: string;
authorImage: string;
content: string;
title: string;
author: string;
publishedDate: Date;
};

const postOneImage =
"https://bucket.material-tailwind.com/magic-ai/06b38f84f9669f766048c469ce861b81880378273a11ae9badaedfc32868ef44.jpg";
const postTwoImage =
"https://bucket.material-tailwind.com/magic-ai/e7aa235a7bc5f504db1c66e27ece08f8118b1da6b21c013500391afcd572cf7d.jpg";
const postThreeImage =
"https://bucket.material-tailwind.com/magic-ai/dc74a867f21afc734166a6d37c08beaba4ff040664ba8ccce918e054264ad68d.jpg";

export const data: PostData[] = [
{
postImage: postOneImage,
authorImage: Willray,
content:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
title: "First post",
author: "William Ray",
publishedDate: new Date(),
},
{
postImage: postTwoImage,
authorImage: Mikelat,
content:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
title: "Second post",
author: "Mike Latimore",
publishedDate: new Date(),
},
{
postImage: postThreeImage,
authorImage: Chrisf,
content:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
title: "Third post",
author: "Chris Forti",
publishedDate: new Date(),
},
];