diff --git a/src/App.js b/src/App.js index 0ac8ef0..887ce35 100644 --- a/src/App.js +++ b/src/App.js @@ -14,6 +14,7 @@ import Experience from "./components/Experience"; import Education from "./components/Education"; import Project from "./components/Project"; import { setRepo } from "./store/slices/repoSlice"; +import Blog from "./components/Blog"; function App() { const dispatch = useDispatch(); @@ -29,11 +30,10 @@ function App() { }, [theme]) useEffect(() => { - loadProfile(); - loadRepo(); + loadData(); }, []) - const loadProfile = () => { + const loadData = () => { axios.get(`https://api.github.com/users/${config.githubUsername}`) .then(response => { let data = response.data; @@ -49,6 +49,9 @@ function App() { dispatch(setProfile(profileData)); }) + .then(() => { + loadRepo(); + }) .catch((error) => { console.error('Error:', error); @@ -75,8 +78,6 @@ function App() { } const loadRepo = () => { - dispatch(setLoading(true)); - axios.get(`https://api.github.com/search/repositories?q=user:${config.githubUsername}+&s=stars&type=Repositories`) .then(response => { let data = response.data; @@ -96,10 +97,7 @@ function App() { } catch (error2) { console.error('Error:', error2); } - }) - .finally(() => { - dispatch(setLoading(false)); - });; + }); } return ( @@ -148,12 +146,12 @@ function App() {
+ +
- -
diff --git a/src/components/Blog.js b/src/components/Blog.js new file mode 100644 index 0000000..4866107 --- /dev/null +++ b/src/components/Blog.js @@ -0,0 +1,24 @@ +import { useSelector } from "react-redux"; +import { skeleton } from "../helpers/utils"; + +const { Fragment } = require("react") + +const Blog = () => { + const loading = useSelector(state => state.loading); + + return ( +
+
+
+
+
+ {loading ? skeleton({width: 'w-20', height: 'h-8'}) : 'Blog'} +
+
+
+
+
+ ) +} + +export default Blog; \ No newline at end of file diff --git a/src/components/Education.js b/src/components/Education.js index 5d90029..b3ccbff 100644 --- a/src/components/Education.js +++ b/src/components/Education.js @@ -10,13 +10,13 @@ const Education = () => { let array = []; for (let index = 0; index < 2; index++) { array.push(( -
  • +
  • -
    -
    +
    +
    {skeleton({ width: 'w-48', height: 'h-4', className: "mb-2" })}
    -
    +
    {skeleton({ width: 'w-32', height: 'h-4', className: "mb-2" })}
    @@ -35,7 +35,7 @@ const Education = () => { <> { (typeof config.education !== 'undefined' && config.education.length !== 0) && ( -
    +
    • @@ -48,13 +48,13 @@ const Education = () => { { loading ? renderSkeleton() : ( config.education.map((item, index) => ( -
    • +
    • -
      -
      +
      +
      {item.institution}
      -
      +
      {item.from} - {item.to}
      diff --git a/src/components/Experience.js b/src/components/Experience.js index 22f9a59..0f7dcf3 100644 --- a/src/components/Experience.js +++ b/src/components/Experience.js @@ -10,13 +10,13 @@ const Experience = () => { let array = []; for (let index = 0; index < 2; index++) { array.push(( -
    • +
    • -
      -
      +
      +
      {skeleton({ width: 'w-48', height: 'h-4', className: "mb-2" })}
      -
      +
      {skeleton({ width: 'w-32', height: 'h-4', className: "mb-2" })}
      @@ -35,7 +35,7 @@ const Experience = () => { <> { (typeof config.experiences !== 'undefined' && config.experiences.length !== 0) && ( -
      +
      • @@ -48,13 +48,13 @@ const Experience = () => { { loading ? renderSkeleton() : ( config.experiences.map((experience, index) => ( -
      • +
      • -
        -
        +
        +
        {experience.company}
        -
        +
        {experience.from} - {experience.to}
        diff --git a/src/components/Project.js b/src/components/Project.js index 2d26a72..353a1cd 100644 --- a/src/components/Project.js +++ b/src/components/Project.js @@ -14,11 +14,11 @@ const Project = () => { } else { return repo.slice(0, LIMIT).map((project, index) => ( -
        +
        - + {project.name}

        {project.description}

        @@ -36,8 +36,8 @@ const Project = () => { return (
        -
        -
        +
        + {/*
          @@ -48,7 +48,7 @@ const Project = () => { { loading ? skeleton({width: 'w-8', height: 'h-8'}) : ( - + ) @@ -58,8 +58,8 @@ const Project = () => {
        -
        -
        +
        */} +
        {renderProjects()}
        diff --git a/src/components/Skill.js b/src/components/Skill.js index b179773..11c616a 100644 --- a/src/components/Skill.js +++ b/src/components/Skill.js @@ -24,11 +24,11 @@ const Skill = () => { (typeof config.skills !== 'undefined' && config.skills.length !== 0) && (
        -
        +
        { loading ? renderSkeleton() : ( config.skills.map((skill, index) => ( -
        +
        {skill}
        )) diff --git a/src/components/ThemeChanger.js b/src/components/ThemeChanger.js index 41bf90f..6a930be 100644 --- a/src/components/ThemeChanger.js +++ b/src/components/ThemeChanger.js @@ -14,7 +14,7 @@ const ThemeChanger = () => { return (
        -
        +
        @@ -26,10 +26,10 @@ const ThemeChanger = () => {
        { loading ? skeleton({width: 'w-28', height: 'h-10'}) : ( - { config.themeConfig.themes.map((item, index) => ( - + )) } diff --git a/src/config.js b/src/config.js index e51c972..1adcb4f 100644 --- a/src/config.js +++ b/src/config.js @@ -8,7 +8,13 @@ module.exports = { 'Laravel', 'JavaScript', 'React.js', - 'Node.js' + 'Node.js', + 'Tailwind', + 'Antd', + 'CSS', + 'Git', + 'Mysql', + 'Jquery', ], experiences: [ {