mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
removed upload redux store
This commit is contained in:
parent
140e36b6b7
commit
95b92b643f
38 changed files with 398 additions and 691 deletions
|
@ -4,7 +4,7 @@ import { append, assocPath, path } from 'ramda';
|
|||
import { formatCommentText, getPrettyDate, getURL } from '~/utils/dom';
|
||||
import { Group } from '~/components/containers/Group';
|
||||
import styles from './styles.module.scss';
|
||||
import { UPLOAD_TYPES } from '~/redux/uploads/constants';
|
||||
import { UploadType } from '~/constants/uploads';
|
||||
import reduce from 'ramda/es/reduce';
|
||||
import { AudioPlayer } from '~/components/media/AudioPlayer';
|
||||
import classnames from 'classnames';
|
||||
|
@ -30,12 +30,12 @@ const CommentContent: FC<IProps> = memo(
|
|||
const startEditing = useCallback(() => setIsEditing(true), [setIsEditing]);
|
||||
const stopEditing = useCallback(() => setIsEditing(false), [setIsEditing]);
|
||||
|
||||
const groupped = useMemo<Record<keyof typeof UPLOAD_TYPES, IFile[]>>(
|
||||
const groupped = useMemo<Record<UploadType, IFile[]>>(
|
||||
() =>
|
||||
reduce(
|
||||
(group, file) =>
|
||||
file.type ? assocPath([file.type], append(file, group[file.type]), group) : group,
|
||||
{},
|
||||
{} as Record<UploadType, IFile[]>,
|
||||
comment.files
|
||||
),
|
||||
[comment]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue