From 6544d33fd020228fe0c6ca22defb3ff8cd236da0 Mon Sep 17 00:00:00 2001 From: pani2004 Date: Tue, 16 Jul 2024 13:08:09 +0530 Subject: [PATCH] Added the contributors page --- src/App.js | 2 ++ src/components/Footer.jsx | 3 ++ src/pages/Contributors.jsx | 58 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 src/pages/Contributors.jsx diff --git a/src/App.js b/src/App.js index 1f6df9f..da7b1d9 100644 --- a/src/App.js +++ b/src/App.js @@ -17,6 +17,7 @@ import { ThemeProvider } from "./themeContext"; import ContactUs from "./pages/ContactUs"; import EditProfile from "./pages/EditProfile"; import OtpVerify from "./pages/OtpVerify"; +import Contributors from "./pages/Contributors"; const Layout = ({ children }) => { return ( @@ -54,6 +55,7 @@ function App() { } /> } /> } /> + }/> {token ? ( News +
  • + Our Contributors +
  • © 2024-2025 Foodies™. All Rights Reserved. diff --git a/src/pages/Contributors.jsx b/src/pages/Contributors.jsx new file mode 100644 index 0000000..7c75672 --- /dev/null +++ b/src/pages/Contributors.jsx @@ -0,0 +1,58 @@ +import React, { useEffect, useState } from 'react'; +import axios from 'axios'; +import Navbar from '../components/Navbar'; +import Footer from '../components/Footer'; +function Contributors() { + const [contributors, setContributors] = useState([]); + useEffect(() => { + async function Contributors() { + try { + const response = await axios.get( + 'https://api.github.com/repos/VanshKing30/FoodiesWeb/contributors' + ); + setContributors(response.data); + } catch (error) { + console.error('Error in fetching contributors:', error); + } + } + Contributors(); + }, []); + return ( +
    + +

    + Contributors +

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

    + {contributor.login} +

    +

    + Contributions: {contributor.contributions} +

    +
    + ))} +
    +
    + ); +} + +export default Contributors; \ No newline at end of file