From 65b7e2cd44c631cd80961b050d5c07f312de5632 Mon Sep 17 00:00:00 2001 From: ThePotioner Date: Wed, 24 Sep 2025 01:01:44 +0900 Subject: [PATCH] refactor: Consistently use arrow functions for components Converts all functional components from the function Component() {} declaration to the const Component = () => {} syntax. This change improves consistency across the codebase. --- src/components/MainContainer.tsx | 4 ++-- src/components/PageContainer.tsx | 4 ++-- src/components/Sidebar.tsx | 4 ++-- src/components/ToggleTheme.tsx | 4 ++-- src/components/Topbar.tsx | 4 ++-- src/components/pages/Dashboard.tsx | 4 ++-- src/components/pages/Home.tsx | 4 ++-- src/components/pages/Todos.tsx | 4 ++-- src/components/pages/default/NotFound.tsx | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/components/MainContainer.tsx b/src/components/MainContainer.tsx index 402aff5..cdafd67 100644 --- a/src/components/MainContainer.tsx +++ b/src/components/MainContainer.tsx @@ -2,7 +2,7 @@ import PageContainer from './PageContainer'; import Sidebar from './Sidebar'; import { ToggleTheme } from './ToggleTheme'; -function MainContainer() { +const MainContainer = () => { return (
@@ -12,6 +12,6 @@ function MainContainer() {
); -} +}; export default MainContainer; diff --git a/src/components/PageContainer.tsx b/src/components/PageContainer.tsx index 8d616a5..1bd7997 100644 --- a/src/components/PageContainer.tsx +++ b/src/components/PageContainer.tsx @@ -7,7 +7,7 @@ import Dashboard from './pages/Dashboard'; import Todos from './pages/Todos'; import NotFound from './pages/default/NotFound'; -function PageContainer() { +const PageContainer = () => { return (
@@ -19,6 +19,6 @@ function PageContainer() {
); -} +}; export default PageContainer; diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index 154f73a..4fb7a75 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -15,7 +15,7 @@ export const items = [ { name: 'Calendar', href: '/calendar', icon: IconCalendarWeekFilled }, ]; -function Sidebar() { +const Sidebar = () => { const [location] = useLocation(); return ( ); -} +}; export default Sidebar; diff --git a/src/components/ToggleTheme.tsx b/src/components/ToggleTheme.tsx index dfd8751..1dfde9e 100644 --- a/src/components/ToggleTheme.tsx +++ b/src/components/ToggleTheme.tsx @@ -5,7 +5,7 @@ import { Button } from '@/components/ui/button'; import { useTheme } from '../hooks/useThemeHook'; import { changeTheme } from '../lib/utils'; -export function ToggleTheme() { +export const ToggleTheme = () => { const { theme, toggleTheme } = useTheme(); useEffect(() => { @@ -19,4 +19,4 @@ export function ToggleTheme() { Toggle theme ); -} +}; diff --git a/src/components/Topbar.tsx b/src/components/Topbar.tsx index f6901d5..525cea6 100644 --- a/src/components/Topbar.tsx +++ b/src/components/Topbar.tsx @@ -2,7 +2,7 @@ import { Button } from '@/components/ui/button'; import { items } from './Sidebar'; import { useLocation } from 'wouter'; -function Topbar() { +const Topbar = () => { const [location] = useLocation(); return (
@@ -12,6 +12,6 @@ function Topbar() {
); -} +}; export default Topbar; diff --git a/src/components/pages/Dashboard.tsx b/src/components/pages/Dashboard.tsx index 38b7203..e65ba24 100644 --- a/src/components/pages/Dashboard.tsx +++ b/src/components/pages/Dashboard.tsx @@ -1,9 +1,9 @@ -function Dashboard() { +const Dashboard = () => { return (

Dashboard

); -} +}; export default Dashboard; diff --git a/src/components/pages/Home.tsx b/src/components/pages/Home.tsx index aaa526f..d869ecd 100644 --- a/src/components/pages/Home.tsx +++ b/src/components/pages/Home.tsx @@ -1,9 +1,9 @@ -function Home() { +const Home = () => { return (

Home

); -} +}; export default Home; diff --git a/src/components/pages/Todos.tsx b/src/components/pages/Todos.tsx index 374a37a..d376556 100644 --- a/src/components/pages/Todos.tsx +++ b/src/components/pages/Todos.tsx @@ -1,9 +1,9 @@ -function Todos() { +const Todos = () => { return (

Todos

); -} +}; export default Todos; diff --git a/src/components/pages/default/NotFound.tsx b/src/components/pages/default/NotFound.tsx index 1134774..0b113bc 100644 --- a/src/components/pages/default/NotFound.tsx +++ b/src/components/pages/default/NotFound.tsx @@ -1,9 +1,9 @@ -function NotFound() { +const NotFound = () => { return (

404 - Not Found!

); -} +}; export default NotFound;