From ca6e0b094680e03f1f41830c7e75d16b7c849e11 Mon Sep 17 00:00:00 2001 From: ardhptr21 Date: Wed, 17 Nov 2021 11:20:32 +0700 Subject: [PATCH] frontend: cleanup components folder --- frontend/src/App.js | 2 +- frontend/src/components/SkillItemDashboard.jsx | 4 ++-- .../src/components/{ => alerts}/AlertDanger.jsx | 0 .../src/components/{ => buttons}/ButtonAdd.jsx | 0 .../components/{ => buttons}/ButtonCancel.jsx | 0 .../components/{ => buttons}/ButtonDelete.jsx | 0 .../src/components/{ => buttons}/ButtonEdit.jsx | 0 .../src/components/{ => buttons}/ButtonFill.jsx | 0 .../src/components/{ => buttons}/ButtonForm.jsx | 2 +- .../components/{ => buttons}/ButtonOutline.jsx | 0 .../src/components/{ => cards}/CardProject.jsx | 0 .../src/components/{ => cards}/FeatureCard.jsx | 0 frontend/src/components/{ => forms}/Input.jsx | 0 .../src/components/{ => forms}/InputFile.jsx | 0 frontend/src/components/{ => forms}/Textarea.jsx | 0 .../src/components/{ => links}/LinkDropdown.jsx | 2 +- .../src/components/{ => links}/LinkSidebar.jsx | 4 ++-- .../src/components/{ => navigations}/Navbar.jsx | 6 +++--- .../src/components/{ => navigations}/Sidebar.jsx | 8 ++++---- .../{ => navigations}/ToggleSidebar.jsx | 0 .../components/{ => tables}/RowTableProject.jsx | 4 ++-- frontend/src/components/{ => tables}/Td.jsx | 0 frontend/src/components/{ => tables}/Th.jsx | 0 frontend/src/components/{ => tables}/Tr.jsx | 0 frontend/src/pages/Home.jsx | 4 ++-- frontend/src/pages/Login.jsx | 4 ++-- frontend/src/pages/Portfolio.jsx | 2 +- frontend/src/pages/Register.jsx | 4 ++-- frontend/src/pages/dashboard/Projects.jsx | 16 ++++++++-------- frontend/src/pages/dashboard/Skills.jsx | 8 ++++---- frontend/src/pages/dashboard/User.jsx | 10 +++++----- 31 files changed, 40 insertions(+), 40 deletions(-) rename frontend/src/components/{ => alerts}/AlertDanger.jsx (100%) rename frontend/src/components/{ => buttons}/ButtonAdd.jsx (100%) rename frontend/src/components/{ => buttons}/ButtonCancel.jsx (100%) rename frontend/src/components/{ => buttons}/ButtonDelete.jsx (100%) rename frontend/src/components/{ => buttons}/ButtonEdit.jsx (100%) rename frontend/src/components/{ => buttons}/ButtonFill.jsx (100%) rename frontend/src/components/{ => buttons}/ButtonForm.jsx (93%) rename frontend/src/components/{ => buttons}/ButtonOutline.jsx (100%) rename frontend/src/components/{ => cards}/CardProject.jsx (100%) rename frontend/src/components/{ => cards}/FeatureCard.jsx (100%) rename frontend/src/components/{ => forms}/Input.jsx (100%) rename frontend/src/components/{ => forms}/InputFile.jsx (100%) rename frontend/src/components/{ => forms}/Textarea.jsx (100%) rename frontend/src/components/{ => links}/LinkDropdown.jsx (87%) rename frontend/src/components/{ => links}/LinkSidebar.jsx (77%) rename frontend/src/components/{ => navigations}/Navbar.jsx (92%) rename frontend/src/components/{ => navigations}/Sidebar.jsx (95%) rename frontend/src/components/{ => navigations}/ToggleSidebar.jsx (100%) rename frontend/src/components/{ => tables}/RowTableProject.jsx (87%) rename frontend/src/components/{ => tables}/Td.jsx (100%) rename frontend/src/components/{ => tables}/Th.jsx (100%) rename frontend/src/components/{ => tables}/Tr.jsx (100%) diff --git a/frontend/src/App.js b/frontend/src/App.js index b9aabf3..4e22121 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -1,6 +1,6 @@ import { BrowserRouter as Router, Switch, Route } from "react-router-dom"; import { ToastContainer } from "react-toastify"; -import Navbar from "./components/Navbar"; +import Navbar from "./components/navigations/Navbar"; import routes from "./routes"; import "react-toastify/dist/ReactToastify.min.css"; diff --git a/frontend/src/components/SkillItemDashboard.jsx b/frontend/src/components/SkillItemDashboard.jsx index 53760ba..6bc6782 100644 --- a/frontend/src/components/SkillItemDashboard.jsx +++ b/frontend/src/components/SkillItemDashboard.jsx @@ -1,5 +1,5 @@ -import ButtonEdit from "../components/ButtonEdit"; -import ButtonDelete from "../components/ButtonDelete"; +import ButtonEdit from "../components/buttons/ButtonEdit"; +import ButtonDelete from "../components/buttons/ButtonDelete"; const SkillItemDashboard = ({ name, skillId, clickEdit, clickDelete }) => { return ( diff --git a/frontend/src/components/AlertDanger.jsx b/frontend/src/components/alerts/AlertDanger.jsx similarity index 100% rename from frontend/src/components/AlertDanger.jsx rename to frontend/src/components/alerts/AlertDanger.jsx diff --git a/frontend/src/components/ButtonAdd.jsx b/frontend/src/components/buttons/ButtonAdd.jsx similarity index 100% rename from frontend/src/components/ButtonAdd.jsx rename to frontend/src/components/buttons/ButtonAdd.jsx diff --git a/frontend/src/components/ButtonCancel.jsx b/frontend/src/components/buttons/ButtonCancel.jsx similarity index 100% rename from frontend/src/components/ButtonCancel.jsx rename to frontend/src/components/buttons/ButtonCancel.jsx diff --git a/frontend/src/components/ButtonDelete.jsx b/frontend/src/components/buttons/ButtonDelete.jsx similarity index 100% rename from frontend/src/components/ButtonDelete.jsx rename to frontend/src/components/buttons/ButtonDelete.jsx diff --git a/frontend/src/components/ButtonEdit.jsx b/frontend/src/components/buttons/ButtonEdit.jsx similarity index 100% rename from frontend/src/components/ButtonEdit.jsx rename to frontend/src/components/buttons/ButtonEdit.jsx diff --git a/frontend/src/components/ButtonFill.jsx b/frontend/src/components/buttons/ButtonFill.jsx similarity index 100% rename from frontend/src/components/ButtonFill.jsx rename to frontend/src/components/buttons/ButtonFill.jsx diff --git a/frontend/src/components/ButtonForm.jsx b/frontend/src/components/buttons/ButtonForm.jsx similarity index 93% rename from frontend/src/components/ButtonForm.jsx rename to frontend/src/components/buttons/ButtonForm.jsx index 1796152..daee0c9 100644 --- a/frontend/src/components/ButtonForm.jsx +++ b/frontend/src/components/buttons/ButtonForm.jsx @@ -1,5 +1,5 @@ import { useEffect } from "react"; -import LoadingBtnWhite from "./loading/LoadingBtnWhite"; +import LoadingBtnWhite from "../loading/LoadingBtnWhite"; const ButtonForm = ({ children, loading = false, ...props }) => { useEffect(() => { diff --git a/frontend/src/components/ButtonOutline.jsx b/frontend/src/components/buttons/ButtonOutline.jsx similarity index 100% rename from frontend/src/components/ButtonOutline.jsx rename to frontend/src/components/buttons/ButtonOutline.jsx diff --git a/frontend/src/components/CardProject.jsx b/frontend/src/components/cards/CardProject.jsx similarity index 100% rename from frontend/src/components/CardProject.jsx rename to frontend/src/components/cards/CardProject.jsx diff --git a/frontend/src/components/FeatureCard.jsx b/frontend/src/components/cards/FeatureCard.jsx similarity index 100% rename from frontend/src/components/FeatureCard.jsx rename to frontend/src/components/cards/FeatureCard.jsx diff --git a/frontend/src/components/Input.jsx b/frontend/src/components/forms/Input.jsx similarity index 100% rename from frontend/src/components/Input.jsx rename to frontend/src/components/forms/Input.jsx diff --git a/frontend/src/components/InputFile.jsx b/frontend/src/components/forms/InputFile.jsx similarity index 100% rename from frontend/src/components/InputFile.jsx rename to frontend/src/components/forms/InputFile.jsx diff --git a/frontend/src/components/Textarea.jsx b/frontend/src/components/forms/Textarea.jsx similarity index 100% rename from frontend/src/components/Textarea.jsx rename to frontend/src/components/forms/Textarea.jsx diff --git a/frontend/src/components/LinkDropdown.jsx b/frontend/src/components/links/LinkDropdown.jsx similarity index 87% rename from frontend/src/components/LinkDropdown.jsx rename to frontend/src/components/links/LinkDropdown.jsx index 76e6765..21cb8ef 100644 --- a/frontend/src/components/LinkDropdown.jsx +++ b/frontend/src/components/links/LinkDropdown.jsx @@ -1,4 +1,4 @@ -import getRouteName from "../utils/getRouteName"; +import getRouteName from "../../utils/getRouteName"; import { Link } from "react-router-dom"; const LinkDropdown = ({ route, text, children, params }) => { diff --git a/frontend/src/components/LinkSidebar.jsx b/frontend/src/components/links/LinkSidebar.jsx similarity index 77% rename from frontend/src/components/LinkSidebar.jsx rename to frontend/src/components/links/LinkSidebar.jsx index f967f6e..680d1a5 100644 --- a/frontend/src/components/LinkSidebar.jsx +++ b/frontend/src/components/links/LinkSidebar.jsx @@ -1,6 +1,6 @@ import { Link } from "react-router-dom"; -import getActiveURL from "../utils/getActiveURL"; -import getRoutesName from "../utils/getRouteName"; +import getActiveURL from "../../utils/getActiveURL"; +import getRoutesName from "../../utils/getRouteName"; const LinkSidebar = ({ children, text, route, params, click }) => { return ( diff --git a/frontend/src/components/Navbar.jsx b/frontend/src/components/navigations/Navbar.jsx similarity index 92% rename from frontend/src/components/Navbar.jsx rename to frontend/src/components/navigations/Navbar.jsx index 89fe879..adbc79a 100644 --- a/frontend/src/components/Navbar.jsx +++ b/frontend/src/components/navigations/Navbar.jsx @@ -1,7 +1,7 @@ import { Link } from "react-router-dom"; -import Logo from "../assets/image/Logo.svg"; -import ButtonFill from "./ButtonFill"; -import getRoutesName from "../utils/getRouteName"; +import Logo from "../../assets/image/Logo.svg"; +import ButtonFill from "../buttons/ButtonFill"; +import getRoutesName from "../../utils/getRouteName"; import { useState } from "react"; const Navbar = () => { diff --git a/frontend/src/components/Sidebar.jsx b/frontend/src/components/navigations/Sidebar.jsx similarity index 95% rename from frontend/src/components/Sidebar.jsx rename to frontend/src/components/navigations/Sidebar.jsx index 43d440e..9308c5b 100644 --- a/frontend/src/components/Sidebar.jsx +++ b/frontend/src/components/navigations/Sidebar.jsx @@ -1,9 +1,9 @@ import { useState } from "react"; import { Link, Redirect } from "react-router-dom"; -import LogoWhite from "../assets/image/LogoWhite.svg"; -import useAxios from "../hooks/useAxios"; -import getUserInfo from "../utils/getUserInfo"; -import LinkSidebar from "./LinkSidebar"; +import LogoWhite from "../../assets/image/LogoWhite.svg"; +import useAxios from "../../hooks/useAxios"; +import getUserInfo from "../../utils/getUserInfo"; +import LinkSidebar from "../links/LinkSidebar"; import ToggleSidebar from "./ToggleSidebar"; const Sidebar = () => { diff --git a/frontend/src/components/ToggleSidebar.jsx b/frontend/src/components/navigations/ToggleSidebar.jsx similarity index 100% rename from frontend/src/components/ToggleSidebar.jsx rename to frontend/src/components/navigations/ToggleSidebar.jsx diff --git a/frontend/src/components/RowTableProject.jsx b/frontend/src/components/tables/RowTableProject.jsx similarity index 87% rename from frontend/src/components/RowTableProject.jsx rename to frontend/src/components/tables/RowTableProject.jsx index 3ed1ad5..79e6b14 100644 --- a/frontend/src/components/RowTableProject.jsx +++ b/frontend/src/components/tables/RowTableProject.jsx @@ -1,5 +1,5 @@ -import ButtonDelete from "./ButtonDelete"; -import ButtonEdit from "./ButtonEdit"; +import ButtonDelete from "../buttons/ButtonDelete"; +import ButtonEdit from "../buttons/ButtonEdit"; import Td from "./Td"; import Tr from "./Tr"; diff --git a/frontend/src/components/Td.jsx b/frontend/src/components/tables/Td.jsx similarity index 100% rename from frontend/src/components/Td.jsx rename to frontend/src/components/tables/Td.jsx diff --git a/frontend/src/components/Th.jsx b/frontend/src/components/tables/Th.jsx similarity index 100% rename from frontend/src/components/Th.jsx rename to frontend/src/components/tables/Th.jsx diff --git a/frontend/src/components/Tr.jsx b/frontend/src/components/tables/Tr.jsx similarity index 100% rename from frontend/src/components/Tr.jsx rename to frontend/src/components/tables/Tr.jsx diff --git a/frontend/src/pages/Home.jsx b/frontend/src/pages/Home.jsx index a09bd0e..6d95e53 100644 --- a/frontend/src/pages/Home.jsx +++ b/frontend/src/pages/Home.jsx @@ -1,8 +1,8 @@ -import ButtonOutline from "../components/ButtonOutline"; +import ButtonOutline from "../components/buttons/ButtonOutline"; import { Link } from "react-router-dom"; import getRouteName from "../utils/getRouteName"; import getUserInfo from "../utils/getUserInfo"; -import FeatureCard from "../components/FeatureCard"; +import FeatureCard from "../components/cards/FeatureCard"; import LogoCreatedWhite from "../assets/image/LogoCreatedWhite.svg"; const Home = () => { diff --git a/frontend/src/pages/Login.jsx b/frontend/src/pages/Login.jsx index c30b951..cbbbb39 100644 --- a/frontend/src/pages/Login.jsx +++ b/frontend/src/pages/Login.jsx @@ -1,6 +1,6 @@ import { Link, Redirect, useHistory } from "react-router-dom"; -import ButtonForm from "../components/ButtonForm"; -import Input from "../components/Input"; +import ButtonForm from "../components/buttons/ButtonForm"; +import Input from "../components/forms/Input"; import getRouteName from "../utils/getRouteName"; import Logo from "../assets/image/Logo.svg"; import useAxios from "../hooks/useAxios"; diff --git a/frontend/src/pages/Portfolio.jsx b/frontend/src/pages/Portfolio.jsx index 56318e8..b3c9299 100644 --- a/frontend/src/pages/Portfolio.jsx +++ b/frontend/src/pages/Portfolio.jsx @@ -1,6 +1,6 @@ import PortfolioSection from "../components/PortfolioSection"; import SkillItem from "../components/SkillItem"; -import CardProject from "../components/CardProject"; +import CardProject from "../components/cards/CardProject"; import LogoWhite from "../assets/image/LogoWhite.svg"; import SquareLogo from "../assets/image/SquareLogo.svg"; import { Link, Redirect } from "react-router-dom"; diff --git a/frontend/src/pages/Register.jsx b/frontend/src/pages/Register.jsx index fccb5a9..26986e2 100644 --- a/frontend/src/pages/Register.jsx +++ b/frontend/src/pages/Register.jsx @@ -1,6 +1,6 @@ import { Link, Redirect } from "react-router-dom"; -import ButtonForm from "../components/ButtonForm"; -import Input from "../components/Input"; +import ButtonForm from "../components/buttons/ButtonForm"; +import Input from "../components/forms/Input"; import getRouteName from "../utils/getRouteName"; import Logo from "../assets/image/Logo.svg"; import { useState } from "react"; diff --git a/frontend/src/pages/dashboard/Projects.jsx b/frontend/src/pages/dashboard/Projects.jsx index 90535d8..36b3b95 100644 --- a/frontend/src/pages/dashboard/Projects.jsx +++ b/frontend/src/pages/dashboard/Projects.jsx @@ -1,13 +1,13 @@ import { useEffect, useState } from "react"; -import AlertDanger from "../../components/AlertDanger"; -import ButtonAdd from "../../components/ButtonAdd"; -import ButtonCancel from "../../components/ButtonCancel"; -import ButtonForm from "../../components/ButtonForm"; +import AlertDanger from "../../components/alerts/AlertDanger"; +import ButtonAdd from "../../components/buttons/ButtonAdd"; +import ButtonCancel from "../../components/buttons/ButtonCancel"; +import ButtonForm from "../../components/buttons/ButtonForm"; import DashboardTitle from "../../components/DashboardTitle"; -import Input from "../../components/Input"; -import RowTableProject from "../../components/RowTableProject"; -import Sidebar from "../../components/Sidebar"; -import Th from "../../components/Th"; +import Input from "../../components/forms/Input"; +import RowTableProject from "../../components/tables/RowTableProject"; +import Sidebar from "../../components/navigations/Sidebar"; +import Th from "../../components/tables/Th"; import useAxios from "../../hooks/useAxios"; import getUserInfo from "../../utils/getUserInfo"; import { toast } from "react-toastify"; diff --git a/frontend/src/pages/dashboard/Skills.jsx b/frontend/src/pages/dashboard/Skills.jsx index 57216b3..fd2d1ae 100644 --- a/frontend/src/pages/dashboard/Skills.jsx +++ b/frontend/src/pages/dashboard/Skills.jsx @@ -1,12 +1,12 @@ -import Sidebar from "../../components/Sidebar"; +import Sidebar from "../../components/navigations/Sidebar"; import SkillItemDashboard from "../../components/SkillItemDashboard"; -import ButtonAdd from "../../components/ButtonAdd"; +import ButtonAdd from "../../components/buttons/ButtonAdd"; import DashboardTitle from "../../components/DashboardTitle"; import { useEffect, useState } from "react"; -import AlertDanger from "../../components/AlertDanger"; +import AlertDanger from "../../components/alerts/AlertDanger"; import useAxios from "../../hooks/useAxios"; import getUserInfo from "../../utils/getUserInfo"; -import ButtonCancel from "../../components/ButtonCancel"; +import ButtonCancel from "../../components/buttons/ButtonCancel"; import { toast } from "react-toastify"; import LoadingDark from "../../components/loading/LoadingDark"; diff --git a/frontend/src/pages/dashboard/User.jsx b/frontend/src/pages/dashboard/User.jsx index 36c5102..e753e47 100644 --- a/frontend/src/pages/dashboard/User.jsx +++ b/frontend/src/pages/dashboard/User.jsx @@ -1,9 +1,9 @@ import { useEffect, useState } from "react"; -import ButtonForm from "../../components/ButtonForm"; -import Input from "../../components/Input"; -import InputFile from "../../components/InputFile"; -import Sidebar from "../../components/Sidebar"; -import Textarea from "../../components/Textarea"; +import ButtonForm from "../../components/buttons/ButtonForm"; +import Input from "../../components/forms/Input"; +import InputFile from "../../components/forms/InputFile"; +import Sidebar from "../../components/navigations/Sidebar"; +import Textarea from "../../components/forms/Textarea"; import useAxios from "../../hooks/useAxios"; import axios from "axios"; import { toast } from "react-toastify";