Merge pull request #220 from Revortni/hide-if-no-public-repo

Hide project section if no public github repo available for user
This commit is contained in:
Ariful Alam 2022-10-25 17:37:30 +06:00 committed by GitHub
commit 20cc39d7ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -66,9 +66,14 @@ const GitProfile = ({ config }) => {
};
setProfile(profileData);
return data;
})
.then(() => {
.then((userData) => {
let excludeRepo = ``;
if (userData.public_repos === 0) {
setRepo([]);
return;
}
sanitizedConfig.github.exclude.projects.forEach((project) => {
excludeRepo += `+-repo:${sanitizedConfig.github.username}/${project}`;

View File

@ -4,6 +4,10 @@ import PropTypes from 'prop-types';
import { ga, languageColor, skeleton } from '../../helpers/utils';
const Project = ({ repo, loading, github, googleAnalytics }) => {
if (!loading && Array.isArray(repo) && repo.length === 0) {
return <></>;
}
const renderSkeleton = () => {
let array = [];
for (let index = 0; index < github.limit; index++) {