diff --git a/src/App.js b/src/App.js
index b555309..d0e8346 100644
--- a/src/App.js
+++ b/src/App.js
@@ -30,7 +30,7 @@ function App() {
}, [theme])
const loadData = useCallback(() => {
- axios.get(`https://api.github.com/users/${config.githubUsername}`)
+ axios.get(`https://api.github.com/users/${config.github.username}`)
.then(response => {
let data = response.data;
@@ -45,7 +45,21 @@ function App() {
dispatch(setProfile(profileData));
})
.then(() => {
- axios.get(`https://api.github.com/search/repositories?q=user:${config.githubUsername}+&s=stars&type=Repositories`)
+ let excludeRepo = ``;
+
+ config.github.exclude.projects.forEach(project => {
+ excludeRepo += `+-repo:${config.github.username}/${project}`;
+ });
+
+ let query = `user:${config.github.username}+fork:${!config.github.exclude.forks}${excludeRepo}`;
+
+ let url = `https://api.github.com/search/repositories?q=${query}&sort=${config.github.sortBy}&per_page=${config.github.limit}&type=Repositories`;
+
+ axios.get(url, {
+ headers: {
+ 'Content-Type': 'application/vnd.github.v3+json'
+ }
+ })
.then(response => {
let data = response.data;
@@ -129,36 +143,38 @@ function App() {
}
/>
) : (
-
-
-
-
- {
- !config.themeConfig.disableSwitch && (
-
- )
- }
-
-
-
-
-
+
+
+
+
+
+ {
+ !config.themeConfig.disableSwitch && (
+
+ )
+ }
+
+
+
+
+
+
-
-
-
+ {/* DO NOT REMOVE/MODIFY THE FOOTER */}
+
+
)
}
- {/* DO NOT REMOVE/MODIFY THE FOOTER */}
-
);
diff --git a/src/components/Project.js b/src/components/Project.js
index 42799db..a74f74e 100644
--- a/src/components/Project.js
+++ b/src/components/Project.js
@@ -1,18 +1,16 @@
import { Fragment } from "react";
import { useSelector } from "react-redux";
import { languageColor, skeleton } from "../helpers/utils";
-import { AiFillStar, AiOutlineFork } from 'react-icons/ai';
+import { AiOutlineStar, AiOutlineFork } from 'react-icons/ai';
import config from "../config";
-const LIMIT = 8;
-
const Project = () => {
const loading = useSelector(state => state.loading);
const repo = useSelector(state => state.repo);
const renderSkeleton = () => {
let array = [];
- for (let index = 0; index < LIMIT; index++) {
+ for (let index = 0; index < config.github.limit; index++) {
array.push((
@@ -53,8 +51,14 @@ const Project = () => {
}
const renderProjects = () => {
- return repo.slice(0, LIMIT).map((item, index) => (
-
+ return repo.map((item, index) => (
+ {
+ window.open(item.html_url, '_blank')
+ }}
+ >
@@ -72,11 +76,11 @@ const Project = () => {
-
+
{item.stargazers_count}
-
+
{item.forks_count}
@@ -88,7 +92,7 @@ const Project = () => {
-
+
));
}
@@ -112,7 +116,7 @@ const Project = () => {
{
loading ? skeleton({ width: 'w-10', height: 'h-5' }) : (