mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
removed upload redux store
This commit is contained in:
parent
140e36b6b7
commit
95b92b643f
38 changed files with 398 additions and 691 deletions
|
@ -1,27 +1,27 @@
|
|||
import React, { ChangeEvent, FC, useCallback } from 'react';
|
||||
import styles from './styles.module.scss';
|
||||
import { Icon } from '~/components/input/Icon';
|
||||
import { UPLOAD_TYPES } from '~/redux/uploads/constants';
|
||||
import { UploadType } from '~/constants/uploads';
|
||||
import { IEditorComponentProps } from '~/types/node';
|
||||
import { useFileUploaderContext } from '~/hooks/data/useFileUploader';
|
||||
import { getFileType } from '~/utils/uploader';
|
||||
import { useNodeFormContext } from '~/hooks/node/useNodeFormFormik';
|
||||
import { Button } from '~/components/input/Button';
|
||||
import { useUploaderContext } from '~/utils/context/UploaderContextProvider';
|
||||
|
||||
type IProps = IEditorComponentProps & {
|
||||
accept?: string;
|
||||
icon?: string;
|
||||
type?: typeof UPLOAD_TYPES[keyof typeof UPLOAD_TYPES];
|
||||
type?: UploadType;
|
||||
label?: string;
|
||||
};
|
||||
|
||||
const EditorUploadButton: FC<IProps> = ({
|
||||
accept = 'image/*',
|
||||
icon = 'plus',
|
||||
type = UPLOAD_TYPES.IMAGE,
|
||||
type = UploadType.Image,
|
||||
label,
|
||||
}) => {
|
||||
const { uploadFiles } = useFileUploaderContext()!;
|
||||
const { uploadFiles } = useUploaderContext()!;
|
||||
const { values } = useNodeFormContext();
|
||||
|
||||
const onInputChange = useCallback(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue