Skip to content

Commit

Permalink
Merge branch 'Avdhesh-Varshney:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
taneeshaa15 committed Jun 27, 2024
2 parents f615c5f + 6199760 commit ff10183
Show file tree
Hide file tree
Showing 11 changed files with 252 additions and 15 deletions.
91 changes: 91 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@mui/material": "^5.15.19",
"axios": "^1.7.2",
"bootstrap": "^5.3.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
7 changes: 5 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import ChanakyaNews from "./pages/resources/news/ChanakyaNews";
import Quiz from "./pages/resources/Quiz";
import ChanakyaQuiz from "./pages/resources/quiz/ChanakyaQuiz";

import Contributors from "./pages/Contributors";
import Contributors from "./pages/contributor/Contributors";
import ContributorDetail from "./pages/contributor/ContributorDetail";

import SignIn from "./pages/auth/SignIn";
import SignUp from "./pages/auth/SignUp";
Expand Down Expand Up @@ -58,7 +59,9 @@ function App() {
<Route exact path="/resources/quiz" element={<Quiz />} />
<Route exact path="/resources/quiz/chanakya" element={<ChanakyaQuiz setProgress={setProgress} />} />

<Route exact path="/contributor" element={<Contributors setProgress={setProgress} />} />
<Route exact path="/contributor" element={<Contributors setProgress={setProgress} />} >
</Route>
<Route path="/contributor/details" element={<ContributorDetail setProgress={setProgress}/>}> </Route>

{/* Authentication Pages */}
<Route exact path="/auth/SignIn" element={<SignIn />} />
Expand Down
Binary file added src/assets/CURSOR1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions src/css/About.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/* src/pages/About.css */
.about-container {
padding: 20px;
max-width: 800px;
margin: 0 auto;
background-color: #f9f9f9;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.about-container h1 {
text-align: center;
color: #874343;
font-family: 'Arial', sans-serif;
}

.about-content {
display: flex;
flex-direction: column;
align-items: center;
}

.about-image {
max-width: 100%;
height: auto;
border-radius: 8px;
margin-bottom: 20px;
}

.about-text {
text-align: justify;
color: #090909;
font-family: 'Georgia', serif;
font-size: x-large;
}

.about-text p {
margin-bottom: 15px;
line-height: 1.6;
}

.about-text ul {
list-style-type: disc;
padding-left: 20px;
}

.about-text ul li {
margin-bottom: 10px;
color: #780d0d;
}
3 changes: 3 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*{
cursor: url('/src/assets/CURSOR1.png'),auto;
}
26 changes: 22 additions & 4 deletions src/pages/About.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
import React from 'react'
// src/pages/About.jsx
import React from 'react';
import '../css/About.css';

const About = () => {
return (
<div>About</div>
)
}
<div className="about-container">
<h1> Aacharya Chanakya</h1>
<div className="about-content">
<img src="https://upload.wikimedia.org/wikipedia/commons/c/cd/Chanakya_artistic_depiction.jpg" alt="Chanakya" className="about-image" />
<div className="about-text">
<p>Chanakya, also known as Kautilya or Vishnugupta, was an ancient Indian teacher, philosopher, economist, jurist, and royal advisor. He is traditionally identified as the author of the ancient Indian political treatise, the Arthashastra.</p>
<p>Born in 350 BCE in India, Chanakya played a crucial role in the establishment of the Maurya Empire. He was the chief advisor to both Emperor Chandragupta and his son, Bindusara.</p>
<p>Chanakya's work is considered pioneering in the fields of political science and economics. His strategies and principles are still studied and revered in modern times.</p>
<p>His notable works include:</p>
<ul>
<li><b>Arthashastra:</b> A treatise on statecraft, economic policy, and military strategy.</li>
<li><b>Chanakya Niti:</b> A collection of aphorisms offering guidance on various aspects of life.</li>
</ul>
<p>Chanakya's wisdom and teachings continue to influence and inspire leaders and scholars around the world.</p>
</div>
</div>
</div>
);
};

export default About;
9 changes: 0 additions & 9 deletions src/pages/Contributors.jsx

This file was deleted.

21 changes: 21 additions & 0 deletions src/pages/contributor/ContributorCard.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react'
import { Link } from 'react-router-dom';

function ContributorCard(props) {
const { name, img } = props;
return (
<>


<div className="card mx-2 my-2" style={{width:"18rem"}}>
<img src={img} className="card-img-top" alt="..."/>
<div className="card-body ">
<h5 className="card-title">{name}</h5>
<Link to="/contributor/details" className="btn btn-primary">Get Details</Link>
</div>
</div>
</>
)
}

export default ContributorCard
11 changes: 11 additions & 0 deletions src/pages/contributor/ContributorDetail.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react'

function ContributorDetail() {
return (
<div className=''>
Contributor Detail Page
</div>
)
}

export default ContributorDetail
48 changes: 48 additions & 0 deletions src/pages/contributor/Contributors.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import React from 'react'
import { useEffect, useState } from 'react'
import axios from 'axios'
import ContributorCard from './ContributorCard'

const Contributors = () => {

const [data, setdata] = useState([])
useEffect(() => {
getContributor();
}, [])


const getContributor = async () => {
await axios.get('https://api.github.com/repos/Avdhesh-Varshney/chanakya-niti/contributors')
.then(function (response) {
setdata(response.data);
// console.log(response.data);
})
.catch(function (error) {
console.log(error);
})
}

return (
<>
<div className='d-flex flex-column contribution' style={{ overflowX: "hidden" }}>
<div className="fs-3" style={{fontWeight:"500"}}>
Our Contributors
</div>
<div className='d-flex flex-wrap justify-content-evenly'>

{
data.map((element) => {
return <div key={data.indexOf(element)}>
<ContributorCard name={element.login} img={element.avatar_url} />
</div>
})
}
</div>

</div>
</>
)
}

export default Contributors;

0 comments on commit ff10183

Please sign in to comment.