diff --git a/package.json b/package.json index 834e71e9..980f6082 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,6 @@ "class-variance-authority": "^0.7.1", "clsx": "^1.2.1", "copy-to-clipboard": "^3.3.3", - "daisyui": "^4.4.23", "dayjs": "^1.11.7", "file-saver": "^2.0.5", "framer-motion": "^10.16.4", @@ -126,6 +125,7 @@ "astro": "4.16.7", "autoprefixer": "^10.4.12", "cross-env": "7.0.3", + "daisyui": "4.12.10", "eslint": "^8.7.0", "eslint-config-next": "^13.1.1", "eslint-plugin-headers": "1.2.1", diff --git a/src/app/(uc)/signin/page.js b/src/app/(uc)/signin/page.js index 2a5200c0..863c3de9 100644 --- a/src/app/(uc)/signin/page.js +++ b/src/app/(uc)/signin/page.js @@ -16,7 +16,6 @@ 'use client'; -import { EyeIcon, EyeSlashIcon } from '@heroicons/react/24/outline'; import clsx from 'clsx'; import { signIn } from 'next-auth/react'; import Link from 'next/link'; @@ -25,6 +24,7 @@ import { useState } from 'react'; import { useForm } from 'react-hook-form'; import { toast } from 'react-toastify'; +import { EyeIcon, EyeSlashIcon } from '@/components/icon/outlined'; import Loader from '@/components/Loader'; import { isEmpty } from '@/utils'; import { wrapOnChange } from '@/utils/form'; diff --git a/src/app/(uc)/signup/page.js b/src/app/(uc)/signup/page.js index 19951c77..2a00cd68 100644 --- a/src/app/(uc)/signup/page.js +++ b/src/app/(uc)/signup/page.js @@ -16,7 +16,6 @@ 'use client'; -import { EyeIcon, EyeSlashIcon } from '@heroicons/react/24/outline'; import clsx from 'clsx'; import { useSession } from 'next-auth/react'; import Link from 'next/link'; @@ -28,6 +27,7 @@ import { toast } from 'react-toastify'; import isEmail from 'validator/lib/isEmail'; import { useAccount } from 'wagmi'; +import { EyeIcon, EyeSlashIcon } from '@/components/icon/outlined'; import Loader from '@/components/Loader'; import { registerEmail, sendCode } from '#/services/auth'; diff --git a/src/app/bounties/Filter.js b/src/app/bounties/Filter.js index 111aee3c..bfa3907e 100644 --- a/src/app/bounties/Filter.js +++ b/src/app/bounties/Filter.js @@ -16,13 +16,13 @@ 'use client'; -import { ChevronUpIcon } from '@heroicons/react/20/solid'; import clsx from 'clsx'; import { motion } from 'framer-motion'; import Image from 'next/image'; import { useRouter, useSearchParams, usePathname } from 'next/navigation'; import { useMemo, useState } from 'react'; +import { ChevronUpIcon } from '@/components/icon/solid'; import { ReactSelect } from '@/components/Select/ReactSelect'; import { createQueryString } from '@/utils'; diff --git a/src/app/creator/Tabs.js b/src/app/creator/Tabs.js index c53bca99..fa84fa41 100644 --- a/src/app/creator/Tabs.js +++ b/src/app/creator/Tabs.js @@ -16,12 +16,13 @@ 'use client'; -import { Disclosure } from '@headlessui/react'; -import { ChevronUpIcon } from '@heroicons/react/20/solid'; import clsx from 'clsx'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; +import { Disclosure } from '@/components/control'; +import { ChevronUpIcon } from '@/components/icon/solid'; + const menus = [ { name: 'Learn', diff --git a/src/app/creator/UsersModal.js b/src/app/creator/UsersModal.js index 6a4721d9..237d4555 100644 --- a/src/app/creator/UsersModal.js +++ b/src/app/creator/UsersModal.js @@ -16,13 +16,13 @@ 'use client'; -import { ArrowDownTrayIcon } from '@heroicons/react/24/outline'; import clsx from 'clsx'; import React, { useState, useMemo } from 'react'; import { toast } from 'react-toastify'; import useSWR from 'swr'; import { Button } from '@/components/Button'; +import { ArrowDownTrayIcon } from '@/components/icon/outlined'; import { Modal } from '@/components/Modal'; import { NoData } from '@/components/NoData'; import { CommonListSkeleton } from '@/components/Skeleton/CommonListSkeleton'; diff --git a/src/app/creator/build/[type]/AppliedModal.js b/src/app/creator/build/[type]/AppliedModal.js index a72ee007..65f59fcc 100644 --- a/src/app/creator/build/[type]/AppliedModal.js +++ b/src/app/creator/build/[type]/AppliedModal.js @@ -14,7 +14,6 @@ * limitations under the License. */ -import { EyeIcon } from '@heroicons/react/24/outline'; import { useConnectModal } from '@rainbow-me/rainbowkit'; import { writeContract } from '@wagmi/core'; // import { formatTime } from '@/utils/date' @@ -26,6 +25,7 @@ import { toast } from 'react-toastify'; import { useAccount } from 'wagmi'; import { Button } from '@/components/Button'; +import { EyeIcon } from '@/components/icon/outlined'; import Loader from '@/components/Loader'; import { Modal } from '@/components/Modal'; import { Confirm } from '@/components/Modal/Confirm'; diff --git a/src/app/creator/build/[type]/BountyList.js b/src/app/creator/build/[type]/BountyList.js index 740488d5..26024e54 100644 --- a/src/app/creator/build/[type]/BountyList.js +++ b/src/app/creator/build/[type]/BountyList.js @@ -14,12 +14,12 @@ * limitations under the License. */ -import { EyeIcon } from '@heroicons/react/24/outline'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useCallback, useState } from 'react'; import { Button } from '@/components/Button'; +import { EyeIcon } from '@/components/icon/outlined'; import { formatTime } from '@/utils/date'; import { changeBountyStatus } from '#/services/creator'; diff --git a/src/app/creator/build/[type]/Search.js b/src/app/creator/build/[type]/Search.js index 7b76d77c..854ded12 100644 --- a/src/app/creator/build/[type]/Search.js +++ b/src/app/creator/build/[type]/Search.js @@ -16,13 +16,13 @@ 'use client'; -import { PlusIcon } from '@heroicons/react/24/outline'; import Link from 'next/link'; import { usePathname, useRouter, useSearchParams } from 'next/navigation'; import { useMemo } from 'react'; import { useDebouncedCallback } from 'use-debounce'; import { Button } from '@/components/Button'; +import { PlusIcon } from '@/components/icon/outlined'; import { SearchIcon } from '@/components/Icons'; import Input from '@/components/Input'; import { ReactSelect } from '@/components/Select/ReactSelect'; diff --git a/src/app/creator/learn/[type]/ChallengesList.js b/src/app/creator/learn/[type]/ChallengesList.js index f225ed55..13d046b5 100644 --- a/src/app/creator/learn/[type]/ChallengesList.js +++ b/src/app/creator/learn/[type]/ChallengesList.js @@ -16,12 +16,12 @@ 'use client'; -import { EyeIcon } from '@heroicons/react/24/outline'; import Image from 'next/image'; import Link from 'next/link'; import { useState } from 'react'; import ContentEditable from 'react-contenteditable'; +import { EyeIcon } from '@/components/icon/outlined'; import { HTMLDecode } from '@/utils'; import { formatTime } from '@/utils/date'; diff --git a/src/app/creator/learn/[type]/OpenCourseList.js b/src/app/creator/learn/[type]/OpenCourseList.js index 6d3f4f6b..23968e63 100644 --- a/src/app/creator/learn/[type]/OpenCourseList.js +++ b/src/app/creator/learn/[type]/OpenCourseList.js @@ -16,12 +16,12 @@ 'use client'; -import { EyeIcon } from '@heroicons/react/24/outline'; import Image from 'next/image'; import Link from 'next/link'; import { useState } from 'react'; import ContentEditable from 'react-contenteditable'; +import { EyeIcon } from '@/components/icon/outlined'; import { HTMLDecode } from '@/utils'; import { useMediaUrl } from '#/state/application/hooks'; diff --git a/src/app/creator/learn/[type]/Search.js b/src/app/creator/learn/[type]/Search.js index 7f8838ff..23f30ec1 100644 --- a/src/app/creator/learn/[type]/Search.js +++ b/src/app/creator/learn/[type]/Search.js @@ -16,14 +16,14 @@ 'use client'; -import { PlusIcon } from '@heroicons/react/24/outline'; -import { CheckCircleIcon } from '@heroicons/react/24/solid'; import clsx from 'clsx'; import { usePathname, useRouter, useSearchParams } from 'next/navigation'; import { useMemo, useState } from 'react'; import { useDebouncedCallback } from 'use-debounce'; import { Button } from '@/components/Button'; +import { PlusIcon } from '@/components/icon/outlined'; +import { CheckCircleIcon } from '@/components/icon/solid'; import { SearchIcon } from '@/components/Icons'; import Input from '@/components/Input'; import { Modal } from '@/components/Modal'; diff --git a/src/app/creator/learn/[type]/SelectItemModal.js b/src/app/creator/learn/[type]/SelectItemModal.js index 9c5fe02a..41f43ca5 100644 --- a/src/app/creator/learn/[type]/SelectItemModal.js +++ b/src/app/creator/learn/[type]/SelectItemModal.js @@ -14,7 +14,6 @@ * limitations under the License. */ -import { CheckCircleIcon } from '@heroicons/react/24/solid'; import clsx from 'clsx'; import Image from 'next/image'; import { useRouter } from 'next/navigation'; @@ -23,6 +22,7 @@ import { toast } from 'react-toastify'; import useSWR from 'swr'; import { Button } from '@/components/Button'; +import { CheckCircleIcon } from '@/components/icon/solid'; import { Modal } from '@/components/Modal'; import { NoData } from '@/components/NoData'; import { CommonListSkeleton } from '@/components/Skeleton/CommonListSkeleton'; diff --git a/src/app/creator/learn/[type]/[id]/Chllenges.js b/src/app/creator/learn/[type]/[id]/Chllenges.js index dea96e36..85e248e0 100644 --- a/src/app/creator/learn/[type]/[id]/Chllenges.js +++ b/src/app/creator/learn/[type]/[id]/Chllenges.js @@ -14,11 +14,11 @@ * limitations under the License. */ -import { ChevronLeftIcon, ChevronRightIcon, CalendarDaysIcon } from '@heroicons/react/24/outline'; import clsx from 'clsx'; import { forwardRef } from 'react'; import DatePicker from 'react-datepicker'; +import { ChevronLeftIcon, ChevronRightIcon, CalendarDaysIcon } from '@/components/icon/outlined'; import { ReactSelect } from '@/components/Select/ReactSelect'; import 'react-datepicker/dist/react-datepicker.css'; diff --git a/src/app/creator/learn/[type]/[id]/StepFour.js b/src/app/creator/learn/[type]/[id]/StepFour.js index 79c44a72..7219088d 100644 --- a/src/app/creator/learn/[type]/[id]/StepFour.js +++ b/src/app/creator/learn/[type]/[id]/StepFour.js @@ -16,13 +16,13 @@ 'use client'; -import { PlusIcon, MinusCircleIcon } from '@heroicons/react/20/solid'; import Image from 'next/image'; import GithubIcon from 'public/images/svg/github_p.svg'; import { useState, useRef, useEffect } from 'react'; import { toast } from 'react-toastify'; import { Button } from '@/components/Button'; +import { PlusIcon, MinusCircleIcon } from '@/components/icon/solid'; import { TwitterIcon } from '@/components/Icons'; import Loader from '@/components/Loader'; import { Modal } from '@/components/Modal'; diff --git a/src/app/creator/learn/[type]/[id]/StepThree.js b/src/app/creator/learn/[type]/[id]/StepThree.js index 56e42105..bccff1a2 100644 --- a/src/app/creator/learn/[type]/[id]/StepThree.js +++ b/src/app/creator/learn/[type]/[id]/StepThree.js @@ -16,11 +16,11 @@ 'use client'; -import { PlusIcon } from '@heroicons/react/24/outline'; import { useState, useEffect, useMemo } from 'react'; import { toast } from 'react-toastify'; import { Button } from '@/components/Button'; +import { PlusIcon } from '@/components/icon/outlined'; import { EditIcon, DeleteIcon, AddIcon } from '@/components/Icons'; import { OEditor } from '@/components/MarkDown'; // import { useCourseDetails } from '#/services/learn/hooks' diff --git a/src/app/creator/learn/[type]/[id]/StepTwo.js b/src/app/creator/learn/[type]/[id]/StepTwo.js index 0b9a6075..d674ca2a 100644 --- a/src/app/creator/learn/[type]/[id]/StepTwo.js +++ b/src/app/creator/learn/[type]/[id]/StepTwo.js @@ -14,10 +14,10 @@ * limitations under the License. */ -import { PlusCircleIcon } from '@heroicons/react/20/solid'; -import { MinusCircleIcon } from '@heroicons/react/24/outline'; import { useState, useEffect } from 'react'; +import { MinusCircleIcon } from '@/components/icon/outlined'; +import { PlusCircleIcon } from '@/components/icon/solid'; import { OEditor } from '@/components/MarkDown'; import { BASE_INPUT_STYLE } from '@/constants/config'; diff --git a/src/app/creator/learn/[type]/[id]/page.js b/src/app/creator/learn/[type]/[id]/page.js index 5d9a8763..177ef5f8 100644 --- a/src/app/creator/learn/[type]/[id]/page.js +++ b/src/app/creator/learn/[type]/[id]/page.js @@ -16,7 +16,6 @@ 'use client'; -import { ChevronDoubleLeftIcon } from '@heroicons/react/20/solid'; import clsx from 'clsx'; // import Image from 'next/image' import Link from 'next/link'; @@ -25,6 +24,7 @@ import { useMemo, useState, useCallback, useEffect, useRef } from 'react'; import { toast } from 'react-toastify'; import { Button } from '@/components/Button'; +import { ChevronDoubleLeftIcon } from '@/components/icon/solid'; import { ArrowLeftIcon } from '@/components/Icons'; // import { useDebouncedCallback } from 'use-debounce' import { useAsyncState } from '@/hooks/useAsyncState'; diff --git a/src/app/dashboard/hire/page.js b/src/app/dashboard/hire/page.js index 248353dc..c3a7dabe 100644 --- a/src/app/dashboard/hire/page.js +++ b/src/app/dashboard/hire/page.js @@ -16,7 +16,6 @@ 'use client'; -import { Popover, Transition } from '@headlessui/react'; import { useConnectModal } from '@rainbow-me/rainbowkit'; import { readContract } from '@wagmi/core'; import Image from 'next/image'; @@ -25,6 +24,7 @@ import { useEffect, useState, Fragment, useCallback } from 'react'; import { toast } from 'react-toastify'; import { useWalletClient, useNetwork, useSwitchNetwork, useAccount } from 'wagmi'; +import { Popover, Transition } from '@/components/control'; import { EditIcon, ManageIcon, diff --git a/src/app/learn/ChallengesFilter.js b/src/app/learn/ChallengesFilter.js index 30f1b8d9..cce34408 100644 --- a/src/app/learn/ChallengesFilter.js +++ b/src/app/learn/ChallengesFilter.js @@ -16,12 +16,12 @@ 'use client'; -import { ChevronUpIcon, ChevronDownIcon } from '@heroicons/react/20/solid'; import clsx from 'clsx'; import Image from 'next/image'; import { useSearchParams, useRouter, usePathname } from 'next/navigation'; import { useState } from 'react'; +import { ChevronUpIcon, ChevronDownIcon } from '@/components/icon/solid'; import { createQueryString } from '@/utils'; import { challengesFilterList } from '#/lib/challengesFilterList'; diff --git a/src/app/learn/Chapters.js b/src/app/learn/Chapters.js index 1959c624..981bcccb 100644 --- a/src/app/learn/Chapters.js +++ b/src/app/learn/Chapters.js @@ -16,12 +16,12 @@ 'use client'; -import { LockClosedIcon } from '@heroicons/react/24/outline'; import BigNumber from 'bignumber.js'; import { useRouter } from 'next/navigation'; import { useMemo } from 'react'; import { toast } from 'react-toastify'; +import { LockClosedIcon } from '@/components/icon/outlined'; import { VideoIcon, AgreementIcon } from '@/components/Icons'; import { ProgressBar } from '@/components/ProgressBar'; import { millisecondFormat } from '@/utils/date'; diff --git a/src/app/learn/Top.js b/src/app/learn/Top.js index 8ad2aeb4..b6556d1e 100644 --- a/src/app/learn/Top.js +++ b/src/app/learn/Top.js @@ -16,9 +16,9 @@ 'use client'; -import { ChevronLeftIcon } from '@heroicons/react/20/solid'; import clsx from 'clsx'; +import { ChevronLeftIcon } from '@/components/icon/solid'; import { SearchIcon, FilterIcon } from '@/components/Icons'; import { Select } from '@/components/Select'; diff --git a/src/app/learn/[type]/[id]/Back.js b/src/app/learn/[type]/[id]/Back.js index ca3a82df..2184580c 100644 --- a/src/app/learn/[type]/[id]/Back.js +++ b/src/app/learn/[type]/[id]/Back.js @@ -16,10 +16,11 @@ 'use client'; -import { ArrowLeftIcon } from '@heroicons/react/24/solid'; import { useRouter, useSearchParams } from 'next/navigation'; import { useMemo } from 'react'; +import { ArrowLeftIcon } from '@/components/icon/solid'; + export function Back({params}) { const router = useRouter(); const searchParams = useSearchParams(); diff --git a/src/app/learn/[type]/[id]/GrowPath.js b/src/app/learn/[type]/[id]/GrowPath.js index 445c7cb1..9c49f4c6 100644 --- a/src/app/learn/[type]/[id]/GrowPath.js +++ b/src/app/learn/[type]/[id]/GrowPath.js @@ -15,8 +15,6 @@ */ 'use client'; -import { ClockIcon } from '@heroicons/react/24/outline'; -import { CheckCircleIcon } from '@heroicons/react/24/solid'; import clsx from 'clsx'; import { useSession } from 'next-auth/react'; import Image from 'next/image'; @@ -25,6 +23,8 @@ import { useState } from 'react'; import { toast } from 'react-toastify'; import { Button } from '@/components/Button'; +import { ClockIcon } from '@/components/icon/outlined'; +import { CheckCircleIcon } from '@/components/icon/solid'; import { Share } from '@/components/Share'; import { formatTime } from '@/utils/date'; diff --git a/src/app/learn/[type]/[id]/RightCard.js b/src/app/learn/[type]/[id]/RightCard.js index 7ebf8d9c..d329bbc1 100644 --- a/src/app/learn/[type]/[id]/RightCard.js +++ b/src/app/learn/[type]/[id]/RightCard.js @@ -16,10 +16,6 @@ 'use client'; -// import { getBalance } from '@wagmi/core' -// import { prepareWriteContract, writeContract } from '@wagmi/core' -import { Dialog, Transition } from '@headlessui/react'; -import { CheckIcon } from '@heroicons/react/20/solid'; import { useConnectModal } from '@rainbow-me/rainbowkit'; import { waitForTransaction } from '@wagmi/core'; import { writeContract } from '@wagmi/core'; @@ -38,6 +34,10 @@ import { toast } from 'react-toastify'; import { useAccount, useNetwork, useSwitchNetwork, erc20ABI } from 'wagmi'; import { Button } from '@/components/Button'; +// import { getBalance } from '@wagmi/core' +// import { prepareWriteContract, writeContract } from '@wagmi/core' +import { Dialog, Transition } from '@/components/control'; +import { CheckIcon } from '@/components/icon/solid'; import { USDTIcon } from '@/components/Icons'; import { TwitterIcon, DownloadIcon } from '@/components/Icons'; import { formatTime } from '@/utils/date'; diff --git a/src/app/learn/[type]/[id]/[chapter_id]/Content.js b/src/app/learn/[type]/[id]/[chapter_id]/Content.js index 4acae304..f7b3c3fe 100644 --- a/src/app/learn/[type]/[id]/[chapter_id]/Content.js +++ b/src/app/learn/[type]/[id]/[chapter_id]/Content.js @@ -16,11 +16,11 @@ 'use client'; -import { ChevronLeftIcon, ChevronRightIcon } from '@heroicons/react/24/outline'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useMemo } from 'react'; +import { ChevronLeftIcon, ChevronRightIcon } from '@/components/icon/outlined'; import { FilterIcon } from '@/components/Icons'; import { OViewer } from '@/components/MarkDown'; import { Player } from '@/components/Player'; diff --git a/src/app/learn/[type]/[id]/[chapter_id]/Menu.js b/src/app/learn/[type]/[id]/[chapter_id]/Menu.js index c8e78f8e..01e59a6f 100644 --- a/src/app/learn/[type]/[id]/[chapter_id]/Menu.js +++ b/src/app/learn/[type]/[id]/[chapter_id]/Menu.js @@ -17,11 +17,12 @@ /* eslint-disable jsx-a11y/anchor-is-valid */ 'use client'; -import { Transition } from '@headlessui/react'; -import { ListBulletIcon } from '@heroicons/react/24/outline'; import clsx from 'clsx'; import { useEffect, useState } from 'react'; +import { Transition } from '@/components/control'; +import { ListBulletIcon } from '@/components/icon/outlined'; + export function Menu() { const [anchors, setAnchors] = useState([]); const [isOpen, setIsOpen] = useState(false); diff --git a/src/app/learn/[type]/[id]/[chapter_id]/Steper.js b/src/app/learn/[type]/[id]/[chapter_id]/Steper.js index 3fabfbbd..a793992e 100644 --- a/src/app/learn/[type]/[id]/[chapter_id]/Steper.js +++ b/src/app/learn/[type]/[id]/[chapter_id]/Steper.js @@ -16,14 +16,13 @@ 'use client'; -import { XMarkIcon } from '@heroicons/react/20/solid'; -import { ChevronDoubleLeftIcon } from '@heroicons/react/20/solid'; import BigNumber from 'bignumber.js'; import { clsx } from 'clsx'; import { useRouter } from 'next/navigation'; import { useMemo } from 'react'; import { toast } from 'react-toastify'; +import { ChevronDoubleLeftIcon, XMarkIcon } from '@/components/icon/solid'; import { ContentIcon, ReadingIcon, ReadedIcon, BlackPointIcon, LockedIcon } from '@/components/Icons'; import { useMediaQuery } from '@/hooks/useMediaQuery'; diff --git a/src/app/profile/MySkill.js b/src/app/profile/MySkill.js index 75863432..b2ab8e6b 100644 --- a/src/app/profile/MySkill.js +++ b/src/app/profile/MySkill.js @@ -23,8 +23,8 @@ import { UploadIcon } from '@/components/Icons'; import Loader from '@/components/Loader'; import { Select } from '@/components/Select'; import { ReactSelect } from '@/components/Select/ReactSelect'; -// import { Transition } from '@headlessui/react' -// import { CheckIcon, XMarkIcon } from '@heroicons/react/20/solid' +// import { Transition } from '@/components/control'; +// import { CheckIcon, XMarkIcon } from '@/components/icon/solid' import { BASE_INPUT_STYLE } from '@/constants/config'; import { classNames } from '@/utils'; diff --git a/src/app/profile/SelectCountry.js b/src/app/profile/SelectCountry.js index af172c36..a2df8744 100644 --- a/src/app/profile/SelectCountry.js +++ b/src/app/profile/SelectCountry.js @@ -14,10 +14,10 @@ * limitations under the License. */ -import { Listbox, Transition } from '@headlessui/react'; -import { ChevronDownIcon, CheckIcon, XMarkIcon } from '@heroicons/react/20/solid'; import { Fragment } from 'react'; +import { Listbox, Transition } from '@/components/control'; +import { ChevronDownIcon, CheckIcon, XMarkIcon } from '@/components/icon/solid'; import { classNames } from '@/utils'; import { countries } from '#/lib/countries'; diff --git a/src/app/quiz/[id]/page.js b/src/app/quiz/[id]/page.js index b1598711..98660a48 100644 --- a/src/app/quiz/[id]/page.js +++ b/src/app/quiz/[id]/page.js @@ -16,7 +16,6 @@ 'use client'; -import { ArrowUturnLeftIcon } from '@heroicons/react/24/solid'; import { useSession } from 'next-auth/react'; import Image from 'next/image'; import { useRouter } from 'next/navigation'; @@ -25,6 +24,7 @@ import { useState } from 'react'; import useSWR from 'swr'; import { Button } from '@/components/Button'; +import { ArrowUturnLeftIcon } from '@/components/icon/solid'; import { HistoryIcon } from '@/components/Icons'; import { OViewer } from '@/components/MarkDown'; import { fetcher } from '@/utils/request'; diff --git a/src/domain/quiz/views/quiz-question-list/QuizComponents.js b/src/domain/quiz/views/quiz-question-list/QuizComponents.js index 5bcea3bb..a3eca41a 100644 --- a/src/domain/quiz/views/quiz-question-list/QuizComponents.js +++ b/src/domain/quiz/views/quiz-question-list/QuizComponents.js @@ -14,12 +14,12 @@ * limitations under the License. */ -import { XMarkIcon, ChevronLeftIcon } from '@heroicons/react/20/solid'; import Link from 'next/link'; import { useEffect, useMemo, useState } from 'react'; import { toast } from 'react-toastify'; import { Button } from '@/components/Button'; +import { XMarkIcon, ChevronLeftIcon } from '@/components/icon/solid'; import { post } from '@/utils/request'; import { fetchAnsweredResult } from '../../repository'; diff --git a/src/entry/components/Header/Mobile.js b/src/entry/components/Header/Mobile.js index 7649ee30..c629203b 100644 --- a/src/entry/components/Header/Mobile.js +++ b/src/entry/components/Header/Mobile.js @@ -14,11 +14,11 @@ * limitations under the License. */ -import { Bars3Icon } from '@heroicons/react/24/outline'; import Image from 'next/image'; import Link from 'next/link'; import Logo from 'public/images/svg/logo-black.svg'; +import { Bars3Icon } from '@/components/icon/outlined'; // import { LanguageSwither } from './languageSwitcher' import { classNames } from '@/utils'; diff --git a/src/entry/components/Header/Navs.js b/src/entry/components/Header/Navs.js index 839a8d25..73ca7d5e 100644 --- a/src/entry/components/Header/Navs.js +++ b/src/entry/components/Header/Navs.js @@ -16,7 +16,6 @@ 'use client'; -import { ChevronDownIcon, Bars3Icon, ChevronRightIcon, XMarkIcon } from '@heroicons/react/20/solid'; import clsx from 'clsx'; import Image from 'next/image'; import Link from 'next/link'; @@ -24,6 +23,7 @@ import { usePathname } from 'next/navigation'; import Logo from 'public/images/svg/logo-black.svg'; import { useEffect, useState } from 'react'; +import { ChevronDownIcon, Bars3Icon, ChevronRightIcon, XMarkIcon } from '@/components/icon/solid'; import { useHeaderAndFooterDisplay } from '@/hooks/useHeaderAndFooterDisplay'; import Account from './Account'; diff --git a/src/entry/components/Toast/index.js b/src/entry/components/Toast/index.js index d7428f57..2efee6aa 100644 --- a/src/entry/components/Toast/index.js +++ b/src/entry/components/Toast/index.js @@ -15,8 +15,9 @@ */ 'use client'; -import { XMarkIcon } from '@heroicons/react/24/outline'; import { ToastContainer } from 'react-toastify'; + +import { XMarkIcon } from '@/components/icon/outlined'; export function Toast() { return ( { return ; }; diff --git a/src/shared/components/Filter/index.js b/src/shared/components/Filter/index.js index 327652eb..5da5aefe 100644 --- a/src/shared/components/Filter/index.js +++ b/src/shared/components/Filter/index.js @@ -16,7 +16,6 @@ 'use client'; -import { ChevronUpIcon, XMarkIcon, ChevronLeftIcon } from '@heroicons/react/20/solid'; import clsx from 'clsx'; import { motion } from 'framer-motion'; import Image from 'next/image'; @@ -30,6 +29,8 @@ import { useConfig, useMediaUrl, useOpenFilter } from '#/state/application/hooks import { updateOpenFilter } from '#/state/application/reducer'; import { useAppDispatch } from '#/state/hooks'; +import { ChevronUpIcon, XMarkIcon, ChevronLeftIcon } from '../icon/solid'; + export function Filter({ type, children }) { const config = useConfig(); const openFilter = useOpenFilter(); diff --git a/src/shared/components/Modal/index.js b/src/shared/components/Modal/index.js index e1bf1275..050c1158 100644 --- a/src/shared/components/Modal/index.js +++ b/src/shared/components/Modal/index.js @@ -14,11 +14,11 @@ * limitations under the License. */ -import { Dialog, Transition } from '@headlessui/react'; import clsx from 'clsx'; import React, { Fragment } from 'react'; import { isFunction } from '../../utils'; +import { Dialog, Transition } from '../control/headlessui'; export function Modal({ isOpen, diff --git a/src/shared/components/Popover/index.js b/src/shared/components/Popover/index.js index 13cdb7cb..e4391d57 100644 --- a/src/shared/components/Popover/index.js +++ b/src/shared/components/Popover/index.js @@ -14,7 +14,6 @@ * limitations under the License. */ -import { Popover as HeadlessuiPopover } from '@headlessui/react'; import React, { Fragment, useCallback, useEffect, useState } from 'react'; import ReactDOM from 'react-dom'; import { usePopper } from 'react-popper'; @@ -22,6 +21,8 @@ import { usePopper } from 'react-popper'; import useInterval from '@/hooks/useInterval'; import { classNames } from '@/utils'; +import { Popover as HeadlessuiPopover } from '../control/headlessui'; + export default function Popover({ content, children, placement = 'auto', show, modifiers }) { const [referenceElement, setReferenceElement] = useState(null); const [popperElement, setPopperElement] = useState(null); diff --git a/src/shared/components/ReactSelectComponents/index.js b/src/shared/components/ReactSelectComponents/index.js index 71d5058a..74589ce7 100644 --- a/src/shared/components/ReactSelectComponents/index.js +++ b/src/shared/components/ReactSelectComponents/index.js @@ -14,10 +14,11 @@ * limitations under the License. */ -import { XMarkIcon, ChevronDownIcon } from '@heroicons/react/20/solid'; import React from 'react'; import { components } from 'react-select'; +import { XMarkIcon, ChevronDownIcon } from '../icon/solid'; + export const DropdownIndicator = props => { return ( diff --git a/src/shared/components/Select/ReactSelect.js b/src/shared/components/Select/ReactSelect.js index dc68cc65..9e0dde35 100644 --- a/src/shared/components/Select/ReactSelect.js +++ b/src/shared/components/Select/ReactSelect.js @@ -14,13 +14,13 @@ * limitations under the License. */ -import { XMarkIcon, ChevronDownIcon } from '@heroicons/react/20/solid'; import React from 'react'; import Select, { components } from 'react-select'; import { classNames } from '@/utils'; import { isInteger, isFunction } from '../../utils'; +import { XMarkIcon, ChevronDownIcon } from '../icon/solid'; export const DropdownIndicator = props => { return ( diff --git a/src/shared/components/Select/index.js b/src/shared/components/Select/index.js index 8f9db0e0..8c9fb820 100644 --- a/src/shared/components/Select/index.js +++ b/src/shared/components/Select/index.js @@ -16,14 +16,15 @@ 'use client'; -import { Listbox, Transition } from '@headlessui/react'; -import { ChevronDownIcon, XMarkIcon } from '@heroicons/react/20/solid'; import clsx from 'clsx'; import Image from 'next/image'; import { Fragment } from 'react'; import { classNames } from '@/utils'; +import { Listbox, Transition } from '../control/headlessui'; +import { ChevronDownIcon, XMarkIcon } from '../icon/solid'; + export function Select({ placeholder, options, selected, change, className, hasArrow = true }) { return ( diff --git a/src/shared/components/SelectSkills/index.js b/src/shared/components/SelectSkills/index.js index 8745be01..c46604db 100644 --- a/src/shared/components/SelectSkills/index.js +++ b/src/shared/components/SelectSkills/index.js @@ -15,8 +15,7 @@ */ 'use client'; -import { Transition } from '@headlessui/react'; -import { CheckIcon, XMarkIcon } from '@heroicons/react/20/solid'; + import { useMemo, useState, Fragment, useEffect } from 'react'; import { classNames, arrRemove } from '@/utils'; @@ -24,6 +23,9 @@ import { classNames, arrRemove } from '@/utils'; import { baseInputStyles } from '#/domain/profile/widgets/blocks'; import { useConfig } from '#/state/application/hooks'; +import { Transition } from '../control/headlessui'; +import { CheckIcon, XMarkIcon } from '../icon/solid'; + export default function SelectSkills({ skills, setSkills }) { const config = useConfig(); diff --git a/src/shared/components/Share/index.js b/src/shared/components/Share/index.js index dea50059..e4f60004 100644 --- a/src/shared/components/Share/index.js +++ b/src/shared/components/Share/index.js @@ -16,7 +16,6 @@ 'use client'; -import { ArrowLeftIcon } from '@heroicons/react/24/outline'; import clsx from 'clsx'; import copy from 'copy-to-clipboard'; import Image from 'next/image'; @@ -39,6 +38,7 @@ import { resolvePathWithSearch } from '@/utils/url'; import { useMediaUrl, useUser } from '#/state/application/hooks'; import { Button } from '../Button'; +import { ArrowLeftIcon } from '../icon/outlined'; const combineUrl = (type, user_code, summary) => { let baseUrl = ''; @@ -69,7 +69,7 @@ export function Share({ img, title, type, id, excerpt }) { } }, [user, pathname, searchParams]); const { data, isLoading } = useSWR((id && recordOpen) ? `ts/v1/user/invite/export?type=challenges&id=${id}` : null, fetcher); - + const invitationRecordsAvailable = type === 'challenges'; const handleViewRecords = invitationRecordsAvailable ? () => { if (user) { diff --git a/src/shared/components/Switch/index.js b/src/shared/components/Switch/index.js index a3cbc06f..f0073e59 100644 --- a/src/shared/components/Switch/index.js +++ b/src/shared/components/Switch/index.js @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Switch as HeadlessuiSwitch } from '@headlessui/react'; +import { Switch as HeadlessuiSwitch } from '../control/headlessui'; const Switch = ({ checked, onChange }) => { return ( diff --git a/src/shared/components/Tooltip/index.js b/src/shared/components/Tooltip/index.js index d3265adf..1bf9c439 100644 --- a/src/shared/components/Tooltip/index.js +++ b/src/shared/components/Tooltip/index.js @@ -16,9 +16,8 @@ import React, { useCallback, useState } from 'react'; -import { classNames } from '@/utils'; -// import { PlayCircleIcon } from '@heroicons/react/20/solid' - +import { classNames } from '../../utils/index'; +// import { PlayCircleIcon } from '../icon/solid'; import Popover from '../Popover'; export default function Tooltip({ text, children, className, ...rest }) { diff --git a/src/shared/components/control/headlessui.js b/src/shared/components/control/headlessui.js new file mode 100644 index 00000000..0938442f --- /dev/null +++ b/src/shared/components/control/headlessui.js @@ -0,0 +1,17 @@ +/** + * Copyright 2024 OpenBuild + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { Disclosure, Popover, Dialog, Listbox, Transition } from '@headlessui/react'; diff --git a/src/shared/components/control/index.js b/src/shared/components/control/index.js new file mode 100644 index 00000000..1922b1ca --- /dev/null +++ b/src/shared/components/control/index.js @@ -0,0 +1,17 @@ +/** + * Copyright 2024 OpenBuild + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './headlessui'; diff --git a/src/shared/components/icon/outlined.js b/src/shared/components/icon/outlined.js new file mode 100644 index 00000000..f5f4e8a8 --- /dev/null +++ b/src/shared/components/icon/outlined.js @@ -0,0 +1,28 @@ +/** + * Copyright 2024 OpenBuild + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { + ArrowLeftIcon, ArrowDownTrayIcon, + EyeIcon, EyeSlashIcon, + PlusIcon, MinusCircleIcon, + ChevronLeftIcon, ChevronRightIcon, + CalendarDaysIcon, + LockClosedIcon, + ClockIcon, + ListBulletIcon, + Bars3Icon, + XMarkIcon, +} from '@heroicons/react/24/outline'; diff --git a/src/shared/components/icon/solid.js b/src/shared/components/icon/solid.js new file mode 100644 index 00000000..37f6c8e9 --- /dev/null +++ b/src/shared/components/icon/solid.js @@ -0,0 +1,24 @@ +/** + * Copyright 2024 OpenBuild + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { + ChevronUpIcon, ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon, ChevronDoubleLeftIcon, + ArrowLeftIcon, ArrowUturnLeftIcon, ArrowRightIcon, ArrowRightOnRectangleIcon, + CheckIcon, CheckCircleIcon, PlusIcon, PlusCircleIcon, MinusCircleIcon, + XMarkIcon, + PlayCircleIcon, + Bars3Icon, +} from '@heroicons/react/20/solid';