mirror of
https://github.com/NohamR/gitprofile.git
synced 2026-05-25 20:00:25 +00:00
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:
@@ -66,9 +66,14 @@ const GitProfile = ({ config }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
setProfile(profileData);
|
setProfile(profileData);
|
||||||
|
return data;
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then((userData) => {
|
||||||
let excludeRepo = ``;
|
let excludeRepo = ``;
|
||||||
|
if (userData.public_repos === 0) {
|
||||||
|
setRepo([]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
sanitizedConfig.github.exclude.projects.forEach((project) => {
|
sanitizedConfig.github.exclude.projects.forEach((project) => {
|
||||||
excludeRepo += `+-repo:${sanitizedConfig.github.username}/${project}`;
|
excludeRepo += `+-repo:${sanitizedConfig.github.username}/${project}`;
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ import PropTypes from 'prop-types';
|
|||||||
import { ga, languageColor, skeleton } from '../../helpers/utils';
|
import { ga, languageColor, skeleton } from '../../helpers/utils';
|
||||||
|
|
||||||
const Project = ({ repo, loading, github, googleAnalytics }) => {
|
const Project = ({ repo, loading, github, googleAnalytics }) => {
|
||||||
|
if (!loading && Array.isArray(repo) && repo.length === 0) {
|
||||||
|
return <></>;
|
||||||
|
}
|
||||||
|
|
||||||
const renderSkeleton = () => {
|
const renderSkeleton = () => {
|
||||||
let array = [];
|
let array = [];
|
||||||
for (let index = 0; index < github.limit; index++) {
|
for (let index = 0; index < github.limit; index++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user