From 7bcb0f082ebef9469a74a84723a539aaf94bab34 Mon Sep 17 00:00:00 2001 From: Fityan <63894003+fityannugroho@users.noreply.github.com> Date: Tue, 3 Dec 2024 15:39:58 +0700 Subject: [PATCH] refactor: rename component files (#49) --- app/(main)/layout.tsx | 2 +- app/(main)/pilkada2024/page.tsx | 2 +- app/layout.tsx | 2 +- app/not-found.tsx | 2 +- components/{area-boundary.tsx => AreaBoundary.tsx} | 0 components/{combobox.tsx => Combobox.tsx} | 0 components/ComboboxArea.tsx | 2 +- components/{dashboard-layout.tsx => DashboardLayout.tsx} | 0 components/{map.tsx => Map.tsx} | 2 +- components/{map-marker.tsx => MapMarker.tsx} | 0 ...map-marker-cluster-group.tsx => MapMarkerClusterGroup.tsx} | 0 components/{navbar.tsx => Navbar.tsx} | 2 +- components/{query-provider.tsx => QueryProvider.tsx} | 0 components/{theme-toggle.tsx => ThemeToggle.tsx} | 0 components/{tile-layer.tsx => TileLayer.tsx} | 0 modules/MapDashboard/BoundaryLayers.tsx | 2 +- modules/MapDashboard/Dashboard.tsx | 2 +- modules/MapDashboard/IslandMarkers.tsx | 4 ++-- modules/MapDashboard/MapView.tsx | 2 +- modules/Pilkada2024/BoundaryLayers.tsx | 2 +- modules/Pilkada2024/MapView.tsx | 2 +- modules/Pilkada2024/Sidebar.tsx | 2 +- 22 files changed, 15 insertions(+), 15 deletions(-) rename components/{area-boundary.tsx => AreaBoundary.tsx} (100%) rename components/{combobox.tsx => Combobox.tsx} (100%) rename components/{dashboard-layout.tsx => DashboardLayout.tsx} (100%) rename components/{map.tsx => Map.tsx} (94%) rename components/{map-marker.tsx => MapMarker.tsx} (100%) rename components/{map-marker-cluster-group.tsx => MapMarkerClusterGroup.tsx} (100%) rename components/{navbar.tsx => Navbar.tsx} (98%) rename components/{query-provider.tsx => QueryProvider.tsx} (100%) rename components/{theme-toggle.tsx => ThemeToggle.tsx} (100%) rename components/{tile-layer.tsx => TileLayer.tsx} (100%) diff --git a/app/(main)/layout.tsx b/app/(main)/layout.tsx index 9c70a30..7eda4f2 100644 --- a/app/(main)/layout.tsx +++ b/app/(main)/layout.tsx @@ -1,4 +1,4 @@ -import { Navbar } from '@/components/navbar' +import { Navbar } from '@/components/Navbar' export default function MainLayout({ children, diff --git a/app/(main)/pilkada2024/page.tsx b/app/(main)/pilkada2024/page.tsx index adc515d..4adcf24 100644 --- a/app/(main)/pilkada2024/page.tsx +++ b/app/(main)/pilkada2024/page.tsx @@ -1,4 +1,4 @@ -import DashboardLayout from '@/components/dashboard-layout' +import DashboardLayout from '@/components/DashboardLayout' import MapDashboardProvider from '@/modules/MapDashboard/DashboardProvider' import MapView from '@/modules/Pilkada2024/MapView' import PilkadaProvider from '@/modules/Pilkada2024/PilkadaProvider' diff --git a/app/layout.tsx b/app/layout.tsx index c7dfa7f..f8cb451 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -3,7 +3,7 @@ import { cn } from '@/lib/utils' import { Inter } from 'next/font/google' import { StrictMode } from 'react' import './globals.css' -import QueryProvider from '@/components/query-provider' +import QueryProvider from '@/components/QueryProvider' import { Toaster } from '@/components/ui/sonner' import type { Metadata } from 'next' import { ThemeProvider } from 'next-themes' diff --git a/app/not-found.tsx b/app/not-found.tsx index d800344..6509e5d 100644 --- a/app/not-found.tsx +++ b/app/not-found.tsx @@ -1,4 +1,4 @@ -import { Navbar } from '@/components/navbar' +import { Navbar } from '@/components/Navbar' import { Button } from '@/components/ui/button' import { TriangleAlertIcon } from 'lucide-react' import type { Metadata } from 'next' diff --git a/components/area-boundary.tsx b/components/AreaBoundary.tsx similarity index 100% rename from components/area-boundary.tsx rename to components/AreaBoundary.tsx diff --git a/components/combobox.tsx b/components/Combobox.tsx similarity index 100% rename from components/combobox.tsx rename to components/Combobox.tsx diff --git a/components/ComboboxArea.tsx b/components/ComboboxArea.tsx index c2f4b6b..9d34807 100644 --- a/components/ComboboxArea.tsx +++ b/components/ComboboxArea.tsx @@ -4,7 +4,7 @@ import { Combobox, type ComboboxOption, type ComboboxProps, -} from '@/components/combobox' +} from '@/components/Combobox' import { useArea } from '@/hooks/useArea' import type { FeatureArea } from '@/lib/config' import type { GetArea } from '@/lib/const' diff --git a/components/dashboard-layout.tsx b/components/DashboardLayout.tsx similarity index 100% rename from components/dashboard-layout.tsx rename to components/DashboardLayout.tsx diff --git a/components/map.tsx b/components/Map.tsx similarity index 94% rename from components/map.tsx rename to components/Map.tsx index 363e419..fff41f8 100644 --- a/components/map.tsx +++ b/components/Map.tsx @@ -3,7 +3,7 @@ import 'leaflet/dist/leaflet.css' import type { PropsWithChildren } from 'react' import { MapContainer, type MapContainerProps } from 'react-leaflet' -import TileLayer from './tile-layer' +import TileLayer from './TileLayer' export type MapProps = MapContainerProps & PropsWithChildren diff --git a/components/map-marker.tsx b/components/MapMarker.tsx similarity index 100% rename from components/map-marker.tsx rename to components/MapMarker.tsx diff --git a/components/map-marker-cluster-group.tsx b/components/MapMarkerClusterGroup.tsx similarity index 100% rename from components/map-marker-cluster-group.tsx rename to components/MapMarkerClusterGroup.tsx diff --git a/components/navbar.tsx b/components/Navbar.tsx similarity index 98% rename from components/navbar.tsx rename to components/Navbar.tsx index fb61d77..8493ebc 100644 --- a/components/navbar.tsx +++ b/components/Navbar.tsx @@ -5,8 +5,8 @@ import { cn } from '@/lib/utils' import { ExternalLinkIcon, HandHeartIcon, MenuIcon } from 'lucide-react' import Link from 'next/link' import * as React from 'react' +import { ThemeToggle } from './ThemeToggle' import GitHubIcon from './icons/GitHubIcon' -import { ThemeToggle } from './theme-toggle' import { Badge } from './ui/badge' import { Button } from './ui/button' import { diff --git a/components/query-provider.tsx b/components/QueryProvider.tsx similarity index 100% rename from components/query-provider.tsx rename to components/QueryProvider.tsx diff --git a/components/theme-toggle.tsx b/components/ThemeToggle.tsx similarity index 100% rename from components/theme-toggle.tsx rename to components/ThemeToggle.tsx diff --git a/components/tile-layer.tsx b/components/TileLayer.tsx similarity index 100% rename from components/tile-layer.tsx rename to components/TileLayer.tsx diff --git a/modules/MapDashboard/BoundaryLayers.tsx b/modules/MapDashboard/BoundaryLayers.tsx index b386da0..238dd58 100644 --- a/modules/MapDashboard/BoundaryLayers.tsx +++ b/modules/MapDashboard/BoundaryLayers.tsx @@ -1,6 +1,6 @@ 'use client' -import AreaBoundary from '@/components/area-boundary' +import AreaBoundary from '@/components/AreaBoundary' import { featureConfig } from '@/lib/config' import { getObjectKeys } from '@/lib/utils' import { useCallback, useState } from 'react' diff --git a/modules/MapDashboard/Dashboard.tsx b/modules/MapDashboard/Dashboard.tsx index 383066c..4faa17c 100644 --- a/modules/MapDashboard/Dashboard.tsx +++ b/modules/MapDashboard/Dashboard.tsx @@ -1,4 +1,4 @@ -import DashboardLayout from '@/components/dashboard-layout' +import DashboardLayout from '@/components/DashboardLayout' import MapDashboardProvider from './DashboardProvider' import MapView from './MapView' import Sidebar from './Sidebar' diff --git a/modules/MapDashboard/IslandMarkers.tsx b/modules/MapDashboard/IslandMarkers.tsx index 0df5c57..3bd9a27 100644 --- a/modules/MapDashboard/IslandMarkers.tsx +++ b/modules/MapDashboard/IslandMarkers.tsx @@ -8,11 +8,11 @@ import { useMapDashboard } from './hooks/useDashboard' import { useIslands } from './hooks/useIslands' const MarkerClusterGroup = dynamic( - () => import('@/components/map-marker-cluster-group'), + () => import('@/components/MapMarkerClusterGroup'), { ssr: false }, ) -const MapMarker = dynamic(() => import('@/components/map-marker'), { +const MapMarker = dynamic(() => import('@/components/MapMarker'), { ssr: false, }) diff --git a/modules/MapDashboard/MapView.tsx b/modules/MapDashboard/MapView.tsx index ee79c49..51a1f07 100644 --- a/modules/MapDashboard/MapView.tsx +++ b/modules/MapDashboard/MapView.tsx @@ -9,7 +9,7 @@ import BoundaryLayers from './BoundaryLayers' import IslandMarkers from './IslandMarkers' import { useMapDashboard } from './hooks/useDashboard' -const Map = dynamic(() => import('@/components/map'), { +const Map = dynamic(() => import('@/components/Map'), { loading: () => , ssr: false, }) diff --git a/modules/Pilkada2024/BoundaryLayers.tsx b/modules/Pilkada2024/BoundaryLayers.tsx index 354d1a6..105169d 100644 --- a/modules/Pilkada2024/BoundaryLayers.tsx +++ b/modules/Pilkada2024/BoundaryLayers.tsx @@ -1,6 +1,6 @@ 'use client' -import AreaBoundary from '@/components/area-boundary' +import AreaBoundary from '@/components/AreaBoundary' import { useArea } from '@/hooks/useArea' import { config } from '@/lib/config' import { Area } from '@/lib/const' diff --git a/modules/Pilkada2024/MapView.tsx b/modules/Pilkada2024/MapView.tsx index 81c51f4..f4a54b8 100644 --- a/modules/Pilkada2024/MapView.tsx +++ b/modules/Pilkada2024/MapView.tsx @@ -9,7 +9,7 @@ import { useMapDashboard } from '../MapDashboard/hooks/useDashboard' import BoundaryLayers from './BoundaryLayers' import { usePilkada } from './hooks/usePilkada' -const Map = dynamic(() => import('@/components/map'), { +const Map = dynamic(() => import('@/components/Map'), { loading: () => , ssr: false, }) diff --git a/modules/Pilkada2024/Sidebar.tsx b/modules/Pilkada2024/Sidebar.tsx index 458a1f8..86a0b67 100644 --- a/modules/Pilkada2024/Sidebar.tsx +++ b/modules/Pilkada2024/Sidebar.tsx @@ -1,7 +1,7 @@ 'use client' +import { Combobox } from '@/components/Combobox' import ComboboxArea from '@/components/ComboboxArea' -import { Combobox } from '@/components/combobox' import { Button } from '@/components/ui/button' import { config } from '@/lib/config' import { Area } from '@/lib/const'