Limit render to 1 on About page
This commit is contained in:
parent
4505cc6c62
commit
b6ca737c97
|
|
@ -45,7 +45,7 @@ class About extends React.Component {
|
||||||
|
|
||||||
<Card title="Github" image="/img/github.webp" link="/github">
|
<Card title="Github" image="/img/github.webp" link="/github">
|
||||||
You can access a list of github repositories that I've created directly on this site.
|
You can access a list of github repositories that I've created directly on this site.
|
||||||
<GithubRepos style={{width: "50vw"}} username="RaspberryProgramming"/>
|
<GithubRepos style={{width: "50vw"}} username="RaspberryProgramming" single/>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,6 @@
|
||||||
font-size:xx-large;
|
font-size:xx-large;
|
||||||
margin-right: 2rem;
|
margin-right: 2rem;
|
||||||
margin-top: 2rem;
|
margin-top: 2rem;
|
||||||
max-height: 80vh;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.card img {
|
.card img {
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,9 @@ class GithubRepos extends React.Component {
|
||||||
|
|
||||||
if (this.props.repos.length > 0) {
|
if (this.props.repos.length > 0) {
|
||||||
// Render each repo
|
// Render each repo
|
||||||
const render = this.props.repos.map((repo) =>{
|
let repos = this.props.single ? [this.props.repos[0]] : this.props.repos
|
||||||
|
|
||||||
|
const render = repos.map((repo) =>{
|
||||||
let updated = (new Date (repo.updated_at)).toLocaleString();
|
let updated = (new Date (repo.updated_at)).toLocaleString();
|
||||||
let created = (new Date (repo.created_at)).toLocaleString();
|
let created = (new Date (repo.created_at)).toLocaleString();
|
||||||
|
|
||||||
|
|
@ -104,6 +106,7 @@ class GithubRepos extends React.Component {
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (<div>{this.renderRepos()}</div>);
|
return (<div>{this.renderRepos()}</div>);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue