From dba2f60b750c696dbc70348f9ab729993273c0b2 Mon Sep 17 00:00:00 2001 From: Mastan Sayyad Date: Sat, 10 Aug 2024 14:16:37 +0530 Subject: [PATCH 1/5] Installed dependencies --- client/package-lock.json | 8 ++++---- client/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/package-lock.json b/client/package-lock.json index 924d957d..7330ba98 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -16,7 +16,7 @@ "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", - "axios": "^1.7.2", + "axios": "^1.7.3", "lottie-react": "^2.4.0", "react": "^18.3.1", "react-dom": "^18.3.1", @@ -5798,9 +5798,9 @@ } }, "node_modules/axios": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", - "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.3.tgz", + "integrity": "sha512-Ar7ND9pU99eJ9GpoGQKhKf58GpUOgnzuaB7ueNQ5BMi0p+LZ5oaEnfF999fAArcTIBwXTCHAmGcHOZJaWPq9Nw==", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", diff --git a/client/package.json b/client/package.json index 92942329..215e19ab 100644 --- a/client/package.json +++ b/client/package.json @@ -11,7 +11,7 @@ "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", - "axios": "^1.7.2", + "axios": "^1.7.3", "lottie-react": "^2.4.0", "react": "^18.3.1", "react-dom": "^18.3.1", From 951382fa74cc3f3dd0662b5413fb8a657526330c Mon Sep 17 00:00:00 2001 From: Mastan Sayyad Date: Sat, 10 Aug 2024 14:16:53 +0530 Subject: [PATCH 2/5] Create Contributors.jsx --- client/src/Pages/Contributors.jsx | 90 +++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 client/src/Pages/Contributors.jsx diff --git a/client/src/Pages/Contributors.jsx b/client/src/Pages/Contributors.jsx new file mode 100644 index 00000000..170d3232 --- /dev/null +++ b/client/src/Pages/Contributors.jsx @@ -0,0 +1,90 @@ +import React, { useEffect, useState } from 'react'; +import axios from 'axios'; +import './Contributors.css'; +import Preloader from '../Components/Preloader'; + +function Contributors() { + const [contributors, setContributors] = useState([]); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(null); // Added error state + + useEffect(() => { + async function fetchContributors() { + let allContributors = []; + let page = 1; + + try { + while (true) { + const response = await axios.get( + `https://api.github.com/repos/Trisha-tech/OnlineBookSales/contributors`, + { + params: { + per_page: 100, + page, + }, + } + ); + const data = response.data; + if (data.length === 0) { + break; + } + allContributors = [...allContributors, ...data]; + page++; + } + setContributors(allContributors); + } catch (error) { + console.error('Error fetching contributors:', error.message); + setError('Failed to load contributors. Please try again later.'); // Set error message + } finally { + setLoading(false); + } + } + fetchContributors(); + }, []); + + if (loading) { + return ; // Show preloader while loading + } + + if (error) { + return ( +
+

{error}

+
+ ); // Show error message if there's an error + } + + return ( +
+

Our Contributors

+
+ {contributors.length > 0 ? ( + contributors.map((contributor) => ( +
+ + {contributor.login} + +

{contributor.login}

+

+ Contributions: {contributor.contributions} +

+
+ )) + ) : ( +

No contributors found.

+ )} +
+
+ ); +} + +export default Contributors; From df73374b6c7d6b9a7e0fc0505b10ddc5c30fd729 Mon Sep 17 00:00:00 2001 From: Mastan Sayyad Date: Sat, 10 Aug 2024 14:17:07 +0530 Subject: [PATCH 3/5] Create Contributors.css --- client/src/Pages/Contributors.css | 141 ++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 client/src/Pages/Contributors.css diff --git a/client/src/Pages/Contributors.css b/client/src/Pages/Contributors.css new file mode 100644 index 00000000..d14d63c0 --- /dev/null +++ b/client/src/Pages/Contributors.css @@ -0,0 +1,141 @@ +.contributors-container { + width: 100%; + height: 100%; + padding-top: 2rem; + overflow: hidden; + + } + + .github-icon { + margin-right: 0.5rem; + vertical-align: middle; + fill: white; /* Adjust color as needed */ + } + + + .contributors-title { + margin-top: 0rem; + text-align: center; + color: #0077b6; + font-size: 2.5rem; + font-weight: bold; + margin-bottom: 2rem; + text-transform: uppercase; + } + + .contributors-grid { + display: flex; + flex-wrap: wrap; + justify-content: center; + gap: 2rem; + margin-bottom: 4rem; + } + + .contributor-card { + position: relative; + width: 100%; + max-width: 25%; + display: flex; + flex-direction: column; + align-items: center; + background-color: rgb(0,0,85); + border: 1px solid #6969ff; + border-radius: 0.5rem; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + padding: 1rem; + overflow: hidden; + transition: transform 0.4s ease, box-shadow 0.3s ease; + } + + .contributor-card:hover { + transform: scale(1.05); + box-shadow: 0 4px 6px rgba(5, 205, 208, 0.752); + } + + .contributor-card:hover p { + text-shadow: 1px 1px 2px rgb(0, 225, 255), 0 0 0.2em rgb(0, 191, 255), 0 0 0.8em rgb(135, 206, 235); + color: rgb(0, 0, 0); + font-weight: 500; + } + + .contributor-card:hover h2 { + text-shadow: 1px 1px 2px rgba(237, 9, 176, 0.926), 0 0 0.2em rgb(0, 191, 255), 0 0 0.8em rgb(135, 206, 235); + color: white; + font-size: 1.04rem; + font-weight: 600; + text-decoration: wavy; + } + + .contributor-card:hover .contributor-avatar { + border: 3.5px solid #89e6f0; + width: 5.2rem; + box-shadow: -2px 4px 10px 1px rgba(1, 41, 218, 0.75); + height: 5.2rem; + } + + .contributor-card::before { + content: ''; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: linear-gradient(152deg, #0077b6 50%, #023e8a 50%); + transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out; + transform: translate(-100%, -100%); + opacity: 0; + z-index: -1; + } + + .contributor-card:hover::before { + transform: translate(0, 0); + opacity: 1; + } + + + .contributor-link { + display: block; + } + + .contributor-avatar { + width: 5rem; + height: 5rem; + border-radius: 50%; + object-fit: cover; + margin-bottom: 1rem; + border: 2px solid #00b4d8; + transition: border 0.4s ease-in-out, height 0.4s ease-in-out, width 0.4s ease-in-out, box-shadow 0.3s ease-in-out; + } + + + .contributor-name { + font-size: 1rem; + font-weight: 600; + color: #f3f4f6; + margin-bottom: 0.5rem; + transition: text-shadow 0.4s ease-in-out, font-size 0.5s ease-in-out, text-decoration 0.4s ease-in-out; + } + + .contributor-contributions { + color: #d1d5db; + transition: text-shadow 0.4s ease-in-out; + } + + /* Media Queries for Responsiveness */ + @media (max-width: 1200px) { + .contributor-card { + max-width: 33.333%; + } + } + + @media (max-width: 992px) { + .contributor-card { + max-width: 50%; + } + } + + @media (max-width: 768px) { + .contributor-card { + max-width: 97%; + } + } \ No newline at end of file From a5a49cb71994fba439628bb48576bc81bba3a833 Mon Sep 17 00:00:00 2001 From: Mastan Sayyad Date: Sat, 10 Aug 2024 14:17:17 +0530 Subject: [PATCH 4/5] Update Footer.jsx --- client/src/Components/Footer/Footer.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/src/Components/Footer/Footer.jsx b/client/src/Components/Footer/Footer.jsx index 5792954f..9407cc08 100644 --- a/client/src/Components/Footer/Footer.jsx +++ b/client/src/Components/Footer/Footer.jsx @@ -15,6 +15,8 @@ function Footer() {
  • About us
  • Careers
  • Gift Cards
  • +
  • Our Contributors
  • +
    From 8cf4666480f8e7ded47aed6a88bf66b1eab8d25f Mon Sep 17 00:00:00 2001 From: Mastan Sayyad Date: Sat, 10 Aug 2024 14:17:27 +0530 Subject: [PATCH 5/5] Update App.js --- client/src/App.js | 72 +++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/client/src/App.js b/client/src/App.js index d10e3f38..b43f9a4c 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -1,7 +1,7 @@ - -import "./App.css"; -// import {Outlet} from "react-router-dom"; import React, { useState, useEffect } from 'react'; +import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; +import './App.css'; +import './Animations.css'; import { Navbar, Footer } from './Components/index.js'; import { ProfilePage, Product } from './Components/index'; import LoginPage from './Pages/LoginPage.jsx'; @@ -11,15 +11,14 @@ import Orders from './Pages/Orders.jsx'; import Wishlist from './Pages/Wishlist.jsx'; import HomePage from './Pages/Home.jsx'; import Shop from "./Pages/Shop.jsx"; -import { Toast } from "./Toast/Toast.js"; import Contact from "./Pages/Contact.jsx"; import PrivacyPolicy from "./Pages/PrivacyPolicy.jsx"; -import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; -import './Animations.css'; import FAQ from "./Pages/Faq.jsx"; import AboutUs from "./Pages/AboutUs.jsx"; import { OrderList } from './Pages/Orders.jsx'; +import Contributors from "./Pages/Contributors.jsx"; import Preloader from "./Components/Preloader.jsx"; +import { Toast } from "./Toast/Toast.js"; function App() { const [darkMode, setDarkMode] = useState(false); @@ -29,44 +28,43 @@ function App() { }; useEffect(() => { - if (darkMode) { - document.body.classList.add("dark") - } else { - document.body.classList.remove("dark") - } + document.body.classList.toggle("dark", darkMode); }, [darkMode]); const appStyle = { backgroundColor: darkMode ? '#333' : '#f4f4f4', - // borderRadius: '8px', }; return ( - <> - -
    - - - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - }/> - }/> - }/> - - -
    - -
    -
    - + +
    + + + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> {/* Fallback route */} + + +
    + {/* Ensure Preloader is correctly styled */} +
    +
    ); } -export default App; \ No newline at end of file +function NotFound() { + return

    404 Not Found

    ; +} + +export default App;