diff --git a/public/images/home-page/browse-1.avif b/public/images/home-page/browse-1.avif new file mode 100644 index 0000000..5416f24 Binary files /dev/null and b/public/images/home-page/browse-1.avif differ diff --git a/public/images/home-page/browse-2.avif b/public/images/home-page/browse-2.avif new file mode 100644 index 0000000..ed8f32e Binary files /dev/null and b/public/images/home-page/browse-2.avif differ diff --git a/public/images/home-page/browse-3.avif b/public/images/home-page/browse-3.avif new file mode 100644 index 0000000..0bac3bd Binary files /dev/null and b/public/images/home-page/browse-3.avif differ diff --git a/public/images/home-page/focus-group.png b/public/images/home-page/focus-group.png new file mode 100644 index 0000000..5d0f9ba Binary files /dev/null and b/public/images/home-page/focus-group.png differ diff --git a/public/images/home-page/hands.png b/public/images/home-page/hands.png new file mode 100644 index 0000000..a873169 Binary files /dev/null and b/public/images/home-page/hands.png differ diff --git a/public/images/home-page/help.png b/public/images/home-page/help.png new file mode 100644 index 0000000..f85276e Binary files /dev/null and b/public/images/home-page/help.png differ diff --git a/public/images/home-page/herosectionImg.jpeg b/public/images/home-page/herosectionImg.jpeg new file mode 100644 index 0000000..97494c9 Binary files /dev/null and b/public/images/home-page/herosectionImg.jpeg differ diff --git a/public/images/home-page/icon1.svg b/public/images/home-page/icon1.svg new file mode 100644 index 0000000..cba9565 --- /dev/null +++ b/public/images/home-page/icon1.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/public/images/home-page/icon2.svg b/public/images/home-page/icon2.svg new file mode 100644 index 0000000..8473f81 --- /dev/null +++ b/public/images/home-page/icon2.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/public/images/home-page/icon3.svg b/public/images/home-page/icon3.svg new file mode 100644 index 0000000..7924660 --- /dev/null +++ b/public/images/home-page/icon3.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/public/images/home-page/icon4.svg b/public/images/home-page/icon4.svg new file mode 100644 index 0000000..4a01574 --- /dev/null +++ b/public/images/home-page/icon4.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/public/images/home-page/recoded-logo.png b/public/images/home-page/recoded-logo.png new file mode 100644 index 0000000..4631378 Binary files /dev/null and b/public/images/home-page/recoded-logo.png differ diff --git a/public/images/home-page/teamwork.jpeg b/public/images/home-page/teamwork.jpeg new file mode 100644 index 0000000..eb9e753 Binary files /dev/null and b/public/images/home-page/teamwork.jpeg differ diff --git a/public/itemcard/itemcard.png b/public/itemcard/itemcard.png new file mode 100644 index 0000000..b4cc565 Binary files /dev/null and b/public/itemcard/itemcard.png differ diff --git a/public/partners/logo1.png b/public/partners/logo1.png new file mode 100644 index 0000000..2208c2b Binary files /dev/null and b/public/partners/logo1.png differ diff --git a/src/components/articlecard/ArticleCard.jsx b/src/components/articlecard/ArticleCard.jsx index c7c19c1..83bb5c7 100644 --- a/src/components/articlecard/ArticleCard.jsx +++ b/src/components/articlecard/ArticleCard.jsx @@ -16,7 +16,7 @@ const ArticleCard = ({ textOnleft = false, }) => { return ( -
+
{ - return ( -
-
- hero image -
-

{description}

-
- -
-
-
-
- ); -}; - -export default HeroSection; diff --git a/src/components/homepage/BrowseSection.jsx b/src/components/homepage/BrowseSection.jsx new file mode 100644 index 0000000..e2ac27b --- /dev/null +++ b/src/components/homepage/BrowseSection.jsx @@ -0,0 +1,92 @@ +import React from "react"; + +import Button from "../button/Button"; + +function BrowseSection() { + return ( +
+
+
+
+
+ product + +
+
+

+ Elevate Your Space ! +

+

+ Lorem ipsum dolor sit amet, consectetur + adipiscing elit. Vestibulum ornare + vestibulum mollis. Nam vitae augue + purus. Integer ac accumsan nunc. +

+ +
+
+
+
+
+
+
+
+ product + +
+
+

+ Student Electronic Collection +

+ +
+
+
+
+
+
+ product + +
+
+

+ Summer Travel Collection +

+ +
+
+
+
+
+
+
+
+
+ ); +} + +export default BrowseSection; diff --git a/src/components/homepage/CompaniesSection.jsx b/src/components/homepage/CompaniesSection.jsx new file mode 100644 index 0000000..2c3d9e7 --- /dev/null +++ b/src/components/homepage/CompaniesSection.jsx @@ -0,0 +1,45 @@ +import React from "react"; + +function CompaniesSection() { + return ( +
+
+ Trusted by 6+ customers + worldwide +
+ +
+ Recoded logo + Recoded logo + + Recoded logo + + Recoded logo + + Recoded logo +
+
+ ); +} + +export default CompaniesSection; diff --git a/src/components/homepage/HeroSection.jsx b/src/components/homepage/HeroSection.jsx new file mode 100644 index 0000000..a3a3212 --- /dev/null +++ b/src/components/homepage/HeroSection.jsx @@ -0,0 +1,47 @@ +import Image from "next/image"; + +import Button from "../button/Button"; + +/** + * + * @returns this is awsome + */ + +const HeroSection = () => { + return ( +
+
+
+
+

+ Share for the world better life +

+ +

+ Discover the Ultimate Student Marketplace: Transform + Your Campus Experience with Sharing, Donating, + Swapping, Selling, and Buying – Your One-Stop Shop + for Campus Living +

+
+ + +
+
+ +
+ Image +
+
+
+
+ ); +}; + +export default HeroSection; diff --git a/src/components/homepage/SecondHeroSec.jsx b/src/components/homepage/SecondHeroSec.jsx new file mode 100644 index 0000000..355c85e --- /dev/null +++ b/src/components/homepage/SecondHeroSec.jsx @@ -0,0 +1,104 @@ +import Image from "next/image"; + +const SecondHeroSection = ({ children }) => { + return ( +
+
+
+
+ Image +
+ +
+

+ You can help lots of people by
+ donating +

+ +
+
+
+ icon +
+ +

+ 10000+ +

+ +

+ Fundraising campaign in
+ all time +

+
+ +
+
+ icon +
+ +

+ +120k items +

+ +

+ Raised and counting
+ donations in all time +

+
+
+ +
+
+
+ icon +
+ +

+ 1200+ +

+ +

+ Our volunteer around the
+ world +

+
+ +
+
+ icon +
+ +

+ 98% +

+ +

+ Positive review from
+ public +

+
+
+
+
+
+
+ ); +}; + +export default SecondHeroSection; diff --git a/src/components/homepage/ValueSection.jsx b/src/components/homepage/ValueSection.jsx new file mode 100644 index 0000000..aef4141 --- /dev/null +++ b/src/components/homepage/ValueSection.jsx @@ -0,0 +1,64 @@ +import React from "react"; + +const featuresTab = [ + { + title: "Sharing", + description: "Share your items with others", + img: "/images/home-page/hands.png", + }, + { + title: "Swapping", + description: "Swap your items with others", + img: "/images/home-page/focus-group.png", + }, + { + title: "Selling", + description: "Sell your items with others", + img: "/images/home-page/help.png", + }, +]; + +function ValueSection() { + return ( +
+
+

+ Our Aim +

+ +

+ We believe we can do more
+ togather +

+ +
+ {featuresTab.map((feature, index) => { + return ; + })} +
+
+
+ ); +} + +const Feature = ({ title, description, img }) => { + return ( +
+
+
+ {title} +
+
+ +

+ {title} +

+ +

+ {description} +

+
+ ); +}; + +export default ValueSection; diff --git a/src/components/itemcard/ItemCard.jsx b/src/components/itemcard/ItemCard.jsx index 741caf1..775d8ef 100644 --- a/src/components/itemcard/ItemCard.jsx +++ b/src/components/itemcard/ItemCard.jsx @@ -5,7 +5,7 @@ const ItemCard = ({ item }) => { const { id, title, description, location, imagesList } = item; return ( -
+
{ +const Card = ({ icon, title, description }) => { return (
{icon}

{title}

- {children} +

{description}

); diff --git a/src/components/secondherosection/SecondHeroSec.jsx b/src/components/secondherosection/SecondHeroSec.jsx deleted file mode 100644 index 729c57a..0000000 --- a/src/components/secondherosection/SecondHeroSec.jsx +++ /dev/null @@ -1,28 +0,0 @@ -import Image from "next/image"; - -const SecondHeroSection = ({ children }) => { - return ( -
- {/* Main Content */} -
- {/* Hero Image */} - hero image - - {/* Card Section */} -
-
- {children} -
-
-
-
- ); -}; - -export default SecondHeroSection; diff --git a/src/pages/index.jsx b/src/pages/index.jsx index 4de4471..0a3166a 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -1,16 +1,28 @@ +import Image from "next/image"; import Link from "next/link"; import { useTranslation } from "next-i18next"; import { serverSideTranslations } from "next-i18next/serverSideTranslations"; -import * as React from "react"; -import Layout from "@/layout/Layout"; +import { getAllPosts } from "@/lib/blogApi"; +import { getAllItems } from "@/lib/firebase/firestoreFunctions"; -export default function HomePage() { +import ArticleCard from "@/components/articlecard/ArticleCard"; +import CategoryCard from "@/components/categorycard/CategoryCard"; +import BrowseSection from "@/components/homepage/BrowseSection"; +import CompaniesSection from "@/components/homepage/CompaniesSection"; +import HeroSection from "@/components/homepage/HeroSection"; +import SecondHeroSection from "@/components/homepage/SecondHeroSec"; +import ValueSection from "@/components/homepage/ValueSection"; +import ItemCard from "@/components/itemcard/ItemCard"; + +import { categories } from "@/constants"; + +const HomePage = ({ allPosts, items }) => { const { t } = useTranslation("common"); return ( <> -

{t("test")}

+ {/*

{t("test")}

English @@ -18,16 +30,66 @@ export default function HomePage() { العربية + +
*/} + + + +
+

+ Browse by category:{" "} +

+
+ {categories.map((category) => { + return ; + })} +
+
+

Top items:

+
+ {items.map((item) => ( + + ))}
+ + + + +

+ Blog +

+ {allPosts.map((post, index) => ( +
+ +
+ ))} ); -} +}; + +export default HomePage; -export async function getStaticProps({ locale }) { +export const getStaticProps = async ({ locale }) => { + let items = await getAllItems(); + items = JSON.parse(JSON.stringify(items)); + const allPosts = getAllPosts([ + "title", + "description", + "slug", + "coverImage", + ]); return { props: { ...(await serverSideTranslations(locale, ["common"])), - // Will be passed to the page component as props + allPosts, // Pass the allPosts prop to HomePage + items, }, }; -} +};