diff --git a/.eslintrc.js b/.eslintrc.js index 9030412..056c53d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -66,6 +66,7 @@ module.exports = { ], }, ], + "@next/next/no-img-element": "off", //#endregion //*======== Import Sort =========== }, globals: { diff --git a/README.md b/README.md index ff5087e..e430ff0 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,55 @@ -# Capstone project information +# Welcome to Let's Share -## Project information +## Project Description -- Project name: [Project name] -- Project description: [Project description] -- Technology used: Nextjs, TailwindCSS, i18next, Husky, Prettier, Eslint, Commitlinter (Conventional Commits) -- Team members: Member1, Member2, etc, -- Bootcamp: GIZ YE 2022 +Join Let's Share, where sharing is caring! Experience the magic of seamless connections as surplus food, stylish clothes, and cozy furniture find new homes through our user-friendly interface. Let's Share isn't just a platform; it's a front-end showcase, weaving together technology and warmth. Transform your daily exchanges into shared moments. Join us – where front-end innovation meets community connection! -## Installation +## Key Features -```shell -npm install -g commitizen // Installs commitizen -npx husky install // Installs Husky -chmod ug+x .husky/* // Gives husky executable extension -npm install // Installs the node modules -``` +Homepage +Sign in page +Sign up page +List of products page +Profile page +About us page +Blog page +Single blog page +Filter Products: Easily filter products by name, category, and price. +User Authentication: Create accounts, log in, and log out. +Product Details: View detailed descriptions of products. +Responsive Design: Ensure accessibility on various devices. -## Development process +## Technology Stack -- When commiting you will have to use `git cz` and then go through the process. Look at the first commit I made to know what that means. -- The translation process is done using the i18next library. There's an example in the index.js file of how this is done. Check this github project for more info on how to use the i18next library: [i18next](https://github.com/i18next/next-i18next) -- When writing commits, commitlinter library is used to make sure that your commits are consistent with the conventional commits. To learn more about it refer to the guidelines in Canvas or the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) site. -- The `layout` folder contains the components that will be used in the layout of pages, so components like the header and footer will be placed there. +Frontend: Next.js +Database: Firestore +Authentication: Firebase +Styling: CSS, Tailwind CSS -Good luck and happy coding :D +## Project Goals + +Share and reuse products like clothes and furniture amongst the community + +## Team Members + +Ismail Benlaredj : https://github.com/ismail-benlaredj +Darine Tag : https://github.com/darinetag +Hadj Said Bouras : https://github.com/Hadj-Said-Bouras +Mohamed Cheraitia : https://github.com/mohamed-cheraitia +Laid Benglia : https://github.com/LaidBengli +Sara Bagache : https://github.com/SaraBegache + +## Getting Started + +To run this project locally, follow these steps: + +creat a next.js file +Clone the repository: git clone https://github.com/202306-NEA-DZ-FEW/team-f +Navigate to the project directory: cd recoded-capstone +Install dependencies: npm install +Start the development server: npm run dev +Open your browser and visit http://localhost:3000 + +## Bootcamp + +Bootcamp: 202306-NEA-DZ-FEW diff --git a/public/images/Shop.png b/public/images/Shop.png new file mode 100644 index 0000000..958a0e0 Binary files /dev/null and b/public/images/Shop.png differ diff --git a/public/images/category_img/category_academic.webp b/public/images/category_img/category_academic.webp new file mode 100644 index 0000000..885deab Binary files /dev/null and b/public/images/category_img/category_academic.webp differ diff --git a/public/images/category_img/category_beauty.webp b/public/images/category_img/category_beauty.webp new file mode 100644 index 0000000..2bc35d6 Binary files /dev/null and b/public/images/category_img/category_beauty.webp differ diff --git a/public/images/category_img/category_clothes.webp b/public/images/category_img/category_clothes.webp new file mode 100644 index 0000000..a375f79 Binary files /dev/null and b/public/images/category_img/category_clothes.webp differ diff --git a/public/images/category_img/category_dorm.webp b/public/images/category_img/category_dorm.webp new file mode 100644 index 0000000..011864b Binary files /dev/null and b/public/images/category_img/category_dorm.webp differ diff --git a/public/images/category_img/category_electronics.webp b/public/images/category_img/category_electronics.webp new file mode 100644 index 0000000..32727df Binary files /dev/null and b/public/images/category_img/category_electronics.webp differ diff --git a/public/images/category_img/category_entertainment.webp b/public/images/category_img/category_entertainment.webp new file mode 100644 index 0000000..e5645b7 Binary files /dev/null and b/public/images/category_img/category_entertainment.webp differ diff --git a/public/images/category_img/category_other.webp b/public/images/category_img/category_other.webp new file mode 100644 index 0000000..da49503 Binary files /dev/null and b/public/images/category_img/category_other.webp differ diff --git a/public/secondherosec-icons/sec4.png b/public/secondherosec-icons/sec4.png new file mode 100644 index 0000000..df1833d Binary files /dev/null and b/public/secondherosec-icons/sec4.png differ diff --git a/public/secondherosec-icons/sec5.png b/public/secondherosec-icons/sec5.png new file mode 100644 index 0000000..b1d5b19 Binary files /dev/null and b/public/secondherosec-icons/sec5.png differ diff --git a/public/secondherosec-icons/sec6.png b/public/secondherosec-icons/sec6.png new file mode 100644 index 0000000..1eb7b7e Binary files /dev/null and b/public/secondherosec-icons/sec6.png differ diff --git a/public/secondherosec-icons/sec7.png b/public/secondherosec-icons/sec7.png new file mode 100644 index 0000000..ed5fd90 Binary files /dev/null and b/public/secondherosec-icons/sec7.png differ diff --git a/src/components/blogcard/BlogCard.jsx b/src/components/blogcard/BlogCard.jsx index b932f0b..b906d11 100644 --- a/src/components/blogcard/BlogCard.jsx +++ b/src/components/blogcard/BlogCard.jsx @@ -1,3 +1,4 @@ +import Image from "next/image"; const BlogCard = ({ blog }) => { return (
+ {title} +
Do you want to delete this item?
+- Lorem ipsum dolor sit amet consectetur, adipisicing - elit. Ullam, quia ad alias non saepe aliquid, totam, - aliqu perspiciatis optio doloribus debitis vero - voluptates esse. Voluptatum nihil nam fuga minima! quis - nostr exercitation ullamco laboris nisi ut aliquip ex ea - commodo consequat. -
+{description}
Log in with:
diff --git a/src/components/personalinfo/AddItem.jsx b/src/components/personalinfo/AddItem.jsx deleted file mode 100644 index 52030a6..0000000 --- a/src/components/personalinfo/AddItem.jsx +++ /dev/null @@ -1,23 +0,0 @@ -import Image from "next/image"; - -const AddItem = () => { - return ( -Product title
- - -Location
-+ Change your profile picture +
+ > + ); +} + +export default AvatarUploadImage; diff --git a/src/components/profile/EditProfile.jsx b/src/components/profile/EditProfile.jsx new file mode 100644 index 0000000..d11ab97 --- /dev/null +++ b/src/components/profile/EditProfile.jsx @@ -0,0 +1,168 @@ +import clsx from "clsx"; +import { useState } from "react"; +import { useForm } from "react-hook-form"; +import { AiOutlineClose } from "react-icons/ai"; + +import { getDocData, updateDocData } from "@/lib/firebase/firestoreFunctions"; +import UseUploadImage from "@/lib/hooks/useUploadImage"; + +import Button from "@/components/button/Button"; +import Input from "@/components/input"; + +import { useAuth } from "@/context/AuthContext"; + +import AvatarUploadImage from "./AvatarUploadImage"; + +const inputs = [ + { + name: "name", + type: "text", + labelText: "Your Name", + placeholder: "Your Name", + requiredMessage: "Enter a name please", + validation: { + maxLength: { + value: 30, + message: "30 character max", + }, + }, + }, + { + name: "publicEmail", + type: "email", + labelText: "Your Public Email", + placeholder: "Enter Email", + requiredMessage: false, + validation: {}, + }, + { + name: "publicPhoneNumber", + type: "number", + labelText: "Phone Number", + placeholder: "Phone Number", + requiredMessage: false, + validation: { + maxLength: { + value: 11, + message: "Enter a valid number", + }, + minLength: { + value: 9, + message: "Enter a valid number", + }, + }, + }, + { + name: "bio", + type: "text", + labelText: "Bio", + placeholder: "Bio", + requiredMessage: false, + validation: { + maxLength: { + value: 50, + message: "Max 50 characters", + }, + }, + }, + { + name: "location", + type: "text", + labelText: "Location", + placeholder: "Location", + requiredMessage: false, + validation: {}, + }, +]; + +function EditProfile({ + setEditProfile, + setUserData, + name, + avatarUrl, + bio, + publicEmail, + publicPhoneNumber, + location, +}) { + const { currentUser } = useAuth(); + const [uploadFile] = UseUploadImage(); + const [file, setFile] = useState(); + const { + register, + handleSubmit, + formState: { errors, isSubmitting }, + } = useForm({ + defaultValues: { + name, + avatarUrl, + bio, + publicEmail, + publicPhoneNumber, + location, + }, + }); + + const updateProfile = async (data) => { + if (file) { + const downloadUrl = await uploadFile(file); + data.avatarUrl = downloadUrl; + } + updateDocData("users", currentUser.uid, { + ...data, + }); + setUserData({ ...data }); + setEditProfile(false); + }; + + return ( ++ {`${(bio && bio) || "Add Bio"}`} +
+