diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..586d389 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "javascript.preferences.importModuleSpecifier": "non-relative", + "typescript.preferences.importModuleSpecifier": "non-relative" +} diff --git a/src/app/auth/page.tsx b/src/app/auth/page.tsx index 044b950..150f63d 100644 --- a/src/app/auth/page.tsx +++ b/src/app/auth/page.tsx @@ -1,7 +1,7 @@ import FormAuth from '@/components/pages/auth/form-auth' import ImageCard from '@/components/pages/auth/image-card' import Content from '@/components/ui/content' -import IconGolub from '@/components/ui/icons/IconGolub' +import { Icons } from '@/components/ui/icons' import ThemeToggler from '@/components/ui/index/theme-toggler' export default function Auth() { @@ -10,7 +10,7 @@ export default function Auth() {
- +

Authentication

diff --git a/src/components/ui/checkbox.tsx b/src/components/ui/checkbox.tsx index f7d7da0..53d6c38 100644 --- a/src/components/ui/checkbox.tsx +++ b/src/components/ui/checkbox.tsx @@ -1,11 +1,10 @@ 'use client' +import { Icons } from '@/components/ui/icons' import { cn } from '@/lib/utils' import * as CheckboxPrimitive from '@radix-ui/react-checkbox' import * as React from 'react' -import IconCheck from './icons/IconCheck' - const Checkbox = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef @@ -21,7 +20,7 @@ const Checkbox = React.forwardRef< - + )) diff --git a/src/components/ui/icons.tsx b/src/components/ui/icons.tsx new file mode 100644 index 0000000..dd51db1 --- /dev/null +++ b/src/components/ui/icons.tsx @@ -0,0 +1,47 @@ +import IconSize from '@/types/enums/IconSize' +import { getIconDimension } from '@/utils' +import { HTMLAttributes } from 'react' + +interface IconProps extends HTMLAttributes { + size?: IconSize +} + +export const Icons = { + check: ({ size, ...props }: IconProps) => { + const dimension = getIconDimension(size) + return ( + + + + ) + }, + golub: (props: IconProps) => ( + + + + + ), +} diff --git a/src/components/ui/icons/IconChange.tsx b/src/components/ui/icons/IconChange.tsx deleted file mode 100644 index 3e4ad24..0000000 --- a/src/components/ui/icons/IconChange.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import IconProps from '@/types/IconProps' -import { getIconDimension } from '@/utils' -import { FC } from 'react' - -const IconChange: FC = ({ className, size }) => { - const dimension = getIconDimension(size) - - return ( - - - - ) -} -export default IconChange diff --git a/src/components/ui/icons/IconCheck.tsx b/src/components/ui/icons/IconCheck.tsx deleted file mode 100644 index 5d5186f..0000000 --- a/src/components/ui/icons/IconCheck.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import IconProps from '@/types/IconProps' -import { getIconDimension } from '@/utils' -import { FC } from 'react' - -const IconCheck: FC = ({ className, size }) => { - const dimension = getIconDimension(size) - - return ( - - - - ) -} -export default IconCheck diff --git a/src/components/ui/icons/IconGolub.tsx b/src/components/ui/icons/IconGolub.tsx deleted file mode 100644 index d454d36..0000000 --- a/src/components/ui/icons/IconGolub.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { FC } from 'react' - -type IconGolubProps = { className?: string } - -const IconGolub: FC = ({ className }) => { - return ( - - - - - ) -} - -export default IconGolub diff --git a/src/store/providers/index.tsx b/src/store/providers/index.tsx index 0e3a0b4..6c40742 100644 --- a/src/store/providers/index.tsx +++ b/src/store/providers/index.tsx @@ -1,12 +1,11 @@ 'use client' import Content from '@/components/ui/content' -import IconGolub from '@/components/ui/icons/IconGolub' +import { Icons } from '@/components/ui/icons' +import ThemeProvider from '@/store/providers/theme-provider' import { ApiContext, useApiLoader } from '@/utils' import { FC, ReactNode } from 'react' -import ThemeProvider from './theme-provider' - type ProvidersProps = { children: ReactNode } @@ -25,7 +24,7 @@ const Providers: FC = ({ children }) => { ) : ( // TODO: handle initial metacom loading state - + )} diff --git a/src/types/IconProps.ts b/src/types/IconProps.ts deleted file mode 100644 index b9e31e1..0000000 --- a/src/types/IconProps.ts +++ /dev/null @@ -1,8 +0,0 @@ -import IconSize from './enums/IconSize' - -type IconProps = { - className?: string - size?: IconSize -} - -export default IconProps