From bdce1be6d68b082cbf8f0bf916574f8c02d052d4 Mon Sep 17 00:00:00 2001 From: Wonjae Choi Date: Wed, 3 Apr 2024 00:59:24 +0900 Subject: [PATCH] refactor: Refactor data into separate json file --- app/page.js | 134 +--------------------------------------- data/home/sections.json | 124 +++++++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+), 132 deletions(-) create mode 100644 data/home/sections.json diff --git a/app/page.js b/app/page.js index cacb728..c1a657b 100644 --- a/app/page.js +++ b/app/page.js @@ -3,6 +3,7 @@ import React from 'react'; import MagicBookButton from '@/components/MagicBookButton'; import MainWrapper from '@/components/MainWrapper'; +import sections from '@/data/home/sections.json'; function LinkSection(props) { const { title, array, color, children } = props; @@ -64,138 +65,7 @@ function LinkSection(props) { } export default function HomePage() { - let profile = [ - { - name: 'About', - icon: 'fa-solid fa-user-circle', - link: '/about', - target: '', - }, - { - name: '\u00A0\u00A0Curriculum Vitae', - icon: 'fa-solid fa-file-alt', - link: 'CV_Wonjae-Choi.pdf', - target: '_blank', - }, - { - name: 'Projects', - icon: 'fa-solid fa-project-diagram', - link: '/wip', - target: '', - }, - { - name: 'Honors', - icon: 'fa-solid fa-award', - link: '/wip', - target: '', - }, - { - name: 'Skills', - icon: 'fa-solid fa-tools', - link: '/wip', - target: '', - }, - { - name: 'Interests', - icon: 'fa-solid fa-search', - link: '/wip', - target: '', - }, - ]; - - let academia = [ - { - name: 'All', - icon: 'fa-solid fa-book-open', - link: '/academia', - target: '', - }, - { - name: 'Blockchain', - icon: 'fa-solid fa-cube', - link: '/academia/blockchain', - target: '', - }, - { - name: '\u00A0\u00A0Computer Science', - icon: 'fa-solid fa-laptop-code', - link: '/academia/computer-science', - target: '', - }, - { - name: 'Etc', - icon: 'fa-solid fa-ellipsis-h', - link: '/academia/etc', - target: '', - }, - ]; - - let personal = [ - { - name: 'Myself', - icon: 'fa-solid fa-user', - link: '/wip', - target: '', - }, - { - name: 'WEB3', - icon: 'fa-solid fa-globe', - link: '/web3', - target: '', - }, - { name: 'Blog', icon: 'fa-solid fa-bookmark', link: '/blog', target: '' }, - { - name: 'Hobbies', - icon: 'fa-solid fa-gamepad', - link: '/wip', - target: '', - }, - { - name: 'Music', - icon: 'fa-solid fa-music', - link: 'https://youtube.com/playlist?list=PLAWDa1m7EkNUFIFaeKaXHpdO2zVUH6kg5&si=VF-dSpEbv6ncdPOJ', - target: '_blank', - }, - { - name: 'Newsletter', - icon: 'fa-regular fa-newspaper', - link: '/wip', - target: '_blank', - }, - ]; - - let socials = [ - { - name: 'LinkedIn', - icon: 'fa-brands fa-linkedin', - link: 'https://linkedin.com/wonj', - target: '_blank', - }, - { - name: 'Twitter', - icon: 'fa-brands fa-twitter', - link: 'https://twitter.com/0xwonj', - target: '_blank', - }, - { - name: 'GitHub', - icon: 'fa-brands fa-github', - link: 'https://github.com/wonj1012', - target: '_blank', - }, - { - name: 'Telegram', - icon: 'fa-brands fa-telegram', - link: 'https://t.me/wonj1012', - target: '_blank', - }, - { - name: 'Email', - icon: 'fa-solid fa-envelope', - link: 'mailto:choi@wonj.me', - target: '_blank', - }, - ]; + const { profile, academia, personal, socials } = sections; return ( diff --git a/data/home/sections.json b/data/home/sections.json new file mode 100644 index 0000000..f70930e --- /dev/null +++ b/data/home/sections.json @@ -0,0 +1,124 @@ +{ + "profile": [ + { + "name": "About", + "icon": "fa-solid fa-user-circle", + "link": "/about", + "target": "" + }, + { + "name": "\u00A0\u00A0Curriculum Vitae", + "icon": "fa-solid fa-file-alt", + "link": "CV_Wonjae-Choi.pdf", + "target": "_blank" + }, + { + "name": "Honors", + "icon": "fa-solid fa-award", + "link": "/wip", + "target": "" + }, + { + "name": "Skills", + "icon": "fa-solid fa-tools", + "link": "/wip", + "target": "" + } + ], + "academia": [ + { + "name": "Writings", + "icon": "fa-solid fa-pen-nib", + "link": "/academia", + "target": "" + }, + { + "name": "Projects", + "icon": "fa-solid fa-project-diagram", + "link": "/wip", + "target": "" + }, + { + "name": "Activities", + "icon": "fa-solid fa-users", + "link": "/wip", + "target": "" + }, + { + "name": "Interests", + "icon": "fa-solid fa-lightbulb", + "link": "/wip", + "target": "" + } + ], + "personal": [ + { + "name": "Myself", + "icon": "fa-solid fa-user", + "link": "/wip", + "target": "" + }, + { + "name": "WEB3", + "icon": "fa-solid fa-globe", + "link": "/web3", + "target": "" + }, + { + "name": "Blog", + "icon": "fa-solid fa-bookmark", + "link": "/blog", + "target": "" + }, + { + "name": "Hobbies", + "icon": "fa-solid fa-gamepad", + "link": "/wip", + "target": "" + }, + { + "name": "Music", + "icon": "fa-solid fa-music", + "link": "https://youtube.com/playlist?list=PLAWDa1m7EkNUFIFaeKaXHpdO2zVUH6kg5&si=VF-dSpEbv6ncdPOJ", + "target": "_blank" + }, + { + "name": "Newsletter", + "icon": "fa-regular fa-newspaper", + "link": "/wip", + "target": "_blank" + } + ], + "socials": [ + { + "name": "LinkedIn", + "icon": "fa-brands fa-linkedin", + "link": "https://linkedin.com/wonj", + "target": "_blank" + }, + { + "name": "Twitter", + "icon": "fa-brands fa-twitter", + "link": "https://twitter.com/0xwonj", + "target": "_blank" + }, + { + "name": "GitHub", + "icon": "fa-brands fa-github", + "link": "https://github.com/wonj1012", + "target": "_blank" + }, + { + "name": "Telegram", + "icon": "fa-brands fa-telegram", + "link": "https://t.me/wonj1012", + "target": "_blank" + }, + { + "name": "Email", + "icon": "fa-solid fa-envelope", + "link": "mailto:choi@wonj.me", + "target": "_blank" + } + ] +}