From 7144609479feff796fc0e8587842fd03e1439efd Mon Sep 17 00:00:00 2001 From: lifeparticle Date: Sun, 5 Nov 2023 18:02:27 +1100 Subject: [PATCH] see changelog --- ui/CHANGELOG.md | 6 + ui/src/App.tsx | 5 +- .../General/ClipboardButton/index.tsx | 3 +- .../CodeEditor/components/ValidateStatus.tsx | 2 +- .../General/CodeHighlightWithCopy/index.tsx | 4 +- .../General/ColorPickerWithInput/index.tsx | 2 +- ui/src/components/General/Drawer/index.tsx | 2 +- .../General/DropdownDownloadButton/index.tsx | 3 +- .../FormComponents/ResponsiveButton.tsx | 12 ++ .../ResponsiveDropdownButton.tsx | 14 +++ .../ResponsiveInputWithLabel.tsx | 40 +++++++ .../ResponsiveSegementWithLabel.tsx | 24 ++++ .../ResponsiveSelectWithLabel.tsx | 23 ++++ .../General/FormComponents/index.tsx | 106 ------------------ ui/src/components/General/HelpIcon/index.tsx | 2 +- .../General/ListItems/News/News.tsx | 2 +- .../General/ListItems/Resource/Resource.tsx | 6 +- .../components/NotificationList.tsx | 3 +- .../components/General/PopupSearch/index.tsx | 2 +- ui/src/components/General/Search/helper.ts | 2 +- .../General/Text/{Text.tsx => index.tsx} | 0 ui/src/components/General/Warning/index.tsx | 2 +- ui/src/components/General/index.ts | 33 ++++++ ui/src/components/Hoc/index.ts | 5 + .../{withLabelSize.tsx => index.tsx} | 0 .../{withPageTitle.tsx => index.tsx} | 26 ++++- .../{utils/hooks.ts => usePageTitle.ts} | 0 .../Hoc/withPageTitle/utils/constants.ts | 19 ---- .../Hoc/withSize/{withSize.tsx => index.tsx} | 0 .../components/Layouts/FloatingBar/index.tsx | 3 +- .../Layouts/FloatingHeader/index.tsx | 2 +- .../Layouts/FloatingSearchBar/index.tsx | 2 +- ui/src/components/Layouts/Footer/index.tsx | 3 +- .../Layouts/Menu/{utils => }/helper.tsx | 8 +- ui/src/components/Layouts/Menu/index.tsx | 9 +- ui/src/components/Layouts/Menu/utils/types.ts | 6 - .../Layouts/Sidebar/Footer/Footer.module.scss | 37 ------ .../Layouts/Sidebar/Footer/utils/types.ts | 8 -- .../Layouts/Sidebar/Sidebar.module.scss | 38 +++++++ .../tests => __tests__}/Footer.test.tsx | 2 +- .../Sidebar/{Footer => components}/index.tsx | 12 +- ui/src/components/Layouts/Sidebar/index.tsx | 5 +- .../Layouts/Sidebar/utils/constants.ts | 3 - ui/src/components/Layouts/index.ts | 12 ++ ui/src/data/menuData.ts | 4 +- ui/src/hooks/useGetNotifications.tsx | 3 +- ui/src/pages/About/components/Credits.tsx | 4 +- ui/src/pages/About/components/Support.tsx | 2 +- ui/src/pages/About/index.tsx | 2 +- ui/src/pages/Automation/GithubIssue/index.tsx | 6 +- ui/src/pages/CSS/BorderRadius/index.tsx | 9 +- ui/src/pages/CSS/BoxShadow/index.tsx | 9 +- .../ColorPicker/components/DisplayColor.tsx | 5 +- .../ColorPicker/components/DisplayColors.tsx | 4 +- ui/src/pages/Colors/ColorPicker/index.tsx | 7 +- .../ShadesAndTints/components/ColorInputs.tsx | 10 +- .../ShadesAndTints/components/Colors.tsx | 4 +- ui/src/pages/Colors/ShadesAndTints/index.tsx | 2 +- ui/src/pages/Converter/Base64/index.tsx | 7 +- ui/src/pages/Converter/File/index.tsx | 4 +- .../JsonToTypescript.test.tsx | 0 .../JsonToTypescript/{utils => }/helper.ts | 0 .../Converter/JsonToTypescript/index.tsx | 12 +- ui/src/pages/Converter/Pixel/index.tsx | 8 +- ui/src/pages/Converter/Svg/index.tsx | 5 +- ui/src/pages/Feedback/index.tsx | 2 +- ui/src/pages/Footer/CookieConsent/index.tsx | 2 +- ui/src/pages/Footer/CookiePolicy/index.tsx | 3 +- ui/src/pages/Footer/PrivacyPolicy/index.tsx | 3 +- ui/src/pages/Footer/Terms/index.tsx | 3 +- ui/src/pages/Generator/Avatar/index.tsx | 11 +- .../Generator/Data/components/Output.tsx | 2 +- ui/src/pages/Generator/Data/index.tsx | 7 +- ui/src/pages/Generator/Image/index.tsx | 7 +- .../QRcode/{ => __tests__}/QRcode.test.tsx | 2 +- .../QRcode/components/QRCodeErrorBoundary.tsx | 2 +- ui/src/pages/Generator/QRcode/index.tsx | 14 ++- ui/src/pages/Home/components/Contribution.tsx | 2 +- ui/src/pages/Home/components/Features.tsx | 2 +- ui/src/pages/Home/components/Hero.tsx | 2 +- ui/src/pages/Home/index.tsx | 2 +- .../Mimetype/components/SearchBar.tsx | 2 +- .../Information/Mimetype/utils/constants.tsx | 2 +- .../pages/Information/Npmpackages/index.tsx | 2 +- ui/src/pages/Markdown/Editor/index.tsx | 5 +- .../pages/Markdown/TableGenerator/index.tsx | 5 +- .../__tests__/TableOfContent.test.tsx | 2 +- .../pages/Markdown/TableOfContent/index.tsx | 13 ++- ui/src/pages/Newsfeed/index.tsx | 4 +- ui/src/pages/Resource/Blog/index.tsx | 4 +- ui/src/pages/Resource/Book/index.tsx | 4 +- ui/src/pages/Resource/Course/index.tsx | 4 +- ui/src/pages/Resource/DesignSystem/index.tsx | 4 +- ui/src/pages/Resource/Github/index.tsx | 4 +- .../Icon/{tests => __tests__}/icon.test.tsx | 0 ui/src/pages/Resource/Icon/index.tsx | 4 +- ui/src/pages/Resource/Interview/index.tsx | 4 +- ui/src/pages/Resource/Movie/index.tsx | 4 +- ui/src/pages/Resource/Platform/index.tsx | 4 +- ui/src/pages/Resource/Plugin/index.tsx | 4 +- ui/src/pages/Resource/Tool/index.tsx | 4 +- ui/src/pages/Resource/TvSeries/index.tsx | 4 +- ui/src/pages/Resource/UiUx/index.tsx | 4 +- ui/src/pages/Resource/YouTube/index.tsx | 4 +- ui/src/pages/Text/TextEditor/index.tsx | 2 +- ui/src/pages/Tools/CodeFormatter/index.tsx | 11 +- ui/src/pages/Tools/Diffchecker/index.tsx | 4 +- ui/src/pages/Tools/Sorting/index.tsx | 11 +- ui/src/routes/index.tsx | 4 +- .../{ DataDetection.ts => DataDetection.ts} | 0 110 files changed, 411 insertions(+), 383 deletions(-) create mode 100644 ui/src/components/General/FormComponents/ResponsiveButton.tsx create mode 100644 ui/src/components/General/FormComponents/ResponsiveDropdownButton.tsx create mode 100644 ui/src/components/General/FormComponents/ResponsiveInputWithLabel.tsx create mode 100644 ui/src/components/General/FormComponents/ResponsiveSegementWithLabel.tsx create mode 100644 ui/src/components/General/FormComponents/ResponsiveSelectWithLabel.tsx delete mode 100644 ui/src/components/General/FormComponents/index.tsx rename ui/src/components/General/Text/{Text.tsx => index.tsx} (100%) create mode 100644 ui/src/components/General/index.ts create mode 100644 ui/src/components/Hoc/index.ts rename ui/src/components/Hoc/withLabelSize/{withLabelSize.tsx => index.tsx} (100%) rename ui/src/components/Hoc/withPageTitle/{withPageTitle.tsx => index.tsx} (81%) rename ui/src/components/Hoc/withPageTitle/{utils/hooks.ts => usePageTitle.ts} (100%) delete mode 100644 ui/src/components/Hoc/withPageTitle/utils/constants.ts rename ui/src/components/Hoc/withSize/{withSize.tsx => index.tsx} (100%) rename ui/src/components/Layouts/Menu/{utils => }/helper.tsx (74%) delete mode 100644 ui/src/components/Layouts/Menu/utils/types.ts delete mode 100644 ui/src/components/Layouts/Sidebar/Footer/Footer.module.scss delete mode 100644 ui/src/components/Layouts/Sidebar/Footer/utils/types.ts rename ui/src/components/Layouts/Sidebar/{Footer/tests => __tests__}/Footer.test.tsx (93%) rename ui/src/components/Layouts/Sidebar/{Footer => components}/index.tsx (87%) delete mode 100644 ui/src/components/Layouts/Sidebar/utils/constants.ts create mode 100644 ui/src/components/Layouts/index.ts rename ui/src/pages/Converter/JsonToTypescript/{tests => __tests__}/JsonToTypescript.test.tsx (100%) rename ui/src/pages/Converter/JsonToTypescript/{utils => }/helper.ts (100%) rename ui/src/pages/Generator/QRcode/{ => __tests__}/QRcode.test.tsx (94%) rename ui/src/pages/Resource/Icon/{tests => __tests__}/icon.test.tsx (100%) rename ui/src/utils/helper-classes/{ DataDetection.ts => DataDetection.ts} (100%) diff --git a/ui/CHANGELOG.md b/ui/CHANGELOG.md index 523ab02f..9f3ab6b8 100644 --- a/ui/CHANGELOG.md +++ b/ui/CHANGELOG.md @@ -1,3 +1,9 @@ +### [7.1.1] - 2023-10-31 + +- Organise components exports and imports +- Rename `tests` to `__tests__` +- Organise files + ### [7.1.0] - 2023-10-31 - useCombinedKeyPress hook diff --git a/ui/src/App.tsx b/ui/src/App.tsx index fa5ccc81..54d57cc7 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -1,11 +1,10 @@ import { ConfigProvider, Layout } from "antd"; import { ErrorBoundary } from "react-error-boundary"; import RoutesWithPageTitle from "routes"; -import Sidebar from "components/Layouts/Sidebar"; +import { Sidebar, FloatingBar } from "components/Layouts"; import CookieConsent from "pages/Footer/CookieConsent"; import useTheme from "hooks/useTheme"; -import PopupSearch from "components/General/PopupSearch"; -import FloatingBar from "components/Layouts/FloatingBar"; +import { PopupSearch } from "components/General"; const { Content } = Layout; diff --git a/ui/src/components/General/ClipboardButton/index.tsx b/ui/src/components/General/ClipboardButton/index.tsx index 10cb55a3..273bea3f 100644 --- a/ui/src/components/General/ClipboardButton/index.tsx +++ b/ui/src/components/General/ClipboardButton/index.tsx @@ -1,6 +1,5 @@ -import { ResponsiveButton } from "components/General/FormComponents"; +import { Icon, ResponsiveButton } from "components/General"; import style from "./ClipboardButton.module.scss"; -import Icon from "components/General/Icon"; interface ClipboardButtonProps { copyToClipboard: (text: string) => void; diff --git a/ui/src/components/General/CodeEditor/components/ValidateStatus.tsx b/ui/src/components/General/CodeEditor/components/ValidateStatus.tsx index 86fc0a35..1650dd5d 100644 --- a/ui/src/components/General/CodeEditor/components/ValidateStatus.tsx +++ b/ui/src/components/General/CodeEditor/components/ValidateStatus.tsx @@ -1,8 +1,8 @@ import { Space, theme } from "antd"; import React from "react"; import style from "components/General/CodeEditor/CodeEditor.module.scss"; -import Icon from "components/General/Icon"; import { ValidateStatusProps } from "./utils/types"; +import { Icon } from "components/General"; const ValidateStatus: React.FC = ({ status }) => { if (status.length === 0) { diff --git a/ui/src/components/General/CodeHighlightWithCopy/index.tsx b/ui/src/components/General/CodeHighlightWithCopy/index.tsx index 9821079e..628ab73f 100644 --- a/ui/src/components/General/CodeHighlightWithCopy/index.tsx +++ b/ui/src/components/General/CodeHighlightWithCopy/index.tsx @@ -1,6 +1,6 @@ -import Clipboard from "components/RenderProps/Clipboard"; +import { Clipboard } from "components/RenderProps"; import SyntaxHighlighter from "react-syntax-highlighter"; -import ClipboardButton from "components/General/ClipboardButton"; +import { ClipboardButton } from "components/General"; import { obsidian, stackoverflowLight, diff --git a/ui/src/components/General/ColorPickerWithInput/index.tsx b/ui/src/components/General/ColorPickerWithInput/index.tsx index c0a91a3f..a2662297 100644 --- a/ui/src/components/General/ColorPickerWithInput/index.tsx +++ b/ui/src/components/General/ColorPickerWithInput/index.tsx @@ -1,5 +1,5 @@ import { Card } from "antd"; -import { ResponsiveInputWithLabel } from "components/General/FormComponents"; +import { ResponsiveInputWithLabel } from "components/General"; import { ColorPicker as CP } from "@mantine/core"; import style from "./ColorPickerWithInput.module.scss"; diff --git a/ui/src/components/General/Drawer/index.tsx b/ui/src/components/General/Drawer/index.tsx index 1801e010..e146b68f 100644 --- a/ui/src/components/General/Drawer/index.tsx +++ b/ui/src/components/General/Drawer/index.tsx @@ -1,7 +1,7 @@ import React, { useState } from "react"; import { Drawer as AntDDrawer, Button, Space } from "antd"; import { useNavigate, useSearchParams } from "react-router-dom"; -import { ResponsiveButton } from "components/General/FormComponents"; +import { ResponsiveButton } from "components/General"; import { BeamDetail } from "data/beamData"; interface DrawerProps { diff --git a/ui/src/components/General/DropdownDownloadButton/index.tsx b/ui/src/components/General/DropdownDownloadButton/index.tsx index 7691cce3..d45c6db2 100644 --- a/ui/src/components/General/DropdownDownloadButton/index.tsx +++ b/ui/src/components/General/DropdownDownloadButton/index.tsx @@ -1,6 +1,5 @@ import React from "react"; -import { ResponsiveDropdownButton } from "components/General/FormComponents"; -import Icon from "components/General/Icon"; +import { Icon, ResponsiveDropdownButton } from "components/General"; import { MenuProps } from "antd"; const IMAGE_TYPE = { diff --git a/ui/src/components/General/FormComponents/ResponsiveButton.tsx b/ui/src/components/General/FormComponents/ResponsiveButton.tsx new file mode 100644 index 00000000..763e2cc2 --- /dev/null +++ b/ui/src/components/General/FormComponents/ResponsiveButton.tsx @@ -0,0 +1,12 @@ +// import withSize from "components/Hoc/withSize"; +import React from "react"; +import { withSize } from "components/Hoc"; +import { Button as AntButton } from "antd"; +import { ButtonProps } from "antd/es/button"; + +const Button: React.FC = ({ children, ...props }) => { + return {children}; +}; + +const ResponsiveButton = withSize(Button); +export default ResponsiveButton; diff --git a/ui/src/components/General/FormComponents/ResponsiveDropdownButton.tsx b/ui/src/components/General/FormComponents/ResponsiveDropdownButton.tsx new file mode 100644 index 00000000..2bae4fe7 --- /dev/null +++ b/ui/src/components/General/FormComponents/ResponsiveDropdownButton.tsx @@ -0,0 +1,14 @@ +import { Dropdown } from "antd"; +import React from "react"; +import { withSize } from "components/Hoc"; +import { DropdownButtonProps } from "antd/es/dropdown"; + +const DropdownButton: React.FC = ({ + children, + ...props +}) => { + return {children}; +}; + +const ResponsiveDropdownButton = withSize(DropdownButton); +export default ResponsiveDropdownButton; diff --git a/ui/src/components/General/FormComponents/ResponsiveInputWithLabel.tsx b/ui/src/components/General/FormComponents/ResponsiveInputWithLabel.tsx new file mode 100644 index 00000000..3d0027d9 --- /dev/null +++ b/ui/src/components/General/FormComponents/ResponsiveInputWithLabel.tsx @@ -0,0 +1,40 @@ +import { Input, InputNumber } from "antd"; +import React, { ReactNode } from "react"; +import { withLabelSize } from "components/Hoc"; + +type NumberType = { + type: "number"; + value: number; + onChange: (value: number | null) => void; +}; + +type TextType = { + type: "text"; + value: string; + onChange: (value: React.ChangeEvent) => void; +}; + +type InputComponentProps = { + label: string; + precision?: number; + min?: number; + max?: number; + step?: number; + tooltip?: string; + placeholder?: string; + addonBefore?: ReactNode; + addonAfter?: ReactNode; + style?: React.CSSProperties; +} & (NumberType | TextType); + +const ResponsiveInput: React.FC = (props) => { + return props.type === "number" ? ( + + ) : ( + + ); +}; + +const ResponsiveInputWithLabel = withLabelSize(ResponsiveInput); + +export default ResponsiveInputWithLabel; diff --git a/ui/src/components/General/FormComponents/ResponsiveSegementWithLabel.tsx b/ui/src/components/General/FormComponents/ResponsiveSegementWithLabel.tsx new file mode 100644 index 00000000..a3be495e --- /dev/null +++ b/ui/src/components/General/FormComponents/ResponsiveSegementWithLabel.tsx @@ -0,0 +1,24 @@ +import { Segmented } from "antd"; +import React from "react"; +import { withLabelSize } from "components/Hoc"; + +interface Option { + value: string; + label: string; +} + +interface SegmentComponentProps { + label?: string; + value: string; + onChange: (value: string | number) => void; + options: Option[]; +} + +const ResponsiveSegment: React.FC = (props) => { + return ; +}; + +const ResponsiveSegementWithLabel = withLabelSize(ResponsiveSegment); + +export default ResponsiveSegementWithLabel; +ResponsiveSegementWithLabel; diff --git a/ui/src/components/General/FormComponents/ResponsiveSelectWithLabel.tsx b/ui/src/components/General/FormComponents/ResponsiveSelectWithLabel.tsx new file mode 100644 index 00000000..dbd7e665 --- /dev/null +++ b/ui/src/components/General/FormComponents/ResponsiveSelectWithLabel.tsx @@ -0,0 +1,23 @@ +import { Select } from "antd"; +import React from "react"; +import { withLabelSize } from "components/Hoc"; + +interface Option { + value: string; + label: string; +} + +interface SelectComponentProps { + label?: string; + value?: string; + defaultActiveFirstOption?: boolean; + onSelect?: (value: string, option: Option) => void; + options: Option[]; +} + +const ResponsiveSelect: React.FC = (props) => { + return ; -}; - -const ResponsiveSegment: React.FC = (props) => { - return ; -}; - -const ResponsiveInput: React.FC = (props) => { - return props.type === "number" ? ( - - ) : ( - - ); -}; - -const Button: React.FC = ({ children, ...props }) => { - return {children}; -}; - -const DropdownButton: React.FC = ({ - children, - ...props -}) => { - return {children}; -}; -const ResponsiveSelectWithLabel = withLabelSize(ResponsiveSelect); -const ResponsiveSegementWithLabel = withLabelSize(ResponsiveSegment); -const ResponsiveInputWithLabel = withLabelSize(ResponsiveInput); -const ResponsiveButton = withSize(Button); -const ResponsiveDropdownButton = withSize(DropdownButton); - -export { - ResponsiveSelectWithLabel, - ResponsiveSegementWithLabel, - ResponsiveInputWithLabel, - ResponsiveButton, - ResponsiveDropdownButton, -}; diff --git a/ui/src/components/General/HelpIcon/index.tsx b/ui/src/components/General/HelpIcon/index.tsx index bd9a6fef..f133db5a 100644 --- a/ui/src/components/General/HelpIcon/index.tsx +++ b/ui/src/components/General/HelpIcon/index.tsx @@ -1,8 +1,8 @@ import React, { useState } from "react"; import { Button, Modal } from "antd"; -import Icon from "components/General/Icon"; import Help from "./components/Help"; import { HelpEntry } from "data/helpData"; +import { Icon } from "components/General"; interface HelpIconProps { helpObject: HelpEntry; diff --git a/ui/src/components/General/ListItems/News/News.tsx b/ui/src/components/General/ListItems/News/News.tsx index 80372e2a..8a6bfce3 100644 --- a/ui/src/components/General/ListItems/News/News.tsx +++ b/ui/src/components/General/ListItems/News/News.tsx @@ -1,5 +1,5 @@ import { Card, Image, Skeleton, Space, Typography } from "antd"; -import { ListItemProps } from "components/RenderProps/List"; +import { ListItemProps } from "components/RenderProps"; const { Title } = Typography; export interface NewsType { diff --git a/ui/src/components/General/ListItems/Resource/Resource.tsx b/ui/src/components/General/ListItems/Resource/Resource.tsx index 15b64add..d0c2c884 100644 --- a/ui/src/components/General/ListItems/Resource/Resource.tsx +++ b/ui/src/components/General/ListItems/Resource/Resource.tsx @@ -1,8 +1,8 @@ import { Avatar, Card, Skeleton, Space, Tag, Typography } from "antd"; import style from "./Resource.module.scss"; -import Clipboard from "components/RenderProps/Clipboard"; -import ClipboardButton from "components/General/ClipboardButton"; -import { ListItemProps } from "components/RenderProps/List"; +import { Clipboard } from "components/RenderProps"; +import { ClipboardButton } from "components/General"; +import { ListItemProps } from "components/RenderProps"; const { Title } = Typography; diff --git a/ui/src/components/General/Notification/components/NotificationList.tsx b/ui/src/components/General/Notification/components/NotificationList.tsx index 2813b242..51ac3e33 100644 --- a/ui/src/components/General/Notification/components/NotificationList.tsx +++ b/ui/src/components/General/Notification/components/NotificationList.tsx @@ -1,9 +1,8 @@ import style from "components/General/Notification/Notification.module.scss"; import { Button, Skeleton } from "antd"; import { Typography, Tag, Dropdown } from "antd"; -import Icon from "components/General/Icon"; +import { Icon, Markdown } from "components/General"; import { classNames } from "utils/helper-functions/string"; -import { Markdown } from "components/General/Notification/types"; const { Title } = Typography; interface NotificationListProps { diff --git a/ui/src/components/General/PopupSearch/index.tsx b/ui/src/components/General/PopupSearch/index.tsx index 738f0690..debdc4c9 100644 --- a/ui/src/components/General/PopupSearch/index.tsx +++ b/ui/src/components/General/PopupSearch/index.tsx @@ -3,7 +3,7 @@ import { MENU_ITEMS } from "data/menuData"; import React, { useEffect, useRef, useState } from "react"; import { useNavigate } from "react-router-dom"; import style from "./PopSearch.module.scss"; -import Icon, { IconName } from "components/General/Icon"; +import { Icon, IconName } from "components/General"; import useCombinedKeyPress from "hooks/useCombinedKeyPress"; import { classNames } from "utils/helper-functions/string"; import useMode from "hooks/useMode"; diff --git a/ui/src/components/General/Search/helper.ts b/ui/src/components/General/Search/helper.ts index bf58cd36..86671869 100644 --- a/ui/src/components/General/Search/helper.ts +++ b/ui/src/components/General/Search/helper.ts @@ -1,5 +1,5 @@ import { QUERY_KEY_NEWS } from "pages/Newsfeed/utils/constants"; -import { ResourceType } from "../ListItems/Resource/Resource"; +import { ResourceType } from "components/General"; const getCategories = ( items: T[], diff --git a/ui/src/components/General/Text/Text.tsx b/ui/src/components/General/Text/index.tsx similarity index 100% rename from ui/src/components/General/Text/Text.tsx rename to ui/src/components/General/Text/index.tsx diff --git a/ui/src/components/General/Warning/index.tsx b/ui/src/components/General/Warning/index.tsx index 9403d7de..435a82ad 100644 --- a/ui/src/components/General/Warning/index.tsx +++ b/ui/src/components/General/Warning/index.tsx @@ -1,5 +1,5 @@ -import Icon from "components/General/Icon"; import style from "./Warning.module.scss"; +import { Icon } from "components/General"; interface WarningProps { text?: string; diff --git a/ui/src/components/General/index.ts b/ui/src/components/General/index.ts new file mode 100644 index 00000000..0cc19f7d --- /dev/null +++ b/ui/src/components/General/index.ts @@ -0,0 +1,33 @@ +export { default as ClipboardButton } from "./ClipboardButton"; +export { default as CodeEditor } from "./CodeEditor"; +export { default as CodeHighlightWithCopy } from "./CodeHighlightWithCopy"; +export { default as ColorPickerWithInput } from "./ColorPickerWithInput"; +export { default as Drawer } from "./Drawer"; +export { default as DropdownDownloadButton } from "./DropdownDownloadButton"; +export { default as ErrorComponent } from "./ErrorComponent"; +export { default as FallbackComponent } from "./FallbackComponent"; +export { default as ResponsiveSelectWithLabel } from "./FormComponents/ResponsiveSelectWithLabel"; +export { default as ResponsiveSegementWithLabel } from "./FormComponents/ResponsiveSegementWithLabel"; +export { default as ResponsiveInputWithLabel } from "./FormComponents/ResponsiveInputWithLabel"; +export { default as ResponsiveButton } from "./FormComponents/ResponsiveButton"; +export { default as ResponsiveDropdownButton } from "./FormComponents/ResponsiveDropdownButton"; +export { default as HelpIcon } from "./HelpIcon"; +export { default as Icon } from "./Icon"; +export { default as News } from "./ListItems/News/News"; +export { default as Resource } from "./ListItems/Resource/Resource"; +export { default as Notification } from "./Notification"; +export { default as PopupSearch } from "./PopupSearch"; +export { default as Search } from "./Search"; +export { default as Spin } from "./Spin"; +export { default as Text } from "./Text"; +export { default as Warning } from "./Warning"; + +export type { ResourceType } from "./ListItems/Resource/Resource"; +export type { NewsType } from "./ListItems/News/News"; +export type { IconName } from "./Icon"; +export type { Markdown } from "./Notification/types"; + +export { getCategories } from "./Search/helper"; +export { parsedMarkdown } from "./Notification/helper"; + +export { DEFAULT_RECORD } from "./Notification/constants"; diff --git a/ui/src/components/Hoc/index.ts b/ui/src/components/Hoc/index.ts new file mode 100644 index 00000000..8540b990 --- /dev/null +++ b/ui/src/components/Hoc/index.ts @@ -0,0 +1,5 @@ +export { default as withSize } from "./withSize"; +export { default as withLabelSize } from "./withLabelSize"; +export { default as withPageTitle } from "./withPageTitle"; + +export { default as usePageTitle } from "./withPageTitle/usePageTitle"; diff --git a/ui/src/components/Hoc/withLabelSize/withLabelSize.tsx b/ui/src/components/Hoc/withLabelSize/index.tsx similarity index 100% rename from ui/src/components/Hoc/withLabelSize/withLabelSize.tsx rename to ui/src/components/Hoc/withLabelSize/index.tsx diff --git a/ui/src/components/Hoc/withPageTitle/withPageTitle.tsx b/ui/src/components/Hoc/withPageTitle/index.tsx similarity index 81% rename from ui/src/components/Hoc/withPageTitle/withPageTitle.tsx rename to ui/src/components/Hoc/withPageTitle/index.tsx index a74f7f30..e566eb31 100644 --- a/ui/src/components/Hoc/withPageTitle/withPageTitle.tsx +++ b/ui/src/components/Hoc/withPageTitle/index.tsx @@ -1,13 +1,27 @@ -import Text from "components/General/Text/Text"; import style from "./withPageTitle.module.scss"; -import HelpIcon from "components/General/HelpIcon"; import { Space } from "antd"; -import usePageTitle from "./utils/hooks"; import { HeadProvider, Title, Link, Meta } from "react-head"; -import { NO_PADDING, NO_TITLE } from "./utils/constants"; import { ErrorBoundary } from "react-error-boundary"; -import FallbackComponent from "components/General/FallbackComponent"; -import Drawer from "components/General/Drawer"; +import { Text, HelpIcon, Drawer, FallbackComponent } from "components/General"; +import usePageTitle from "./usePageTitle"; + +const NO_PADDING = [ + "BinaryTree: Developer Productivity Tools", + "About", + "Terms", + "Cookie Policy", + "Privacy Policy", + "Feedback", +]; + +const NO_TITLE = [ + "BinaryTree: Developer Productivity Tools", + "Terms", + "Cookie Policy", + "Privacy Policy", + "About", + "Feedback", +]; const withPageTitle = ( WrappedComponent: React.ComponentType diff --git a/ui/src/components/Hoc/withPageTitle/utils/hooks.ts b/ui/src/components/Hoc/withPageTitle/usePageTitle.ts similarity index 100% rename from ui/src/components/Hoc/withPageTitle/utils/hooks.ts rename to ui/src/components/Hoc/withPageTitle/usePageTitle.ts diff --git a/ui/src/components/Hoc/withPageTitle/utils/constants.ts b/ui/src/components/Hoc/withPageTitle/utils/constants.ts deleted file mode 100644 index 58ea1027..00000000 --- a/ui/src/components/Hoc/withPageTitle/utils/constants.ts +++ /dev/null @@ -1,19 +0,0 @@ -const NO_PADDING = [ - "BinaryTree: Developer Productivity Tools", - "About", - "Terms", - "Cookie Policy", - "Privacy Policy", - "Feedback", -]; - -const NO_TITLE = [ - "BinaryTree: Developer Productivity Tools", - "Terms", - "Cookie Policy", - "Privacy Policy", - "About", - "Feedback", -]; - -export { NO_PADDING, NO_TITLE }; diff --git a/ui/src/components/Hoc/withSize/withSize.tsx b/ui/src/components/Hoc/withSize/index.tsx similarity index 100% rename from ui/src/components/Hoc/withSize/withSize.tsx rename to ui/src/components/Hoc/withSize/index.tsx diff --git a/ui/src/components/Layouts/FloatingBar/index.tsx b/ui/src/components/Layouts/FloatingBar/index.tsx index f93eb174..22bbefda 100644 --- a/ui/src/components/Layouts/FloatingBar/index.tsx +++ b/ui/src/components/Layouts/FloatingBar/index.tsx @@ -1,7 +1,6 @@ import React from "react"; import styles from "./FloatingBar.module.scss"; -import FloatingSearchBar from "components/Layouts/FloatingSearchBar"; -import FloatingHeader from "components/Layouts/FloatingHeader"; +import { FloatingHeader, FloatingSearchBar } from "components/Layouts"; import { theme } from "antd"; const FloatingBar: React.FC = () => { diff --git a/ui/src/components/Layouts/FloatingHeader/index.tsx b/ui/src/components/Layouts/FloatingHeader/index.tsx index 40c942a9..19227e72 100644 --- a/ui/src/components/Layouts/FloatingHeader/index.tsx +++ b/ui/src/components/Layouts/FloatingHeader/index.tsx @@ -1,5 +1,5 @@ import style from "./FloatingHeader.module.scss"; -import Notification from "components/General/Notification"; +import { Notification } from "components/General"; interface FloatingHeaderProps { styles?: React.CSSProperties; diff --git a/ui/src/components/Layouts/FloatingSearchBar/index.tsx b/ui/src/components/Layouts/FloatingSearchBar/index.tsx index 3fd34417..f79e0567 100644 --- a/ui/src/components/Layouts/FloatingSearchBar/index.tsx +++ b/ui/src/components/Layouts/FloatingSearchBar/index.tsx @@ -1,8 +1,8 @@ import { Input } from "antd"; import style from "./FloatingSearchBar.module.scss"; -import Icon from "components/General/Icon"; import useUserAgent from "hooks/useUserAgent"; import useModal from "hooks/useModal"; +import { Icon } from "components/General"; interface FloatingSearchBarProps { styles?: React.CSSProperties; diff --git a/ui/src/components/Layouts/Footer/index.tsx b/ui/src/components/Layouts/Footer/index.tsx index 6e9a2cd4..ccf30fa8 100644 --- a/ui/src/components/Layouts/Footer/index.tsx +++ b/ui/src/components/Layouts/Footer/index.tsx @@ -1,8 +1,7 @@ import React from "react"; import style from "./Footer.module.scss"; -import Icon from "components/General/Icon"; import { Space, Typography } from "antd"; -import { ResponsiveButton } from "components/General/FormComponents"; +import { Icon, ResponsiveButton } from "components/General"; import { Link } from "react-router-dom"; import bt_light from "assets/Footer/bt_light.webp"; import bt_dark from "assets/Footer/bt_dark.webp"; diff --git a/ui/src/components/Layouts/Menu/utils/helper.tsx b/ui/src/components/Layouts/Menu/helper.tsx similarity index 74% rename from ui/src/components/Layouts/Menu/utils/helper.tsx rename to ui/src/components/Layouts/Menu/helper.tsx index 3ad75de8..420a11b6 100644 --- a/ui/src/components/Layouts/Menu/utils/helper.tsx +++ b/ui/src/components/Layouts/Menu/helper.tsx @@ -1,15 +1,15 @@ import { MenuProps } from "antd"; -import Icon, { IconName } from "components/General/Icon"; +import { Icon, IconName } from "components/General"; type MenuItem = Required["items"][number]; -export function getItem( +export const getItem = ( label: React.ReactNode, key: React.Key, name: IconName, children?: MenuItem[], type?: "group" -): MenuItem { +): MenuItem => { return { key, icon: , @@ -17,4 +17,4 @@ export function getItem( label, type, } as MenuItem; -} +}; diff --git a/ui/src/components/Layouts/Menu/index.tsx b/ui/src/components/Layouts/Menu/index.tsx index 6313bbbf..cfd70155 100644 --- a/ui/src/components/Layouts/Menu/index.tsx +++ b/ui/src/components/Layouts/Menu/index.tsx @@ -1,13 +1,16 @@ import { Menu as AntdMenu, Layout } from "antd"; import { To, useNavigate } from "react-router-dom"; import { ITEMS } from "data/menuData"; -import { MenuProps } from "./utils/types"; import style from "./Menu.module.scss"; import { classNames } from "utils/helper-functions/string"; -import Icon from "components/General/Icon"; - +import { Icon } from "components/General"; const { Sider } = Layout; +interface MenuProps { + isDarkMode: boolean; + collapsed: boolean; +} + const Menu: React.FC = ({ collapsed }) => { const navigate = useNavigate(); diff --git a/ui/src/components/Layouts/Menu/utils/types.ts b/ui/src/components/Layouts/Menu/utils/types.ts deleted file mode 100644 index cc9fbb77..00000000 --- a/ui/src/components/Layouts/Menu/utils/types.ts +++ /dev/null @@ -1,6 +0,0 @@ -interface MenuProps { - isDarkMode: boolean; - collapsed: boolean; -} - -export type { MenuProps }; diff --git a/ui/src/components/Layouts/Sidebar/Footer/Footer.module.scss b/ui/src/components/Layouts/Sidebar/Footer/Footer.module.scss deleted file mode 100644 index ae7d252f..00000000 --- a/ui/src/components/Layouts/Sidebar/Footer/Footer.module.scss +++ /dev/null @@ -1,37 +0,0 @@ -.footer { - display: flex; - flex-direction: column; - - &__monogram { - display: block; - max-width: var(--bt-size-135); - max-height: var(--bt-size-55); - width: auto; - height: auto; - padding-top: var(--bt-size-10); - padding-bottom: var(--bt-size-10); - margin-bottom: var(--bt-size-10); - - &_dark { - border-bottom: var(--bt-border-solid-light); - } - - &_light { - border-bottom: var(--bt-border-solid-dark); - } - } - - &__menuCollapse { - @media (max-width: 768px) { - display: none; - } - } - - &__moon { - margin-top: var(--bt-size-3); - } - - &__sun { - margin-top: var(--bt-size-minus-1); - } -} diff --git a/ui/src/components/Layouts/Sidebar/Footer/utils/types.ts b/ui/src/components/Layouts/Sidebar/Footer/utils/types.ts deleted file mode 100644 index 18ae1ad4..00000000 --- a/ui/src/components/Layouts/Sidebar/Footer/utils/types.ts +++ /dev/null @@ -1,8 +0,0 @@ -interface FooterProps { - handleThemeChange: () => void; - isDarkMode: boolean; - collapsed: boolean; - handleMenuCollapse: () => void; -} - -export type { FooterProps }; diff --git a/ui/src/components/Layouts/Sidebar/Sidebar.module.scss b/ui/src/components/Layouts/Sidebar/Sidebar.module.scss index d51eca75..3bb56f85 100644 --- a/ui/src/components/Layouts/Sidebar/Sidebar.module.scss +++ b/ui/src/components/Layouts/Sidebar/Sidebar.module.scss @@ -2,3 +2,41 @@ height: var(--bt-dvh-100); overflow: hidden; } + +.footer { + display: flex; + flex-direction: column; + + &__monogram { + display: block; + max-width: var(--bt-size-135); + max-height: var(--bt-size-55); + width: auto; + height: auto; + padding-top: var(--bt-size-10); + padding-bottom: var(--bt-size-10); + margin-bottom: var(--bt-size-10); + + &_dark { + border-bottom: var(--bt-border-solid-light); + } + + &_light { + border-bottom: var(--bt-border-solid-dark); + } + } + + &__menuCollapse { + @media (max-width: 768px) { + display: none; + } + } + + &__moon { + margin-top: var(--bt-size-3); + } + + &__sun { + margin-top: var(--bt-size-minus-1); + } +} diff --git a/ui/src/components/Layouts/Sidebar/Footer/tests/Footer.test.tsx b/ui/src/components/Layouts/Sidebar/__tests__/Footer.test.tsx similarity index 93% rename from ui/src/components/Layouts/Sidebar/Footer/tests/Footer.test.tsx rename to ui/src/components/Layouts/Sidebar/__tests__/Footer.test.tsx index 4838c753..ab8e0346 100644 --- a/ui/src/components/Layouts/Sidebar/Footer/tests/Footer.test.tsx +++ b/ui/src/components/Layouts/Sidebar/__tests__/Footer.test.tsx @@ -1,6 +1,6 @@ import { render, screen } from "@testing-library/react"; import { afterAll, describe, vi } from "vitest"; -import Footer from "components/Layouts/Sidebar/Footer"; +import Footer from "components/Layouts/Sidebar/components"; // Mock the window.innerWidth to simulate different screen sizes const originalInnerWidth = window.innerWidth; diff --git a/ui/src/components/Layouts/Sidebar/Footer/index.tsx b/ui/src/components/Layouts/Sidebar/components/index.tsx similarity index 87% rename from ui/src/components/Layouts/Sidebar/Footer/index.tsx rename to ui/src/components/Layouts/Sidebar/components/index.tsx index 8630035d..17909255 100644 --- a/ui/src/components/Layouts/Sidebar/Footer/index.tsx +++ b/ui/src/components/Layouts/Sidebar/components/index.tsx @@ -1,11 +1,17 @@ import { theme, Switch, Space, Button } from "antd"; -import style from "./Footer.module.scss"; +import style from "components/Layouts/Sidebar/Sidebar.module.scss"; import MonogramDark from "assets/Sidebar/netlify-monogram-dark.svg"; import MonogramLight from "assets/Sidebar/netlify-monogram-light.svg"; import Logo from "assets/Sidebar/netlify-dark.svg"; -import { FooterProps } from "./utils/types"; import { classNames } from "utils/helper-functions/string"; -import Icon from "components/General/Icon"; +import { Icon } from "components/General"; + +interface FooterProps { + handleThemeChange: () => void; + isDarkMode: boolean; + collapsed: boolean; + handleMenuCollapse: () => void; +} const Footer: React.FC = ({ handleThemeChange, diff --git a/ui/src/components/Layouts/Sidebar/index.tsx b/ui/src/components/Layouts/Sidebar/index.tsx index 460a5edc..53b0ce69 100644 --- a/ui/src/components/Layouts/Sidebar/index.tsx +++ b/ui/src/components/Layouts/Sidebar/index.tsx @@ -1,14 +1,15 @@ import { Layout, theme } from "antd"; import Header from "components/Layouts/Header"; import Menu from "components/Layouts/Menu"; -import { MENU_COLLAPSED_STORAGE_KEY } from "./utils/constants"; import useMenuCollapsed from "hooks/useMenuCollapsed"; -import Footer from "components/Layouts/Sidebar/Footer"; +import Footer from "./components"; import style from "./Sidebar.module.scss"; import useMode from "hooks/useMode"; const { Sider } = Layout; +const MENU_COLLAPSED_STORAGE_KEY = "menuCollapsed"; + const Sidebar = () => { const { collapsed, toggleCollapse } = useMenuCollapsed( MENU_COLLAPSED_STORAGE_KEY diff --git a/ui/src/components/Layouts/Sidebar/utils/constants.ts b/ui/src/components/Layouts/Sidebar/utils/constants.ts deleted file mode 100644 index 9004aa23..00000000 --- a/ui/src/components/Layouts/Sidebar/utils/constants.ts +++ /dev/null @@ -1,3 +0,0 @@ -const MENU_COLLAPSED_STORAGE_KEY = "menuCollapsed"; - -export { MENU_COLLAPSED_STORAGE_KEY }; diff --git a/ui/src/components/Layouts/index.ts b/ui/src/components/Layouts/index.ts new file mode 100644 index 00000000..e0fdd7f5 --- /dev/null +++ b/ui/src/components/Layouts/index.ts @@ -0,0 +1,12 @@ +export { default as CopyInput } from "./CopyInput"; +export { default as FloatingHeader } from "./FloatingHeader"; +export { default as Footer } from "./Footer"; +export { default as InputGrid } from "./InputGrid"; +export { default as Menu } from "./Menu"; +export { default as Sidebar } from "./Sidebar"; +export { default as FloatingBar } from "./FloatingBar"; +export { default as FloatingSearchBar } from "./FloatingSearchBar"; +export { default as Header } from "./Header"; +export { default as Legal } from "./Legal"; +export { default as PageGrid } from "./PageGrid"; +// export { getItem } from "./Menu/helper"; diff --git a/ui/src/data/menuData.ts b/ui/src/data/menuData.ts index 8e16157d..e1f22d5f 100644 --- a/ui/src/data/menuData.ts +++ b/ui/src/data/menuData.ts @@ -1,6 +1,6 @@ +import { getItem } from "components/Layouts/Menu/helper"; import { MenuProps } from "antd"; -import { IconName } from "components/General/Icon"; -import { getItem } from "components/Layouts/Menu/utils/helper"; +import { IconName } from "components/General"; import { routesById } from "data/routeData"; const IN_DEVELOPMENT = import.meta.env.DEV; diff --git a/ui/src/hooks/useGetNotifications.tsx b/ui/src/hooks/useGetNotifications.tsx index 97a2e00b..b2095b9d 100644 --- a/ui/src/hooks/useGetNotifications.tsx +++ b/ui/src/hooks/useGetNotifications.tsx @@ -1,7 +1,6 @@ import { useQuery } from "@tanstack/react-query"; import { getData } from "api/API"; -import { DEFAULT_RECORD } from "components/General/Notification/constants"; -import { parsedMarkdown } from "components/General/Notification/helper"; +import { DEFAULT_RECORD, parsedMarkdown } from "components/General"; const useGetNotifications = (key: string, url: string) => { const { diff --git a/ui/src/pages/About/components/Credits.tsx b/ui/src/pages/About/components/Credits.tsx index bd6252ef..d59706d6 100644 --- a/ui/src/pages/About/components/Credits.tsx +++ b/ui/src/pages/About/components/Credits.tsx @@ -25,8 +25,8 @@ export default Credits; const CREDITS_DATA: Credits[] = [ { key: "1", - name: "Avatar", - url: "https://www.dicebear.com/styles/adventurer-neutral", + name: "thetallbloke", + url: "https://github.com/thetallbloke", }, { key: "2", diff --git a/ui/src/pages/About/components/Support.tsx b/ui/src/pages/About/components/Support.tsx index 8fca8573..e31d9b52 100644 --- a/ui/src/pages/About/components/Support.tsx +++ b/ui/src/pages/About/components/Support.tsx @@ -1,8 +1,8 @@ import { Button, List, Typography } from "antd"; -import Icon from "components/General/Icon"; import React from "react"; import { openLink } from "utils/helper-functions/string"; import style from "pages/About/About.module.scss"; +import { Icon } from "components/General"; const Support: React.FC = () => { return ( diff --git a/ui/src/pages/About/index.tsx b/ui/src/pages/About/index.tsx index c7ea70ce..460a0abe 100644 --- a/ui/src/pages/About/index.tsx +++ b/ui/src/pages/About/index.tsx @@ -1,6 +1,6 @@ import { Card } from "antd"; import style from "./About.module.scss"; -import Footer from "components/Layouts/Footer"; +import { Footer } from "components/Layouts"; import Values from "./components/Values"; import Features from "./components/Features"; import Credits from "./components/Credits"; diff --git a/ui/src/pages/Automation/GithubIssue/index.tsx b/ui/src/pages/Automation/GithubIssue/index.tsx index beac74d4..6aafdd9c 100644 --- a/ui/src/pages/Automation/GithubIssue/index.tsx +++ b/ui/src/pages/Automation/GithubIssue/index.tsx @@ -1,12 +1,10 @@ import { Button, Card, Form, Progress, Steps, Upload } from "antd"; -import { ResponsiveInputWithLabel } from "components/General/FormComponents"; -import InputGrid from "components/Layouts/InputGrid"; -import PageGrid from "components/Layouts/PageGrid"; +import { ErrorComponent, ResponsiveInputWithLabel } from "components/General"; +import { InputGrid, PageGrid } from "components/Layouts"; import React, { useState } from "react"; import Papa from "papaparse"; import CsvTable from "./components/CsvTable"; import { calculateSteps, createGitHubIssue } from "./utils/helper"; -import ErrorComponent from "components/General/ErrorComponent"; import DownloadCsv from "./components/DownloadCsv"; import style from "./GithubIssue.module.scss"; import { useOnlineStatus } from "hooks/useOnlineStatus"; diff --git a/ui/src/pages/CSS/BorderRadius/index.tsx b/ui/src/pages/CSS/BorderRadius/index.tsx index 26647037..bbb5bca2 100644 --- a/ui/src/pages/CSS/BorderRadius/index.tsx +++ b/ui/src/pages/CSS/BorderRadius/index.tsx @@ -1,13 +1,14 @@ import { useState } from "react"; import { Card, Form, Slider } from "antd"; -import PageGrid from "components/Layouts/PageGrid"; -import CodeHighlightWithCopy from "components/General/CodeHighlightWithCopy"; +import { PageGrid, InputGrid } from "components/Layouts"; +import { CodeHighlightWithCopy } from "components/General"; import style from "./BorderRadius.module.scss"; import { + ColorPickerWithInput, ResponsiveInputWithLabel, ResponsiveSegementWithLabel, ResponsiveSelectWithLabel, -} from "components/General/FormComponents"; +} from "components/General"; import { BLOB_SHAPE, BORDER_RADIUS, @@ -19,8 +20,6 @@ import { RADIUS_ROUND, SEGMENTED_OPTIONS, } from "./utils/constants"; -import ColorPickerWithInput from "components/General/ColorPickerWithInput"; -import InputGrid from "components/Layouts/InputGrid"; const BorderRadius = () => { const [border, setBorder] = useState(INIT_BORDER); diff --git a/ui/src/pages/CSS/BoxShadow/index.tsx b/ui/src/pages/CSS/BoxShadow/index.tsx index 40f7535b..e9268712 100644 --- a/ui/src/pages/CSS/BoxShadow/index.tsx +++ b/ui/src/pages/CSS/BoxShadow/index.tsx @@ -1,10 +1,11 @@ import { useState } from "react"; import { Card, Form, Slider, Space } from "antd"; -import PageGrid from "components/Layouts/PageGrid"; -import CodeHighlightWithCopy from "components/General/CodeHighlightWithCopy"; +import { PageGrid, InputGrid } from "components/Layouts"; +import { + CodeHighlightWithCopy, + ColorPickerWithInput, +} from "components/General"; import style from "./BoxShadow.module.scss"; -import ColorPickerWithInput from "components/General/ColorPickerWithInput"; -import InputGrid from "components/Layouts/InputGrid"; const BoxShadow = () => { const [bgColor, setBgColor] = useState("#ffffff0"); diff --git a/ui/src/pages/Colors/ColorPicker/components/DisplayColor.tsx b/ui/src/pages/Colors/ColorPicker/components/DisplayColor.tsx index ddfb009e..6bad0ff4 100644 --- a/ui/src/pages/Colors/ColorPicker/components/DisplayColor.tsx +++ b/ui/src/pages/Colors/ColorPicker/components/DisplayColor.tsx @@ -1,10 +1,9 @@ import { Typography, theme } from "antd"; import style from "pages/Colors/ColorPicker/ColorPicker.module.scss"; -import Clipboard from "components/RenderProps/Clipboard"; -import ClipboardButton from "components/General/ClipboardButton"; +import { Clipboard } from "components/RenderProps"; +import { ClipboardButton, CodeHighlightWithCopy } from "components/General"; import { getTextColor, isTransparent } from "utils/helper-functions/color"; import { useSearchParams } from "react-router-dom"; -import CodeHighlightWithCopy from "components/General/CodeHighlightWithCopy"; import { classNames } from "utils/helper-functions/string"; const { Title } = Typography; diff --git a/ui/src/pages/Colors/ColorPicker/components/DisplayColors.tsx b/ui/src/pages/Colors/ColorPicker/components/DisplayColors.tsx index 08311742..dcbf6f28 100644 --- a/ui/src/pages/Colors/ColorPicker/components/DisplayColors.tsx +++ b/ui/src/pages/Colors/ColorPicker/components/DisplayColors.tsx @@ -1,8 +1,8 @@ import { Card, Space } from "antd"; import { EXTENDED_DATA_OPTIONS } from "pages/Colors/ColorPicker/utils/constants"; import DisplayColor from "pages/Colors/ColorPicker/components/DisplayColor"; -import Clipboard from "components/RenderProps/Clipboard"; -import ClipboardButton from "components/General/ClipboardButton"; +import { Clipboard } from "components/RenderProps"; +import { ClipboardButton } from "components/General"; import style from "pages/Colors/ColorPicker/ColorPicker.module.scss"; import { determineLabel, diff --git a/ui/src/pages/Colors/ColorPicker/index.tsx b/ui/src/pages/Colors/ColorPicker/index.tsx index 7c9a346c..e080540f 100644 --- a/ui/src/pages/Colors/ColorPicker/index.tsx +++ b/ui/src/pages/Colors/ColorPicker/index.tsx @@ -4,12 +4,11 @@ import { Card, Form, Space } from "antd"; import { ColorPicker as CP } from "@mantine/core"; import { INITIAL_COLOR, INITIAL_FORMAT } from "./utils/constants"; import ColorFormatTags from "./components/ColorFormatTags"; -import Clipboard from "components/RenderProps/Clipboard"; -import ClipboardButton from "components/General/ClipboardButton"; +import { Clipboard } from "components/RenderProps"; import DisplayColors from "./components/DisplayColors"; import { calculateColors, determineFormat } from "./utils/helper"; -import CopyInput from "components/Layouts/CopyInput"; -import { ResponsiveInputWithLabel } from "components/General/FormComponents"; +import { CopyInput } from "components/Layouts"; +import { ClipboardButton, ResponsiveInputWithLabel } from "components/General"; import useParamsValue from "hooks/useParamsValue"; import { useDebounce } from "hooks/useDebounce"; import { FORMAT_LABELS } from "./utils/constants"; diff --git a/ui/src/pages/Colors/ShadesAndTints/components/ColorInputs.tsx b/ui/src/pages/Colors/ShadesAndTints/components/ColorInputs.tsx index 09faee92..440d3c3b 100644 --- a/ui/src/pages/Colors/ShadesAndTints/components/ColorInputs.tsx +++ b/ui/src/pages/Colors/ShadesAndTints/components/ColorInputs.tsx @@ -5,21 +5,21 @@ import { SEGMENTED_OPTIONS, } from "pages/Colors/ShadesAndTints/utils/constants"; import { Card, Form, Space } from "antd"; -import Clipboard from "components/RenderProps/Clipboard"; -import ClipboardButton from "components/General/ClipboardButton"; +import { Clipboard } from "components/RenderProps"; import { formatShades, generateRandomColor, } from "pages/Colors/ShadesAndTints/utils/helper"; -import Icon from "components/General/Icon"; import { useEffect, useState } from "react"; import { + ColorPickerWithInput, + Icon, + ClipboardButton, ResponsiveButton, ResponsiveInputWithLabel, ResponsiveSegementWithLabel, ResponsiveSelectWithLabel, -} from "components/General/FormComponents"; -import ColorPickerWithInput from "components/General/ColorPickerWithInput"; +} from "components/General"; import { ChangeEvent } from "react"; import { SelectOption } from "pages/Colors/ShadesAndTints/utils/types"; diff --git a/ui/src/pages/Colors/ShadesAndTints/components/Colors.tsx b/ui/src/pages/Colors/ShadesAndTints/components/Colors.tsx index e625894b..fc2bd945 100644 --- a/ui/src/pages/Colors/ShadesAndTints/components/Colors.tsx +++ b/ui/src/pages/Colors/ShadesAndTints/components/Colors.tsx @@ -1,7 +1,7 @@ import { Card, Spin, Tag } from "antd"; import { getTextColor } from "utils/helper-functions/color"; -import Clipboard from "components/RenderProps/Clipboard"; -import ClipboardButton from "components/General/ClipboardButton"; +import { Clipboard } from "components/RenderProps"; +import { ClipboardButton } from "components/General"; import styles from "pages/Colors/ShadesAndTints/ShadesAndTints.module.scss"; interface ColorsProps { diff --git a/ui/src/pages/Colors/ShadesAndTints/index.tsx b/ui/src/pages/Colors/ShadesAndTints/index.tsx index ddfe24aa..f60e3e44 100644 --- a/ui/src/pages/Colors/ShadesAndTints/index.tsx +++ b/ui/src/pages/Colors/ShadesAndTints/index.tsx @@ -7,7 +7,7 @@ import { OUTPUT_FORMAT, } from "./utils/constants"; import { generateShadesForColor } from "./utils/helper"; -import PageGrid from "components/Layouts/PageGrid"; +import { PageGrid } from "components/Layouts"; import Colors from "./components/Colors"; import ColorInputs from "./components/ColorInputs"; import useParamsValue from "hooks/useParamsValue"; diff --git a/ui/src/pages/Converter/Base64/index.tsx b/ui/src/pages/Converter/Base64/index.tsx index f3679e62..f38b02ac 100644 --- a/ui/src/pages/Converter/Base64/index.tsx +++ b/ui/src/pages/Converter/Base64/index.tsx @@ -1,11 +1,10 @@ import { Card, Form } from "antd"; import { useEffect, useState } from "react"; import { Buffer } from "buffer"; -import Clipboard from "components/RenderProps/Clipboard"; -import ClipboardButton from "components/General/ClipboardButton"; +import { Clipboard } from "components/RenderProps"; +import { ClipboardButton, CodeEditor } from "components/General"; import { isBase64Valid } from "./utils/helper"; -import PageGrid from "components/Layouts/PageGrid"; -import CodeEditor from "components/General/CodeEditor"; +import { PageGrid } from "components/Layouts"; const Base64: React.FC = () => { const [input, setInput] = useState(""); diff --git a/ui/src/pages/Converter/File/index.tsx b/ui/src/pages/Converter/File/index.tsx index 3d100ca8..443f1ecb 100644 --- a/ui/src/pages/Converter/File/index.tsx +++ b/ui/src/pages/Converter/File/index.tsx @@ -1,12 +1,12 @@ import { useState } from "react"; import { fetchFile } from "@ffmpeg/util"; import { Button, message, Upload } from "antd"; -import Icon from "components/General/Icon"; import type { UploadFile, UploadProps } from "antd"; import { + Icon, ResponsiveButton, ResponsiveSelectWithLabel, -} from "components/General/FormComponents"; +} from "components/General"; import styles from "./FileConverter.module.scss"; import { useFfmpeg } from "./useFfmpeg"; import { diff --git a/ui/src/pages/Converter/JsonToTypescript/tests/JsonToTypescript.test.tsx b/ui/src/pages/Converter/JsonToTypescript/__tests__/JsonToTypescript.test.tsx similarity index 100% rename from ui/src/pages/Converter/JsonToTypescript/tests/JsonToTypescript.test.tsx rename to ui/src/pages/Converter/JsonToTypescript/__tests__/JsonToTypescript.test.tsx diff --git a/ui/src/pages/Converter/JsonToTypescript/utils/helper.ts b/ui/src/pages/Converter/JsonToTypescript/helper.ts similarity index 100% rename from ui/src/pages/Converter/JsonToTypescript/utils/helper.ts rename to ui/src/pages/Converter/JsonToTypescript/helper.ts diff --git a/ui/src/pages/Converter/JsonToTypescript/index.tsx b/ui/src/pages/Converter/JsonToTypescript/index.tsx index 18b9c300..838fefe8 100644 --- a/ui/src/pages/Converter/JsonToTypescript/index.tsx +++ b/ui/src/pages/Converter/JsonToTypescript/index.tsx @@ -2,15 +2,15 @@ import JsonToTS from "json-to-ts"; import { useEffect, useState } from "react"; import style from "./JsonToTypescript.module.scss"; import { Card, Form, Space } from "antd"; -import { isJsonValid } from "./utils/helper"; -import CodeHighlightWithCopy from "components/General/CodeHighlightWithCopy"; -import PageGrid from "components/Layouts/PageGrid"; +import { isJsonValid } from "./helper"; +import { PageGrid } from "components/Layouts"; import { + CodeEditor, + Warning, + CodeHighlightWithCopy, ResponsiveButton, ResponsiveInputWithLabel, -} from "components/General/FormComponents"; -import Warning from "components/General/Warning"; -import CodeEditor from "components/General/CodeEditor"; +} from "components/General"; const JsonToTypescript: React.FC = () => { const [json, setJson] = useState(""); diff --git a/ui/src/pages/Converter/Pixel/index.tsx b/ui/src/pages/Converter/Pixel/index.tsx index cb93e801..74b59ec2 100644 --- a/ui/src/pages/Converter/Pixel/index.tsx +++ b/ui/src/pages/Converter/Pixel/index.tsx @@ -1,10 +1,8 @@ import { useState } from "react"; import { Card, Form } from "antd"; -import CopyInput from "components/Layouts/CopyInput"; -import Clipboard from "components/RenderProps/Clipboard"; -import ClipboardButton from "components/General/ClipboardButton"; -import PageGrid from "components/Layouts/PageGrid"; -import { ResponsiveInputWithLabel } from "components/General/FormComponents"; +import { CopyInput, PageGrid } from "components/Layouts"; +import { Clipboard } from "components/RenderProps"; +import { ClipboardButton, ResponsiveInputWithLabel } from "components/General"; const Pixel: React.FC = () => { const [pixel, setPixel] = useState(0); diff --git a/ui/src/pages/Converter/Svg/index.tsx b/ui/src/pages/Converter/Svg/index.tsx index cc028841..11c464cc 100644 --- a/ui/src/pages/Converter/Svg/index.tsx +++ b/ui/src/pages/Converter/Svg/index.tsx @@ -1,10 +1,9 @@ import { Card, Form, Input } from "antd"; -import CodeHighlightWithCopy from "components/General/CodeHighlightWithCopy"; -import PageGrid from "components/Layouts/PageGrid"; +import { Warning, CodeHighlightWithCopy } from "components/General"; +import { PageGrid } from "components/Layouts"; import React, { ChangeEvent, useState } from "react"; import { combineSVGPaths } from "./utils/helper"; import style from "./Svg.module.scss"; -import Warning from "components/General/Warning"; const { TextArea } = Input; diff --git a/ui/src/pages/Feedback/index.tsx b/ui/src/pages/Feedback/index.tsx index 33c73c66..4d5aa465 100644 --- a/ui/src/pages/Feedback/index.tsx +++ b/ui/src/pages/Feedback/index.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; import style from "./Feedback.module.scss"; import { Skeleton } from "antd"; -import Footer from "components/Layouts/Footer"; +import { Footer } from "components/Layouts"; const AirtableEmbed = () => { const [loading, setLoading] = useState(true); diff --git a/ui/src/pages/Footer/CookieConsent/index.tsx b/ui/src/pages/Footer/CookieConsent/index.tsx index 7e8e42cb..ae7d80d6 100644 --- a/ui/src/pages/Footer/CookieConsent/index.tsx +++ b/ui/src/pages/Footer/CookieConsent/index.tsx @@ -4,7 +4,7 @@ import CookiConsent, { getCookieConsentValue, } from "react-cookie-consent"; import ReactGA from "react-ga4"; -import usePageTitle from "components/Hoc/withPageTitle/utils/hooks"; +import { usePageTitle } from "components/Hoc"; import { BUTTON_STYLES, COOKIE_CONSENT_STYLES, diff --git a/ui/src/pages/Footer/CookiePolicy/index.tsx b/ui/src/pages/Footer/CookiePolicy/index.tsx index b433d543..fc937e31 100644 --- a/ui/src/pages/Footer/CookiePolicy/index.tsx +++ b/ui/src/pages/Footer/CookiePolicy/index.tsx @@ -1,7 +1,6 @@ import { Table, Typography } from "antd"; -import Footer from "components/Layouts/Footer"; +import { Footer, Legal } from "components/Layouts"; import { TABLE_COLUMNS, TABLE_DATA } from "./utils/constants"; -import Legal from "components/Layouts/Legal"; const CookiePolicy = () => { return ( diff --git a/ui/src/pages/Footer/PrivacyPolicy/index.tsx b/ui/src/pages/Footer/PrivacyPolicy/index.tsx index c82f2063..dec7243d 100644 --- a/ui/src/pages/Footer/PrivacyPolicy/index.tsx +++ b/ui/src/pages/Footer/PrivacyPolicy/index.tsx @@ -1,12 +1,11 @@ import { Table, Typography } from "antd"; -import Footer from "components/Layouts/Footer"; +import { Footer, Legal } from "components/Layouts"; import { ACTIVITY_COLUMNS, ACTIVITY_DATA, PURPOSE_COLUMNS, PURPOSE_DATA, } from "./utils/constants"; -import Legal from "components/Layouts/Legal"; const PrivacyPolicy = () => { return ( diff --git a/ui/src/pages/Footer/Terms/index.tsx b/ui/src/pages/Footer/Terms/index.tsx index e7787856..4a2c6a0e 100644 --- a/ui/src/pages/Footer/Terms/index.tsx +++ b/ui/src/pages/Footer/Terms/index.tsx @@ -1,6 +1,5 @@ -import Footer from "components/Layouts/Footer"; +import { Footer, Legal } from "components/Layouts"; import { Typography } from "antd"; -import Legal from "components/Layouts/Legal"; const Terms = () => { return ( diff --git a/ui/src/pages/Generator/Avatar/index.tsx b/ui/src/pages/Generator/Avatar/index.tsx index 28d0d40f..1119c116 100644 --- a/ui/src/pages/Generator/Avatar/index.tsx +++ b/ui/src/pages/Generator/Avatar/index.tsx @@ -1,13 +1,15 @@ import { toPng, toJpeg } from "html-to-image"; import { Card, Form, Slider, Avatar as AntAvatar, Space } from "antd"; -import ColorPickerWithInput from "components/General/ColorPickerWithInput"; +import { ColorPickerWithInput } from "components/General"; import WebFont from "webfontloader"; import { + DropdownDownloadButton, + Warning, ResponsiveInputWithLabel, ResponsiveSegementWithLabel, ResponsiveSelectWithLabel, -} from "components/General/FormComponents"; -import PageGrid from "components/Layouts/PageGrid"; +} from "components/General"; +import { PageGrid, InputGrid } from "components/Layouts"; import { useRef, useState } from "react"; import { AVATAR_SHAPE_SEGMENTED_OPTIONS, @@ -15,10 +17,7 @@ import { AvatarShapeType, FONTS, } from "./utils/constants"; -import InputGrid from "components/Layouts/InputGrid"; import style from "./Avatar.module.scss"; -import DropdownDownloadButton from "components/General/DropdownDownloadButton"; -import Warning from "components/General/Warning"; const Avatar = () => { const [text, setText] = useState(""); diff --git a/ui/src/pages/Generator/Data/components/Output.tsx b/ui/src/pages/Generator/Data/components/Output.tsx index d35b7d8b..e6756b8f 100644 --- a/ui/src/pages/Generator/Data/components/Output.tsx +++ b/ui/src/pages/Generator/Data/components/Output.tsx @@ -1,6 +1,6 @@ import React from "react"; import { Tabs, type TabsProps } from "antd"; -import CodeHighlightWithCopy from "components/General/CodeHighlightWithCopy"; +import { CodeHighlightWithCopy } from "components/General"; interface OutputProps { sql: string; diff --git a/ui/src/pages/Generator/Data/index.tsx b/ui/src/pages/Generator/Data/index.tsx index c14c470d..d5a63ace 100644 --- a/ui/src/pages/Generator/Data/index.tsx +++ b/ui/src/pages/Generator/Data/index.tsx @@ -11,11 +11,8 @@ import { } from "./utils/constants"; import { convertToJSON } from "./utils/utils"; import Output from "./components/Output"; -import PageGrid from "components/Layouts/PageGrid"; -import { - ResponsiveButton, - ResponsiveInputWithLabel, -} from "components/General/FormComponents"; +import { PageGrid } from "components/Layouts"; +import { ResponsiveButton, ResponsiveInputWithLabel } from "components/General"; const DataGenerator: React.FC = () => { const [tableName, setTableName] = useState(""); diff --git a/ui/src/pages/Generator/Image/index.tsx b/ui/src/pages/Generator/Image/index.tsx index bea38dfd..f6564860 100644 --- a/ui/src/pages/Generator/Image/index.tsx +++ b/ui/src/pages/Generator/Image/index.tsx @@ -7,13 +7,12 @@ import { useRef, useState } from "react"; import style from "./ImageGeneratorFromColors.module.scss"; import useCombinedKeyPress from "hooks/useCombinedKeyPress"; import { extractColors } from "./utils/helper"; -import PageGrid from "components/Layouts/PageGrid"; +import { PageGrid, InputGrid } from "components/Layouts"; import { + Warning, ResponsiveButton, ResponsiveInputWithLabel, -} from "components/General/FormComponents"; -import InputGrid from "components/Layouts/InputGrid"; -import Warning from "components/General/Warning"; +} from "components/General"; const { TextArea } = Input; diff --git a/ui/src/pages/Generator/QRcode/QRcode.test.tsx b/ui/src/pages/Generator/QRcode/__tests__/QRcode.test.tsx similarity index 94% rename from ui/src/pages/Generator/QRcode/QRcode.test.tsx rename to ui/src/pages/Generator/QRcode/__tests__/QRcode.test.tsx index c6f617e5..5f4a2be5 100644 --- a/ui/src/pages/Generator/QRcode/QRcode.test.tsx +++ b/ui/src/pages/Generator/QRcode/__tests__/QRcode.test.tsx @@ -1,6 +1,6 @@ import { fireEvent, render, screen } from "@testing-library/react"; import { describe, test } from "vitest"; -import QRcode from "."; +import QRcode from ".."; describe("QRCODE", () => { test("render component without crash", () => { diff --git a/ui/src/pages/Generator/QRcode/components/QRCodeErrorBoundary.tsx b/ui/src/pages/Generator/QRcode/components/QRCodeErrorBoundary.tsx index 9685386c..be9b47ad 100644 --- a/ui/src/pages/Generator/QRcode/components/QRCodeErrorBoundary.tsx +++ b/ui/src/pages/Generator/QRcode/components/QRCodeErrorBoundary.tsx @@ -1,4 +1,4 @@ -import ErrorComponent from "components/General/ErrorComponent"; +import { ErrorComponent } from "components/General"; import { Component, ReactNode } from "react"; type ErrorBoundaryProps = { diff --git a/ui/src/pages/Generator/QRcode/index.tsx b/ui/src/pages/Generator/QRcode/index.tsx index 91b61238..f48604d9 100644 --- a/ui/src/pages/Generator/QRcode/index.tsx +++ b/ui/src/pages/Generator/QRcode/index.tsx @@ -1,16 +1,18 @@ import { Card, Form, QRCode, Input, Badge, Space, Checkbox } from "antd"; -import PageGrid from "components/Layouts/PageGrid"; +import { PageGrid } from "components/Layouts"; import React, { useEffect, useState } from "react"; import { downloadQRCode } from "./utils/helper"; import style from "./QRcode.module.scss"; -import DropdownDownloadButton from "components/General/DropdownDownloadButton"; -import Warning from "components/General/Warning"; -import ColorPickerWithInput from "components/General/ColorPickerWithInput"; -import { ResponsiveInputWithLabel } from "components/General/FormComponents"; +import { + DropdownDownloadButton, + Warning, + ColorPickerWithInput, + ResponsiveInputWithLabel, +} from "components/General"; import { handleImageUpload } from "utils/helper-functions/files"; import QRCodeErrorBoundary from "./components/QRCodeErrorBoundary"; import { classNames } from "utils/helper-functions/string"; -import { DataDetection } from "utils/helper-classes/ DataDetection"; +import { DataDetection } from "utils/helper-classes/DataDetection"; const { TextArea } = Input; diff --git a/ui/src/pages/Home/components/Contribution.tsx b/ui/src/pages/Home/components/Contribution.tsx index 8eb81ddc..2a32666f 100644 --- a/ui/src/pages/Home/components/Contribution.tsx +++ b/ui/src/pages/Home/components/Contribution.tsx @@ -1,7 +1,7 @@ import React from "react"; import style from "pages/Home/Home.module.scss"; import { Space, Typography } from "antd"; -import { ResponsiveButton } from "components/General/FormComponents"; +import { ResponsiveButton } from "components/General"; import { openLink } from "utils/helper-functions/string"; const Contribution: React.FC = () => { diff --git a/ui/src/pages/Home/components/Features.tsx b/ui/src/pages/Home/components/Features.tsx index eabcdf89..1cc7e43b 100644 --- a/ui/src/pages/Home/components/Features.tsx +++ b/ui/src/pages/Home/components/Features.tsx @@ -1,11 +1,11 @@ import React from "react"; import { Card, Space, Typography, Image } from "antd"; -import Icon from "components/General/Icon"; import { FEATURES } from "pages/Home/utils/constants"; import style from "pages/Home/Home.module.scss"; import { Link } from "react-router-dom"; import features from "assets/Home/features.svg"; +import { Icon } from "components/General"; const Features: React.FC = () => { return ( diff --git a/ui/src/pages/Home/components/Hero.tsx b/ui/src/pages/Home/components/Hero.tsx index 9e0a2b87..a7c24895 100644 --- a/ui/src/pages/Home/components/Hero.tsx +++ b/ui/src/pages/Home/components/Hero.tsx @@ -3,7 +3,7 @@ import style from "pages/Home/Home.module.scss"; import { Typography, Image, Space } from "antd"; import hero from "assets/Home/hero.webp"; import { FEATURE_DATA } from "data/featureData"; -import { ResponsiveButton } from "components/General/FormComponents"; +import { ResponsiveButton } from "components/General"; import { openLink } from "utils/helper-functions/string"; import useModal from "hooks/useModal"; diff --git a/ui/src/pages/Home/index.tsx b/ui/src/pages/Home/index.tsx index 6e184506..270b2ae4 100644 --- a/ui/src/pages/Home/index.tsx +++ b/ui/src/pages/Home/index.tsx @@ -1,5 +1,5 @@ import style from "./Home.module.scss"; -import Footer from "components/Layouts/Footer"; +import { Footer } from "components/Layouts"; import Features from "./components/Features"; import Hero from "./components/Hero"; import Contribution from "./components/Contribution"; diff --git a/ui/src/pages/Information/Mimetype/components/SearchBar.tsx b/ui/src/pages/Information/Mimetype/components/SearchBar.tsx index 0ee437c7..297288d6 100644 --- a/ui/src/pages/Information/Mimetype/components/SearchBar.tsx +++ b/ui/src/pages/Information/Mimetype/components/SearchBar.tsx @@ -1,6 +1,6 @@ import { useSearchParams } from "react-router-dom"; import { useState, useEffect, ChangeEvent } from "react"; -import { ResponsiveInputWithLabel } from "components/General/FormComponents"; +import { ResponsiveInputWithLabel } from "components/General"; import { Form } from "antd"; const MimeSearch: React.FC = () => { diff --git a/ui/src/pages/Information/Mimetype/utils/constants.tsx b/ui/src/pages/Information/Mimetype/utils/constants.tsx index 43c0178e..afe892a4 100644 --- a/ui/src/pages/Information/Mimetype/utils/constants.tsx +++ b/ui/src/pages/Information/Mimetype/utils/constants.tsx @@ -1,7 +1,7 @@ import { ColumnsType } from "antd/es/table"; import { MimeTableDataType } from "./types"; import { Tag } from "antd"; -import CodeHighlightWithCopy from "components/General/CodeHighlightWithCopy"; +import { CodeHighlightWithCopy } from "components/General"; const MIME_URL = "/mime/data.json"; const MIME_KEY = "mimetype"; diff --git a/ui/src/pages/Information/Npmpackages/index.tsx b/ui/src/pages/Information/Npmpackages/index.tsx index 845893da..2a5ea5c5 100644 --- a/ui/src/pages/Information/Npmpackages/index.tsx +++ b/ui/src/pages/Information/Npmpackages/index.tsx @@ -1,4 +1,4 @@ -import Text from "components/General/Text/Text"; +import { Text } from "components/General"; import { API_ERROR, API_NO_DATA } from "data/constants"; import useFetchList from "hooks/useFetchList"; import PackageList from "./components/PackageList"; diff --git a/ui/src/pages/Markdown/Editor/index.tsx b/ui/src/pages/Markdown/Editor/index.tsx index e4d6ca58..674abdad 100644 --- a/ui/src/pages/Markdown/Editor/index.tsx +++ b/ui/src/pages/Markdown/Editor/index.tsx @@ -7,9 +7,8 @@ import { useState } from "react"; import useCombinedKeyPress from "hooks/useCombinedKeyPress"; import style from "./MarkdownEditor.module.scss"; import MDEditor from "@uiw/react-md-editor"; -import Clipboard from "components/RenderProps/Clipboard"; -import ClipboardButton from "components/General/ClipboardButton"; -import { ResponsiveButton } from "components/General/FormComponents"; +import { Clipboard } from "components/RenderProps"; +import { ClipboardButton, ResponsiveButton } from "components/General"; import useMode from "hooks/useMode"; const MarkdownEditor: React.FC = () => { diff --git a/ui/src/pages/Markdown/TableGenerator/index.tsx b/ui/src/pages/Markdown/TableGenerator/index.tsx index 21919d96..f709d069 100644 --- a/ui/src/pages/Markdown/TableGenerator/index.tsx +++ b/ui/src/pages/Markdown/TableGenerator/index.tsx @@ -2,10 +2,9 @@ import MDEditor from "@uiw/react-md-editor"; import { Card, Form, Space, Spin } from "antd"; import { useState, useTransition } from "react"; import { generateTable } from "./util/utils"; -import { ResponsiveInputWithLabel } from "components/General/FormComponents"; +import { ClipboardButton, ResponsiveInputWithLabel } from "components/General"; import style from "./MdTableGenerator.module.scss"; -import Clipboard from "components/RenderProps/Clipboard"; -import ClipboardButton from "components/General/ClipboardButton"; +import { Clipboard } from "components/RenderProps"; import useMode from "hooks/useMode"; const TableGenerator: React.FC = () => { diff --git a/ui/src/pages/Markdown/TableOfContent/__tests__/TableOfContent.test.tsx b/ui/src/pages/Markdown/TableOfContent/__tests__/TableOfContent.test.tsx index 95dc7cf4..c91056a7 100644 --- a/ui/src/pages/Markdown/TableOfContent/__tests__/TableOfContent.test.tsx +++ b/ui/src/pages/Markdown/TableOfContent/__tests__/TableOfContent.test.tsx @@ -1,6 +1,6 @@ import { fireEvent, render, screen } from "@testing-library/react"; import { describe, test } from "vitest"; -import TableOfContent from ".."; +import TableOfContent from "pages/Markdown/TableOfContent"; describe("Table Of content", () => { test("Render component without crash", () => { diff --git a/ui/src/pages/Markdown/TableOfContent/index.tsx b/ui/src/pages/Markdown/TableOfContent/index.tsx index fe767f9f..0799e494 100644 --- a/ui/src/pages/Markdown/TableOfContent/index.tsx +++ b/ui/src/pages/Markdown/TableOfContent/index.tsx @@ -3,12 +3,13 @@ import style from "./TableOfContent.module.scss"; import { marked } from "marked"; import { Input, Form, Card } from "antd"; import useCombinedKeyPress from "hooks/useCombinedKeyPress"; -import CopyInput from "components/Layouts/CopyInput"; -import { ResponsiveInputWithLabel } from "components/General/FormComponents"; -import Clipboard from "components/RenderProps/Clipboard"; -import ClipboardButton from "components/General/ClipboardButton"; -import PageGrid from "components/Layouts/PageGrid"; -import Warning from "components/General/Warning"; +import { CopyInput, PageGrid } from "components/Layouts"; +import { + ClipboardButton, + Warning, + ResponsiveInputWithLabel, +} from "components/General"; +import { Clipboard } from "components/RenderProps"; const { TextArea } = Input; type TocItem = { diff --git a/ui/src/pages/Newsfeed/index.tsx b/ui/src/pages/Newsfeed/index.tsx index 11ddf170..578726c3 100644 --- a/ui/src/pages/Newsfeed/index.tsx +++ b/ui/src/pages/Newsfeed/index.tsx @@ -1,8 +1,8 @@ import React from "react"; import { QUERY_KEY_NEWS, TAB_ITEMS } from "./utils/constants"; import { Tabs } from "antd"; -import ListSearchResults from "components/RenderProps/ListSearchResults"; -import News from "components/General/ListItems/News/News"; +import { ListSearchResults } from "components/RenderProps"; +import { News } from "components/General"; import style from "./Newsfeed.module.scss"; import useNewsFeed from "./useNewsFeed"; diff --git a/ui/src/pages/Resource/Blog/index.tsx b/ui/src/pages/Resource/Blog/index.tsx index 180f5de5..8a1b1ceb 100644 --- a/ui/src/pages/Resource/Blog/index.tsx +++ b/ui/src/pages/Resource/Blog/index.tsx @@ -1,5 +1,5 @@ -import Resource from "components/General/ListItems/Resource/Resource"; -import ListSearchResults from "components/RenderProps/ListSearchResults"; +import { Resource } from "components/General"; +import { ListSearchResults } from "components/RenderProps"; import useFetchList from "hooks/useFetchList"; import { QUERY_KEY, URL } from "./utils/contants"; diff --git a/ui/src/pages/Resource/Book/index.tsx b/ui/src/pages/Resource/Book/index.tsx index 8233bb89..4950c28e 100644 --- a/ui/src/pages/Resource/Book/index.tsx +++ b/ui/src/pages/Resource/Book/index.tsx @@ -1,5 +1,5 @@ -import Resource from "components/General/ListItems/Resource/Resource"; -import ListSearchResults from "components/RenderProps/ListSearchResults"; +import { Resource } from "components/General"; +import { ListSearchResults } from "components/RenderProps"; import useFetchList from "hooks/useFetchList"; import { QUERY_KEY, URL } from "./utils/contants"; diff --git a/ui/src/pages/Resource/Course/index.tsx b/ui/src/pages/Resource/Course/index.tsx index 14d759fe..567078c2 100644 --- a/ui/src/pages/Resource/Course/index.tsx +++ b/ui/src/pages/Resource/Course/index.tsx @@ -1,5 +1,5 @@ -import Resource from "components/General/ListItems/Resource/Resource"; -import ListSearchResults from "components/RenderProps/ListSearchResults"; +import { Resource } from "components/General"; +import { ListSearchResults } from "components/RenderProps"; import useFetchList from "hooks/useFetchList"; import { QUERY_KEY, URL } from "./utils/contants"; diff --git a/ui/src/pages/Resource/DesignSystem/index.tsx b/ui/src/pages/Resource/DesignSystem/index.tsx index baa398bf..0fd30c2d 100644 --- a/ui/src/pages/Resource/DesignSystem/index.tsx +++ b/ui/src/pages/Resource/DesignSystem/index.tsx @@ -1,5 +1,5 @@ -import Resource from "components/General/ListItems/Resource/Resource"; -import ListSearchResults from "components/RenderProps/ListSearchResults"; +import { Resource } from "components/General"; +import { ListSearchResults } from "components/RenderProps"; import useFetchList from "hooks/useFetchList"; import { QUERY_KEY, URL } from "./utils/contants"; diff --git a/ui/src/pages/Resource/Github/index.tsx b/ui/src/pages/Resource/Github/index.tsx index b9078768..880e8fe3 100644 --- a/ui/src/pages/Resource/Github/index.tsx +++ b/ui/src/pages/Resource/Github/index.tsx @@ -1,5 +1,5 @@ -import Resource from "components/General/ListItems/Resource/Resource"; -import ListSearchResults from "components/RenderProps/ListSearchResults"; +import { Resource } from "components/General"; +import { ListSearchResults } from "components/RenderProps"; import useFetchList from "hooks/useFetchList"; import { QUERY_KEY, URL } from "./utils/contants"; diff --git a/ui/src/pages/Resource/Icon/tests/icon.test.tsx b/ui/src/pages/Resource/Icon/__tests__/icon.test.tsx similarity index 100% rename from ui/src/pages/Resource/Icon/tests/icon.test.tsx rename to ui/src/pages/Resource/Icon/__tests__/icon.test.tsx diff --git a/ui/src/pages/Resource/Icon/index.tsx b/ui/src/pages/Resource/Icon/index.tsx index 81d520cd..2ca68166 100644 --- a/ui/src/pages/Resource/Icon/index.tsx +++ b/ui/src/pages/Resource/Icon/index.tsx @@ -1,6 +1,6 @@ -import Resource from "components/General/ListItems/Resource/Resource"; +import { Resource } from "components/General"; import useFetchList from "hooks/useFetchList"; -import ListSearchResults from "components/RenderProps/ListSearchResults"; +import { ListSearchResults } from "components/RenderProps"; import { QUERY_KEY, URL } from "./utils/constants"; const Icon: React.FC = () => { diff --git a/ui/src/pages/Resource/Interview/index.tsx b/ui/src/pages/Resource/Interview/index.tsx index 5b66204f..955de9b2 100644 --- a/ui/src/pages/Resource/Interview/index.tsx +++ b/ui/src/pages/Resource/Interview/index.tsx @@ -1,5 +1,5 @@ -import Resource from "components/General/ListItems/Resource/Resource"; -import ListSearchResults from "components/RenderProps/ListSearchResults"; +import { Resource } from "components/General"; +import { ListSearchResults } from "components/RenderProps"; import useFetchList from "hooks/useFetchList"; import { QUERY_KEY, URL } from "./utils/contants"; diff --git a/ui/src/pages/Resource/Movie/index.tsx b/ui/src/pages/Resource/Movie/index.tsx index b244e327..d13c1b90 100644 --- a/ui/src/pages/Resource/Movie/index.tsx +++ b/ui/src/pages/Resource/Movie/index.tsx @@ -1,5 +1,5 @@ -import Resource from "components/General/ListItems/Resource/Resource"; -import ListSearchResults from "components/RenderProps/ListSearchResults"; +import { Resource } from "components/General"; +import { ListSearchResults } from "components/RenderProps"; import useFetchList from "hooks/useFetchList"; import { QUERY_KEY, URL } from "./utils/contants"; diff --git a/ui/src/pages/Resource/Platform/index.tsx b/ui/src/pages/Resource/Platform/index.tsx index 83807364..2878a6bf 100644 --- a/ui/src/pages/Resource/Platform/index.tsx +++ b/ui/src/pages/Resource/Platform/index.tsx @@ -1,5 +1,5 @@ -import Resource from "components/General/ListItems/Resource/Resource"; -import ListSearchResults from "components/RenderProps/ListSearchResults"; +import { Resource } from "components/General"; +import { ListSearchResults } from "components/RenderProps"; import useFetchList from "hooks/useFetchList"; import { QUERY_KEY, URL } from "./utils/contants"; diff --git a/ui/src/pages/Resource/Plugin/index.tsx b/ui/src/pages/Resource/Plugin/index.tsx index ea238750..568e5014 100644 --- a/ui/src/pages/Resource/Plugin/index.tsx +++ b/ui/src/pages/Resource/Plugin/index.tsx @@ -1,5 +1,5 @@ -import Resource from "components/General/ListItems/Resource/Resource"; -import ListSearchResults from "components/RenderProps/ListSearchResults"; +import { Resource } from "components/General"; +import { ListSearchResults } from "components/RenderProps"; import useFetchList from "hooks/useFetchList"; import { QUERY_KEY, URL } from "./utils/contants"; diff --git a/ui/src/pages/Resource/Tool/index.tsx b/ui/src/pages/Resource/Tool/index.tsx index 0ddb503c..fb04c985 100644 --- a/ui/src/pages/Resource/Tool/index.tsx +++ b/ui/src/pages/Resource/Tool/index.tsx @@ -1,5 +1,5 @@ -import Resource from "components/General/ListItems/Resource/Resource"; -import ListSearchResults from "components/RenderProps/ListSearchResults"; +import { Resource } from "components/General"; +import { ListSearchResults } from "components/RenderProps"; import useFetchList from "hooks/useFetchList"; import { QUERY_KEY, URL } from "./utils/contants"; diff --git a/ui/src/pages/Resource/TvSeries/index.tsx b/ui/src/pages/Resource/TvSeries/index.tsx index 50c434aa..07244d04 100644 --- a/ui/src/pages/Resource/TvSeries/index.tsx +++ b/ui/src/pages/Resource/TvSeries/index.tsx @@ -1,5 +1,5 @@ -import Resource from "components/General/ListItems/Resource/Resource"; -import ListSearchResults from "components/RenderProps/ListSearchResults"; +import { Resource } from "components/General"; +import { ListSearchResults } from "components/RenderProps"; import useFetchList from "hooks/useFetchList"; import { QUERY_KEY, URL } from "./utils/contants"; diff --git a/ui/src/pages/Resource/UiUx/index.tsx b/ui/src/pages/Resource/UiUx/index.tsx index 1e8b6ca8..96743e7f 100644 --- a/ui/src/pages/Resource/UiUx/index.tsx +++ b/ui/src/pages/Resource/UiUx/index.tsx @@ -1,5 +1,5 @@ -import Resource from "components/General/ListItems/Resource/Resource"; -import ListSearchResults from "components/RenderProps/ListSearchResults"; +import { Resource } from "components/General"; +import { ListSearchResults } from "components/RenderProps"; import useFetchList from "hooks/useFetchList"; import { QUERY_KEY, URL } from "./utils/contants"; diff --git a/ui/src/pages/Resource/YouTube/index.tsx b/ui/src/pages/Resource/YouTube/index.tsx index eb6edf2a..a38bfb87 100644 --- a/ui/src/pages/Resource/YouTube/index.tsx +++ b/ui/src/pages/Resource/YouTube/index.tsx @@ -1,5 +1,5 @@ -import Resource from "components/General/ListItems/Resource/Resource"; -import ListSearchResults from "components/RenderProps/ListSearchResults"; +import { Resource } from "components/General"; +import { ListSearchResults } from "components/RenderProps"; import useFetchList from "hooks/useFetchList"; import { QUERY_KEY, URL } from "./utils/contants"; diff --git a/ui/src/pages/Text/TextEditor/index.tsx b/ui/src/pages/Text/TextEditor/index.tsx index 46920fc8..9f0e05ad 100644 --- a/ui/src/pages/Text/TextEditor/index.tsx +++ b/ui/src/pages/Text/TextEditor/index.tsx @@ -3,7 +3,7 @@ import { Col, Row } from "antd"; import { Editor } from "@tinymce/tinymce-react"; import { Editor as TinyMCEEditor } from "tinymce"; import style from "./TextEditor.module.scss"; -import Spin from "components/General/Spin"; +import { Spin } from "components/General"; import { classNames } from "utils/helper-functions/string"; import useMode from "hooks/useMode"; diff --git a/ui/src/pages/Tools/CodeFormatter/index.tsx b/ui/src/pages/Tools/CodeFormatter/index.tsx index f7789008..5391d285 100644 --- a/ui/src/pages/Tools/CodeFormatter/index.tsx +++ b/ui/src/pages/Tools/CodeFormatter/index.tsx @@ -1,20 +1,19 @@ import React, { useState } from "react"; import style from "./CodeFormatter.module.scss"; -import PageGrid from "components/Layouts/PageGrid"; +import { PageGrid, InputGrid } from "components/Layouts"; import { Card, Form, Space } from "antd"; import { + CodeHighlightWithCopy, + Warning, + CodeEditor, ResponsiveButton, ResponsiveSelectWithLabel, -} from "components/General/FormComponents"; -import CodeHighlightWithCopy from "components/General/CodeHighlightWithCopy"; -import Warning from "components/General/Warning"; -import InputGrid from "components/Layouts/InputGrid"; +} from "components/General"; import { BEAUTIFY_FUNCTIONS, INDENTATION_LEVEL, INPUT_TYPE, } from "./utils/constants"; -import CodeEditor from "components/General/CodeEditor"; const CodeFormatter: React.FC = () => { const [inputCode, setInputCode] = useState(""); diff --git a/ui/src/pages/Tools/Diffchecker/index.tsx b/ui/src/pages/Tools/Diffchecker/index.tsx index bbc0b3bf..d0041736 100644 --- a/ui/src/pages/Tools/Diffchecker/index.tsx +++ b/ui/src/pages/Tools/Diffchecker/index.tsx @@ -1,8 +1,8 @@ import { Card, Form, Input } from "antd"; -import PageGrid from "components/Layouts/PageGrid"; +import { PageGrid } from "components/Layouts"; import React, { useState } from "react"; import { diffLines, Change } from "diff"; -import { ResponsiveButton } from "components/General/FormComponents"; +import { ResponsiveButton } from "components/General"; import style from "./Diffchecker.module.scss"; import { classNames } from "utils/helper-functions/string"; diff --git a/ui/src/pages/Tools/Sorting/index.tsx b/ui/src/pages/Tools/Sorting/index.tsx index f77e76b8..6d144b1b 100644 --- a/ui/src/pages/Tools/Sorting/index.tsx +++ b/ui/src/pages/Tools/Sorting/index.tsx @@ -3,15 +3,14 @@ import { useEffect, useState } from "react"; import { detectData, sortData } from "./utils/helper"; import { Input, Form, Card, Badge, Row, Col } from "antd"; import { OUTPUT_FORMAT } from "./utils/constants"; -import Clipboard from "components/RenderProps/Clipboard"; -import ClipboardButton from "components/General/ClipboardButton"; -import PageGrid from "components/Layouts/PageGrid"; -import CopyInput from "components/Layouts/CopyInput"; +import { Clipboard } from "components/RenderProps"; +import { PageGrid, CopyInput } from "components/Layouts"; import { + Warning, + ClipboardButton, ResponsiveSegementWithLabel, ResponsiveSelectWithLabel, -} from "components/General/FormComponents"; -import Warning from "components/General/Warning"; +} from "components/General"; const { TextArea } = Input; diff --git a/ui/src/routes/index.tsx b/ui/src/routes/index.tsx index 4049afdd..d5a26069 100644 --- a/ui/src/routes/index.tsx +++ b/ui/src/routes/index.tsx @@ -1,8 +1,8 @@ import { Suspense } from "react"; import { Route, Routes as RRDRoutes } from "react-router-dom"; -import withPageTitle from "components/Hoc/withPageTitle/withPageTitle"; +import { withPageTitle } from "components/Hoc"; import { routes } from "data/routeData"; -import Spin from "components/General/Spin"; +import { Spin } from "components/General"; const Routes: React.FC = () => { return ( diff --git a/ui/src/utils/helper-classes/ DataDetection.ts b/ui/src/utils/helper-classes/DataDetection.ts similarity index 100% rename from ui/src/utils/helper-classes/ DataDetection.ts rename to ui/src/utils/helper-classes/DataDetection.ts