mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
added new flow presets
This commit is contained in:
parent
4e5a6d727a
commit
5cd1064140
18 changed files with 64 additions and 45 deletions
|
@ -2,7 +2,7 @@ import React, { ChangeEvent, FC, useCallback, useEffect } from 'react';
|
|||
|
||||
import { Icon } from '~/components/input/Icon';
|
||||
import { UploadSubject, UploadTarget, UploadType } from '~/constants/uploads';
|
||||
import { PRESETS } from '~/constants/urls';
|
||||
import { ImagePresets } from '~/constants/urls';
|
||||
import { useUploader } from '~/hooks/data/useUploader';
|
||||
import { useNodeFormContext } from '~/hooks/node/useNodeFormFormik';
|
||||
import { IEditorComponentProps } from '~/types/node';
|
||||
|
@ -21,7 +21,7 @@ const EditorUploadCoverButton: FC<IProps> = () => {
|
|||
values.cover ? [values.cover] : []
|
||||
);
|
||||
|
||||
const background = values.cover ? getURL(values.cover, PRESETS['300']) : null;
|
||||
const background = values.cover ? getURL(values.cover, ImagePresets['300']) : null;
|
||||
const preview = pendingImages?.[0]?.thumbnail || '';
|
||||
|
||||
const onDropCover = useCallback(() => {
|
||||
|
|
|
@ -5,7 +5,7 @@ import { SortableContainer } from 'react-sortable-hoc';
|
|||
|
||||
import { SortableImageGridItem } from '~/components/editors/SortableImageGridItem';
|
||||
import { ImageUpload } from '~/components/upload/ImageUpload';
|
||||
import { PRESETS } from '~/constants/urls';
|
||||
import { ImagePresets } from '~/constants/urls';
|
||||
import { UploadStatus } from '~/store/uploader/UploaderStore';
|
||||
import { IFile } from '~/types';
|
||||
import { getURL } from '~/utils/dom';
|
||||
|
@ -33,7 +33,11 @@ const SortableImageGrid = SortableContainer(
|
|||
.filter(file => file && file.id)
|
||||
.map((file, index) => (
|
||||
<SortableImageGridItem key={file.id} index={index} collection={0}>
|
||||
<ImageUpload id={file.id} thumb={getURL(file, PRESETS.cover)} onDrop={onDelete} />
|
||||
<ImageUpload
|
||||
id={file.id}
|
||||
thumb={getURL(file, ImagePresets.cover)}
|
||||
onDrop={onDelete}
|
||||
/>
|
||||
</SortableImageGridItem>
|
||||
))}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue