Skip to content

Commit

Permalink
Merge pull request #10 from Will513r/mike/post
Browse files Browse the repository at this point in the history
Mike/post
  • Loading branch information
kensonjohnson authored Aug 2, 2024
2 parents eff85d7 + 835d0be commit 24c03f1
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 27 deletions.
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>
);
}
59 changes: 59 additions & 0 deletions src/components/Post.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import type { PostData } from "../content/content";

type PostProps = { post: PostData };

export function Post({ post }: PostProps) {
return (
<div className="text-black">
{/* Container for the blog post */}
<section className="bg-white dark:bg-gray-900">
<div className="container mx-auto px-6 py-10">
<h1 className="text-2xl font-semibold capitalize text-gray-800 lg:text-3xl dark:text-white">
From the blog
</h1>

<div className="mt-8 flex flex-col items-center lg:-mx-6">
{/* Image of the blog post */}
<img
className="h-72 w-full rounded-xl object-cover lg:mx-6 lg:h-96"
src={post.postImage}
alt=""
/>

<div className="mt-6 lg:mx-6 lg:mt-0">
{/* Date of the blog post */}
<p className="text-sm text-gray-500 dark:text-gray-300">
{post.publishedDate.toLocaleDateString()}
</p>

{/* Title of the blog post */}
<p className="text-xl font-semibold text-gray-800 dark:text-white">
{post.title}
</p>

{/* Content of the blog post */}
<p className="mt-3 text-sm text-gray-500 md:text-sm dark:text-gray-300">
{post.content}
</p>

{/* Author information */}
<div className="mt-6 flex items-center">
<img
className="h-10 w-10 rounded-full object-cover object-center"
src={post.authorImage}
alt=""
/>

<div className="mx-4">
<h1 className="text-sm text-gray-700 dark:text-gray-200">
{post.author}
</h1>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
);
}
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 dolor sit amet consectetur adipisicing elit. Maxime mollitiamolestiae quas vel sint commodi repudiandae consequuntur voluptatum laborumnumquam blanditiis harum quisquam eius sed oditfugiat iusto fuga praesentiumoptio, eaque rerum! Provident similique accusantium nemo autem. Veritatisobcaecati tenetur iure eius earum ut molestias architecto voluptate aliquamnihil, eveniet aliquid culpa officia aut! Impedit sit sunt quaerat, odit,tenetur error, harum nesciunt ipsum debitis quas aliquid. Reprehenderit,quia. Quo neque error repudiandae fuga? Ipsa laudantium molestias eos sapiente officiis modi at sunt excepturi expedita sint? Sed quibusdamrecusandae alias error harum maxime adipisci amet laborum. Perspiciatis minima nesciunt dolorem! Officiis iure rerum luptates a cumque velit quibusdam sed amet tempora. Sit laborum ab, eius fugit doloribus tenetur fugiat, temporibus enim commodi iusto libero magni deleniti quod quam consequuntur! Commodi minima excepturi repudiandae velit hic maximedoloremque. Quaerat provident commodi consectetur veniam similique ad earum omnis ipsum saepe, voluptas, hic voluptates pariatur est explicabo eligendi quam cupiditate excepturi mollitia maiores labore suscipit quas? Nulla, placeat. Voluptatem quaerat non architecto ab laudantiummodi minima sunt esse temporibus sint culpa, recusandae aliquam numquam totam ratione voluptas quod exercitationem fuga. Lorem ipsum dolor sit amet consectetur adipisicing elit. Maxime mollitiamolestiae quas vel sint commodi repudiandae consequuntur voluptatum laborumnumquam blanditiis harum quisquam eius sed oditfugiat iusto fuga praesentiumoptio, eaque rerum! Provident similique accusantium nemo autem. Veritatisobcaecati tenetur iure eius earum ut molestias architecto voluptate aliquamnihil, eveniet aliquid culpa officia aut! Impedit sit sunt quaerat, odit,tenetur error, harum nesciunt ipsum debitis quas aliquid. Reprehenderit,quia. Quo neque error repudiandae fuga? Ipsa laudantium molestias eos sapiente officiis modi at sunt excepturi expedita sint? Sed quibusdamrecusandae alias error harum maxime adipisci amet laborum. Perspiciatis minima nesciunt dolorem! Officiis iure rerum luptates a cumque velit quibusdam sed amet tempora. Sit laborum ab, eius fugit doloribus tenetur fugiat, temporibus enim commodi iusto libero magni deleniti quod quam consequuntur! Commodi minima excepturi repudiandae velit hic maximedoloremque. Quaerat provident commodi consectetur veniam similique ad earum omnis ipsum saepe, voluptas, hic voluptates pariatur est explicabo eligendi quam cupiditate excepturi mollitia maiores labore suscipit quas? Nulla, placeat. Voluptatem quaerat non architecto ab laudantiummodi minima sunt esse temporibus sint culpa, recusandae aliquam numquam totam ratione voluptas quod exercitationem fuga. Lorem ipsum dolor sit amet consectetur adipisicing elit. Maxime mollitiamolestiae quas vel sint commodi repudiandae consequuntur voluptatum laborumnumquam blanditiis harum quisquam eius sed oditfugiat iusto fuga praesentiumoptio, eaque rerum! Provident similique accusantium nemo autem. Veritatisobcaecati tenetur iure eius earum ut molestias architecto voluptate aliquamnihil, eveniet aliquid culpa officia aut! Impedit sit sunt quaerat, odit,tenetur error, harum nesciunt ipsum debitis quas aliquid. Reprehenderit,quia. Quo neque error repudiandae fuga? Ipsa laudantium molestias eos sapiente officiis modi at sunt excepturi expedita sint? Sed quibusdamrecusandae alias error harum maxime adipisci amet laborum. Perspiciatis minima nesciunt dolorem! Officiis iure rerum luptates a cumque velit quibusdam sed amet tempora. Sit laborum ab, eius fugit doloribus tenetur fugiat, temporibus enim commodi iusto libero magni deleniti quod quam consequuntur! Commodi minima excepturi repudiandae velit hic maximedoloremque. Quaerat provident commodi consectetur veniam similique ad earum omnis ipsum saepe, voluptas, hic voluptates pariatur est explicabo eligendi quam cupiditate excepturi mollitia maiores labore suscipit quas? Nulla, placeat. Voluptatem quaerat non architecto ab laudantiummodi minima sunt esse temporibus sint culpa, recusandae aliquam numquam totam ratione voluptas quod exercitationem fuga.",
title: "First post",
author: "William Ray",
publishedDate: new Date(),
},
{
postImage: postTwoImage,
authorImage: Mikelat,
content:
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Maxime mollitiamolestiae quas vel sint commodi repudiandae consequuntur voluptatum laborumnumquam blanditiis harum quisquam eius sed oditfugiat iusto fuga praesentiumoptio, eaque rerum! Provident similique accusantium nemo autem. Veritatisobcaecati tenetur iure eius earum ut molestias architecto voluptate aliquamnihil, eveniet aliquid culpa officia aut! Impedit sit sunt quaerat, odit,tenetur error, harum nesciunt ipsum debitis quas aliquid. Reprehenderit,quia. Quo neque error repudiandae fuga? Ipsa laudantium molestias eos sapiente officiis modi at sunt excepturi expedita sint? Sed quibusdamrecusandae alias error harum maxime adipisci amet laborum. Perspiciatis minima nesciunt dolorem! Officiis iure rerum luptates a cumque velit quibusdam sed amet tempora. Sit laborum ab, eius fugit doloribus tenetur fugiat, temporibus enim commodi iusto libero magni deleniti quod quam consequuntur! Commodi minima excepturi repudiandae velit hic maximedoloremque. Quaerat provident commodi consectetur veniam similique ad earum omnis ipsum saepe, voluptas, hic voluptates pariatur est explicabo eligendi quam cupiditate excepturi mollitia maiores labore suscipit quas? Nulla, placeat. Voluptatem quaerat non architecto ab laudantiummodi minima sunt esse temporibus sint culpa, recusandae aliquam numquam totam ratione voluptas quod exercitationem fuga.",
title: "Second post",
author: "Mike Latimore",
publishedDate: new Date(),
},
{
postImage: postThreeImage,
authorImage: Chrisf,
content:
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Maxime mollitiamolestiae quas vel sint commodi repudiandae consequuntur voluptatum laborumnumquam blanditiis harum quisquam eius sed oditfugiat iusto fuga praesentiumoptio, eaque rerum! Provident similique accusantium nemo autem. Veritatisobcaecati tenetur iure eius earum ut molestias architecto voluptate aliquamnihil, eveniet aliquid culpa officia aut! Impedit sit sunt quaerat, odit,tenetur error, harum nesciunt ipsum debitis quas aliquid. Reprehenderit,quia. Quo neque error repudiandae fuga? Ipsa laudantium molestias eos sapiente officiis modi at sunt excepturi expedita sint? Sed quibusdamrecusandae alias error harum maxime adipisci amet laborum. Perspiciatis minima nesciunt dolorem! Officiis iure rerum luptates a cumque velit quibusdam sed amet tempora. Sit laborum ab, eius fugit doloribus tenetur fugiat, temporibus enim commodi iusto libero magni deleniti quod quam consequuntur! Commodi minima excepturi repudiandae velit hic maximedoloremque. Quaerat provident commodi consectetur veniam similique ad earum omnis ipsum saepe, voluptas, hic voluptates pariatur est explicabo eligendi quam cupiditate excepturi mollitia maiores labore suscipit quas? Nulla, placeat. Voluptatem quaerat non architecto ab laudantiummodi minima sunt esse temporibus sint culpa, recusandae aliquam numquam totam ratione voluptas quod exercitationem fuga.",
title: "Third post",
author: "Chris Forti",
publishedDate: new Date(),
},
];

0 comments on commit 24c03f1

Please sign in to comment.