From 062db59dfd09cedff19d53df801732b439e6d762 Mon Sep 17 00:00:00 2001 From: Jame <> Date: Sat, 9 Dec 2023 21:35:30 +0700 Subject: [PATCH] optimized --- app/about/page.tsx | 6 ++++++ app/layout.tsx | 2 +- components/Avatar.tsx | 2 +- components/BarCard.tsx | 2 +- components/BarScaled.tsx | 2 +- components/ChartGroup.tsx | 14 ++++---------- components/NavbarApp.tsx | 5 +++-- components/SectionPartEnd.tsx | 1 + components/SectionTodo.tsx | 15 ++++++--------- components/SituationDetail.tsx | 2 +- components/WhyWhatDetail.tsx | 10 +++------- hooks/useChart.tsx | 3 ++- 12 files changed, 30 insertions(+), 34 deletions(-) diff --git a/app/about/page.tsx b/app/about/page.tsx index b81d421..d9faa47 100644 --- a/app/about/page.tsx +++ b/app/about/page.tsx @@ -1,5 +1,11 @@ 'use client'; +import '@wevisdemo/ui/styles/container.css'; +import '@wevisdemo/ui/styles/paragraph-group.css'; +import '@wevisdemo/ui/styles/button-group.css'; +import '@wevisdemo/ui/styles/button.css'; +import '@wevisdemo/ui/styles/sharer.css'; +import '@wevisdemo/ui/styles/footer.css'; import WvContainer from '@wevisdemo/ui/react/container'; import WvParagraphGroup from '@wevisdemo/ui/react/paragraph-group'; import WvButtonGroup from '@wevisdemo/ui/react/button-group'; diff --git a/app/layout.tsx b/app/layout.tsx index b1e4997..b2e5d71 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,5 +1,5 @@ import type { Metadata } from 'next'; -import '@wevisdemo/ui/styles/index.css'; +import '@wevisdemo/ui/styles/typography.css'; import '../styles/globals.scss'; import NavbarApp from '@/components/NavbarApp'; import { Providers } from './providers'; diff --git a/components/Avatar.tsx b/components/Avatar.tsx index 89c024f..2f92c0b 100644 --- a/components/Avatar.tsx +++ b/components/Avatar.tsx @@ -1,4 +1,4 @@ -import { Tooltip } from '@nextui-org/react'; +import { Tooltip } from '@nextui-org/tooltip'; import CustomImg from './CustomImg'; import { twMerge } from 'tailwind-merge'; import { useBreakpoint } from '@/hooks/useBreakpoint'; diff --git a/components/BarCard.tsx b/components/BarCard.tsx index 9f56574..b9b6bad 100644 --- a/components/BarCard.tsx +++ b/components/BarCard.tsx @@ -1,7 +1,7 @@ import { TBarChartCard } from '@/models'; import { twMerge } from 'tailwind-merge'; import CustomImg from './CustomImg'; -import { useDisclosure } from '@nextui-org/react'; +import { useDisclosure } from '@nextui-org/use-disclosure'; import { useState } from 'react'; import BarChartModal from './BarChartModal'; diff --git a/components/BarScaled.tsx b/components/BarScaled.tsx index e388632..dc3af8a 100644 --- a/components/BarScaled.tsx +++ b/components/BarScaled.tsx @@ -1,7 +1,7 @@ import { TBarChartCard } from '@/models'; import { twMerge } from 'tailwind-merge'; import CustomImg from './CustomImg'; -import { useDisclosure } from '@nextui-org/react'; +import { useDisclosure } from '@nextui-org/use-disclosure'; import { useState } from 'react'; import BarChartModal from './BarChartModal'; diff --git a/components/ChartGroup.tsx b/components/ChartGroup.tsx index 17418d1..0b3d7d4 100644 --- a/components/ChartGroup.tsx +++ b/components/ChartGroup.tsx @@ -3,21 +3,15 @@ import { TChart } from '@/models'; import Legends from './Legends'; import { useChart } from '@/hooks/useChart'; -import { - Modal, - ModalBody, - ModalContent, - Popover, - PopoverContent, - PopoverTrigger, - useDisclosure, -} from '@nextui-org/react'; +import { Modal, ModalBody, ModalContent } from '@nextui-org/modal'; +import { Popover, PopoverContent, PopoverTrigger } from '@nextui-org/popover'; +import { useDisclosure } from '@nextui-org/use-disclosure'; import CustomImg from './CustomImg'; import Bracket from './Bracket'; import { twMerge } from 'tailwind-merge'; import Avatar from './Avatar'; import BarStacked from './BarStacked'; -import { last } from 'lodash'; +import last from 'lodash/last'; import { useEffect, useState } from 'react'; import BarCard from './BarCard'; import BarScaled from './BarScaled'; diff --git a/components/NavbarApp.tsx b/components/NavbarApp.tsx index 733982c..efe4c87 100644 --- a/components/NavbarApp.tsx +++ b/components/NavbarApp.tsx @@ -1,5 +1,6 @@ 'use client'; +import '@wevisdemo/ui/styles/navbar.css'; import WvNavbar from '@wevisdemo/ui/react/navbar'; import { usePage } from '@/hooks/usePage'; import { useSnapshot } from 'valtio'; @@ -9,8 +10,8 @@ import { DropdownItem, DropdownMenu, DropdownTrigger, - Navbar, -} from '@nextui-org/react'; +} from '@nextui-org/dropdown'; +import { Navbar } from '@nextui-org/navbar'; import { genArrayByNum } from '@/utils/array'; export default function NavbarApp() { diff --git a/components/SectionPartEnd.tsx b/components/SectionPartEnd.tsx index 98416f7..0e11f7e 100644 --- a/components/SectionPartEnd.tsx +++ b/components/SectionPartEnd.tsx @@ -1,6 +1,7 @@ 'use client'; import BorderBox from './BorderBox'; +import '@wevisdemo/ui/styles/sharer.css'; import WvSharer from '@wevisdemo/ui/react/sharer'; export default function SectionPartEnd() { diff --git a/components/SectionTodo.tsx b/components/SectionTodo.tsx index 4526383..a1da189 100644 --- a/components/SectionTodo.tsx +++ b/components/SectionTodo.tsx @@ -1,6 +1,6 @@ 'use client'; -import { Popover, PopoverContent, PopoverTrigger } from '@nextui-org/react'; +import { Popover, PopoverContent, PopoverTrigger } from '@nextui-org/popover'; import CustomImg from './CustomImg'; import IconWithBg from './IconWithBg'; import ScrollHint from './ScrollHint'; @@ -13,7 +13,7 @@ export default function SectionTodo() { name: 'หน้าที่ตรวจสอบกฎหมายให้ตรงตามเงื่อนไขในรัฐธรรมนูญ', color: '#6BB8FF', icon: '/images/icon_inspect_blue.webp', - bg: 'images/bg_inspect.webp', + bg: '/images/bg_inspect.webp', items: [ { name: 'ตรวจสอบ “ร่างกฎหมาย” ก่อนประกาศใช้', @@ -37,7 +37,7 @@ export default function SectionTodo() { name: 'หน้าที่ตรวจสอบสถาบันทางการเมือง', color: '#FFC164', icon: '/images/icon_protect_orange.webp', - bg: 'images/bg_protect.webp', + bg: '/images/bg_protect.webp', items: [ { name: 'ตรวจสอบคุณสมบัติและวินิจฉัยสถานะ ของ สส. สว. และคณะรัฐมนตรี', @@ -61,7 +61,7 @@ export default function SectionTodo() { name: 'หน้าที่คุ้มครองสิทธิเสรีภาพของประชาชนและความมั่นคงของรัฐ', color: '#E0AEFF', icon: '/images/icon_why_purple.webp', - bg: 'images/bg_why.webp', + bg: '/images/bg_why.webp', items: [ { name: ' ให้สิทธิประชาชนยื่นคำร้องเมื่อถูกละเมิดสิทธิหรือเสรีภาพ', @@ -190,11 +190,8 @@ export default function SectionTodo() {