Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/components/Home/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,27 @@

.cards {
margin: 3.5rem 0;
}
.grid-container {
display: grid;
grid-template-columns: auto auto auto auto;
gap: 10px;
justify-content: space-between;
align-items: center
}
.item1 {
grid-column: 1 / 4;

}
@media only screen and (max-width: 600px) {
.grid-container {
display: flex;
flex-direction: column;
justify-content:center;
align-items: center;
}
.item1 {
text-align: center;

}
}
75 changes: 45 additions & 30 deletions src/components/Home/index.jsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,49 @@
import React, { useEffect, useState } from 'react'
import Repos from '../../repos.json'
import './index.css'
import RepoCard from '../../styled-components/RepoCard'
import PrinmaryButton from '../../styled-components/Buttons/primary'
import React, { useEffect, useState } from "react";
import Repos from "../../repos.json";
import "./index.css";
import RepoCard from "../../styled-components/RepoCard";
import PrinmaryButton from "../../styled-components/Buttons/primary";

function Home() {
const [repos,setRepos] = useState([])

useEffect(() => {
if(Repos.repos){
setRepos(Repos.repos)
}
}, [])

return (
<div>
Contribute now on any one of these and get your profile listed in the contributors section
<span style={{float:'right'}}>
<PrinmaryButton link={'https://reactjs.org/'} text={"Learn more about React here"} external={false}/>
</span>

<div className="cards text-center">
{
repos.map((repo)=>{
return <RepoCard key={repo.id} title={repo.title} body={repo.body} btnLink={repo.redirectTo} btnText={"Contribute"} />
})
}
</div>
</div>
)
const [repos, setRepos] = useState([]);

useEffect(() => {
if (Repos.repos) {
setRepos(Repos.repos);
}
}, []);

return (
<div>
<div className="grid-container">
<div className="item1">
Contribute now on any one of these and get your profile listed in the
contributors section
</div>
<div className="item2">
<PrinmaryButton
link={"https://reactjs.org/"}
text={"Learn more about React here"}
external={false}
/>
</div>
</div>

<div className="cards text-center">
{repos.map((repo) => {
return (
<RepoCard
key={repo.id}
title={repo.title}
body={repo.body}
btnLink={repo.redirectTo}
btnText={"Contribute"}
/>
);
})}
</div>
</div>
);
}

export default Home
export default Home;