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

Blog list #45

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
5 changes: 4 additions & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@

import { BrowserRouter, Route, Routes } from "react-router-dom";
import About from "./pages/about/About";
import Blog from "./pages/Blog/Blog";
import Career from "./pages/career/Career";
import CauseDetails from "./pages/causes/CauseDetails";
import Causes from "./pages/causes/Causes";
import DonatePage from "./pages/causes/DonatePage";
import Contact from "./pages/contact/Contact";
import Donners from "./pages/donners/Donners";
import Faqs from "./pages/faqs/Faqs";
import Home from "./pages/home/Home";
import Leadership from "./pages/leadership/Leadership";
import Faqs from "./pages/faqs/Faqs";

function App() {
return (
Expand All @@ -27,6 +28,8 @@ function App() {
<Route path="/donners" element={<Donners />} />
<Route path="/causes/:id" element={<CauseDetails />} />
<Route path="/donate" element={<DonatePage />} />
<Route path="/blog" element={<Blog />} />
{/* <Route path="/blog/:id" element={<BlogDetails/>}/> */}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No such Component as BlogDetails
Fix this

</Routes>
</BrowserRouter>
);
Expand Down
28 changes: 28 additions & 0 deletions src/pages/Blog/Blog.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from "react";
import GeneralHero from "../../components/layout/GeneralHero";
import Header from "../../components/layout/Header";
import image1 from "/assets/images/Rectangle 2.png";

import Footer from "../../components/layout/Footer";
import StatisticsSection from "../../components/layout/StatisticsSection";
import BlogList from "./components/BlogList";

function Blog() {
return (
<>
<Header outerCircle=""></Header>
<GeneralHero
title="Blog "
subTitle="Blog List"
image={image1}
></GeneralHero>

<BlogList></BlogList>

<StatisticsSection></StatisticsSection>
<Footer></Footer>
</>
);
}

export default Blog;
39 changes: 39 additions & 0 deletions src/pages/Blog/components/BlogList.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React from "react";
import Pagination from "../../../components/Pagination";
import BlogCard from "../../home/components/BlogCard";
import image14 from "/assets/images/Rectangle 14.png";

function BlogList() {
const blogId = 1;
const day = "25";
const month = "Febuary";
const category = "Education";
const title = "Children Education Needs For Well The World.";
const description = "Children Education Needs For Well The World.";
const author = "Adam";
return (
<>
<section className="mx-6 md:mx-32 flex flex-col items-center my-20 gap-10">
<div className="flex flex-col lg:grid lg:grid-cols-3 gap-6">
{Array.from({ length: 12 }).map((_, index) => (
<BlogCard
key={index}
id={blogId}
image={image14}
day="25"
month="Febuary"
category="Education"
title="Children Education Needs For Well The World."
description="Children Education Needs For Well The World."
author="Adam"
/>
))}
</div>

<Pagination />
</section>
</>
);
}

export default BlogList;
10 changes: 5 additions & 5 deletions src/pages/causes/CauseDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,23 @@ function CauseDetails() {

<div className="flex flex-col items-center gap-6 w-full">
<div className="flex flex-row justify-between ">
<div className="border border-primary-color py-2 px-8 h-fit">
<div className="border border-primary-color py-2 px-6 h-fit">
{" "}
$20
</div>
<div className="border border-primary-color py-2 px-8 h-fit">
<div className="border border-primary-color py-2 px-6 h-fit">
{" "}
$50
</div>
<div className="border border-primary-color py-2 px-8 h-fit">
<div className="border border-primary-color py-2 px-6 h-fit">
{" "}
$200
</div>
<div className="border border-primary-color py-2 px-8 h-fit">
<div className="border border-primary-color py-2 px-6 h-fit">
{" "}
$200
</div>
<div className="border border-primary-color py-2 px-8 h-fit">
<div className="border border-primary-color py-2 px-6 h-fit">
{" "}
Custom
</div>
Expand Down
23 changes: 9 additions & 14 deletions src/pages/faqs/Faqs.jsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
import React from 'react'
import Header from '../../components/layout/Header'
import Hero1 from '../../components/layout/Hero1'
import Footer from '../../components/layout/Footer'

import React from "react";
import Footer from "../../components/layout/Footer";
import Header from "../../components/layout/Header";
import Hero1 from "../../components/layout/Hero1";
// import FaqsSection from './components/FaqsSection'

const Faqs = () => {
return (
<div>
<Header/>
<Hero1
title = "FAQ'S"
text = "Home"
span = "FAQ'S"
/>

{/* <FaqsSection/> */}
<Header />
<Hero1 title="FAQ'S" text="Home" span="FAQ'S" />

<Footer/>
{/* <FaqsSection/> */}

<Footer />
</div>
);
};
Expand Down
15 changes: 9 additions & 6 deletions src/pages/home/components/BlogCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import React from "react";
import Button from "../../../components/Button";

function BlogCard(props) {
const { image, day, month, category, title, description, author } = props;

const { id,image, day, month, category, title, description, author } = props;
const maxDescriptionLength = 60; // max letters
const truncatedDescription =
console.log(id);
const truncatedDescription =
description.length > maxDescriptionLength
? `${description.substring(0, maxDescriptionLength)}...`
: description;
Expand Down Expand Up @@ -41,10 +43,11 @@ function BlogCard(props) {
<p>{author}</p>
</div>
<Button
text="View Details"
type="secondary-button"
icon={<i className="fa fa-angle-right"></i>}
></Button>
type="secondary-link"
text="Readmore"
icon={<i className="fa fa-angle-right"></i>}
href={`/blog/${id}`}
></Button>
</div>
</section>
);
Expand Down
1 change: 1 addition & 0 deletions src/pages/home/components/DonationSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function DonationSection() {
Causes of Givest
</p>
<div className="flex flex-col gap-8 lg:flex-row">

{donations.slice(0, 3).map((donation, index) => (
<DonationCard key={donation.id} {...donation} />
))}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/components/EventCard.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import image10 from "/assets/images/Image1.png";

import image10 from "/assets/images/Image1.png";

function EventCard(props) {
const title = props.title;
Expand Down
1 change: 1 addition & 0 deletions src/pages/home/components/HelpSection.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react";

import icon from "/assets/images/Icon.png";
import icon2 from "/assets/images/Icon2.png";
import icon3 from "/assets/images/Icon3.png";
Expand Down