React 18 and Vite (#4510)
This commit is contained in:
parent
1bb1b13f6d
commit
21613fa602
244 changed files with 4547 additions and 8933 deletions
|
@ -1,4 +1,4 @@
|
|||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import { Dialog, RenderDialogProps } from './';
|
||||
import { Button } from '@/components/elements/button/index';
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import React, { useRef, useState } from 'react';
|
||||
import { useRef, useState } from 'react';
|
||||
import * as React from 'react';
|
||||
import { Dialog as HDialog } from '@headlessui/react';
|
||||
import { Button } from '@/components/elements/button/index';
|
||||
import { XIcon } from '@heroicons/react/solid';
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import React, { useContext } from 'react';
|
||||
import { useContext } from 'react';
|
||||
import * as React from 'react';
|
||||
import { DialogContext } from './';
|
||||
import { useDeepCompareEffect } from '@/plugins/useDeepCompareEffect';
|
||||
|
||||
|
@ -7,7 +8,7 @@ export default ({ children }: { children: React.ReactNode }) => {
|
|||
|
||||
useDeepCompareEffect(() => {
|
||||
setFooter(
|
||||
<div className={'px-6 py-3 bg-gray-700 flex items-center justify-end space-x-3 rounded-b'}>{children}</div>
|
||||
<div className={'px-6 py-3 bg-gray-700 flex items-center justify-end space-x-3 rounded-b'}>{children}</div>,
|
||||
);
|
||||
}, [children]);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useContext, useEffect } from 'react';
|
||||
import { useContext, useEffect } from 'react';
|
||||
import { CheckIcon, ExclamationIcon, InformationCircleIcon, ShieldExclamationIcon } from '@heroicons/react/outline';
|
||||
import classNames from 'classnames';
|
||||
import { DialogContext, DialogIconProps, styles } from './';
|
||||
|
@ -19,7 +19,7 @@ export default ({ type, position, className }: DialogIconProps) => {
|
|||
setIcon(
|
||||
<div className={classNames(styles.dialog_icon, styles[type], className)}>
|
||||
<Icon className={'w-6 h-6'} />
|
||||
</div>
|
||||
</div>,
|
||||
);
|
||||
}, [type, className]);
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import React from 'react';
|
||||
import { createContext } from 'react';
|
||||
import { DialogContextType, DialogWrapperContextType } from './types';
|
||||
|
||||
export const DialogContext = React.createContext<DialogContextType>({
|
||||
export const DialogContext = createContext<DialogContextType>({
|
||||
setIcon: () => null,
|
||||
setFooter: () => null,
|
||||
setIconPosition: () => null,
|
||||
});
|
||||
|
||||
export const DialogWrapperContext = React.createContext<DialogWrapperContextType>({
|
||||
export const DialogWrapperContext = createContext<DialogWrapperContextType>({
|
||||
props: {},
|
||||
setProps: () => null,
|
||||
close: () => null,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React from 'react';
|
||||
import * as React from 'react';
|
||||
import { IconPosition } from '@/components/elements/dialog/DialogIcon';
|
||||
|
||||
type Callback<T> = ((value: T) => void) | React.Dispatch<React.SetStateAction<T>>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue