Skip to content

Commit

Permalink
🏷️ fix: fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed May 23, 2023
1 parent 1808d1b commit 746947e
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/ActionIcon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Icon } from '@/index';
import { LucideIcon } from 'lucide-react';
import { memo } from 'react';

import { DivProps } from '@/types';
import { useStyles } from './style';

export type ActionIconSize =
Expand Down
1 change: 1 addition & 0 deletions src/CopyButton/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useCopied } from '@/hooks/useCopied';
import { ActionIcon, ActionIconSize, Tooltip, TooltipProps } from '@/index';
import { DivProps } from '@/types';
import copy from 'copy-to-clipboard';
import { Copy } from 'lucide-react';
import { ReactNode } from 'react';
Expand Down
2 changes: 2 additions & 0 deletions src/DraggablePanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { memo, useEffect, useMemo, useRef, useState } from 'react';
import { Center } from 'react-layout-kit';
import type { Props as RndProps } from 'react-rnd';
import useControlledState from 'use-merge-value';

import { DivProps } from '@/types';
import { useStyle } from './style';
import { revesePlacement } from './utils';

Expand Down
2 changes: 2 additions & 0 deletions src/Highlighter/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { memo } from 'react';

import { DivProps } from '@/types';
import CopyButton from '../CopyButton';
import SyntaxHighlighter, { type SyntaxHighlighterProps } from './SyntaxHighlighter';
import { useStyles } from './style';
Expand Down
2 changes: 2 additions & 0 deletions src/Logo/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { DivProps } from '@/types';
import { useTheme } from 'antd-style';

import { memo } from 'react';
import Divider from './Divider';
import Logo3D from './Logo3D';
Expand Down
1 change: 1 addition & 0 deletions src/SideNav/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { DivProps } from '@/types';
import { Space } from 'antd';
import { memo, ReactNode } from 'react';
import { useStyles } from './style';
Expand Down
6 changes: 4 additions & 2 deletions src/Snippet/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { CopyButton, SyntaxHighlighter } from '@/index';

import { memo } from 'react';

import { DivProps } from '@/types';
import CopyButton from '../CopyButton';
import { SyntaxHighlighter } from '../Highlighter';
import { useStyles } from './style';

export interface SnippetProps extends DivProps {
Expand Down
4 changes: 3 additions & 1 deletion src/StroyBook/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { DraggablePanel } from '@/index';
import { DivProps } from '@/types';
import { useResponsive } from 'antd-style';
import { LevaPanel, useControls, useCreateStore } from 'leva';
import { memo } from 'react';

import DraggablePanel from '../DraggablePanel';
import { useStyles } from './style';

export { useCreateStore, useControls };
Expand Down
3 changes: 2 additions & 1 deletion src/ThemeSwitch/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { ActionIcon, Icon, type ActionIconSize } from '@lobehub/ui';
import { Dropdown, type MenuProps } from 'antd';
import { ThemeMode } from 'antd-style';
import { Monitor, Moon, Sun } from 'lucide-react';
import { memo } from 'react';

import { ActionIcon, Icon, type ActionIconSize } from '@lobehub/ui';
import { DivProps } from '@/types';

const icons = {
auto: Monitor,
Expand Down
7 changes: 5 additions & 2 deletions src/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ declare module 'styled-components' {
export interface DefaultTheme extends AntdStyleTheme {}
}

declare global {
type DivProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
export type DivProps = React.DetailedHTMLProps<
React.HTMLAttributes<HTMLDivElement>,
HTMLDivElement
>;

declare global {
type SvgProps = React.DetailedHTMLProps<React.HTMLAttributes<SVGSVGElement>, SVGSVGElement>;

type ImgProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLImageElement>, HTMLImageElement>;
Expand Down

0 comments on commit 746947e

Please sign in to comment.