Skip to content

Commit

Permalink
optimized
Browse files Browse the repository at this point in the history
  • Loading branch information
Jame committed Dec 9, 2023
1 parent c8fa446 commit 062db59
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 34 deletions.
6 changes: 6 additions & 0 deletions app/about/page.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion components/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion components/BarCard.tsx
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
2 changes: 1 addition & 1 deletion components/BarScaled.tsx
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
14 changes: 4 additions & 10 deletions components/ChartGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
5 changes: 3 additions & 2 deletions components/NavbarApp.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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() {
Expand Down
1 change: 1 addition & 0 deletions components/SectionPartEnd.tsx
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
15 changes: 6 additions & 9 deletions components/SectionTodo.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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: 'ตรวจสอบ “ร่างกฎหมาย” ก่อนประกาศใช้',
Expand All @@ -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: 'ตรวจสอบคุณสมบัติและวินิจฉัยสถานะ ของ สส. สว. และคณะรัฐมนตรี',
Expand All @@ -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: ' ให้สิทธิประชาชนยื่นคำร้องเมื่อถูกละเมิดสิทธิหรือเสรีภาพ',
Expand Down Expand Up @@ -190,11 +190,8 @@ export default function SectionTodo() {
<div className="mt-6 grid gap-6 lg:grid-cols-3 lg:gap-8">
{todoList.map((t) => (
<div key={t.name}>
<div
style={{ backgroundImage: `url(${t.bg})` }}
className="wv-h8 relative flex h-[200px] items-center justify-center overflow-hidden rounded-md bg-cover font-bold text-black lg:h-[236px]"
>
<div className="absolute inset-0 bg-white/50"></div>
<div className="wv-h8 relative flex h-[200px] items-center justify-center overflow-hidden rounded-md bg-white font-bold text-black lg:h-[236px]">
<CustomImg src={t.bg} className="absolute h-full w-full" />
<div
style={{ backgroundColor: t.color }}
className="absolute inset-0 mix-blend-screen"
Expand Down
2 changes: 1 addition & 1 deletion components/SituationDetail.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { Accordion, AccordionItem } from '@nextui-org/react';
import { Accordion, AccordionItem } from '@nextui-org/accordion';
import CustomImg from './CustomImg';
import { useState } from 'react';
import { twMerge } from 'tailwind-merge';
Expand Down
10 changes: 3 additions & 7 deletions components/WhyWhatDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ import IconWithBg from './IconWithBg';
import PaperBox from './PaperBox';
import CustomImg from './CustomImg';
import Quote from './Quote';
import {
Modal,
ModalContent,
ModalBody,
Button,
useDisclosure,
} from '@nextui-org/react';
import { Modal, ModalContent, ModalBody } from '@nextui-org/modal';
import { Button } from '@nextui-org/button';
import { useDisclosure } from '@nextui-org/use-disclosure';

type Props = {};

Expand Down
3 changes: 2 additions & 1 deletion hooks/useChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
} from '@/models';
import { state } from '@/stores';
import { filterByKeys } from '@/utils/array';
import { flatten, throttle } from 'lodash';
import flatten from 'lodash/flatten';
import throttle from 'lodash/throttle';
import { useEffect, useMemo, useState } from 'react';
import { useSnapshot } from 'valtio';

Expand Down

0 comments on commit 062db59

Please sign in to comment.