mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 21:06:42 +07:00
Merge branch 'master' into 15-use-cra-or-nextjs
# Conflicts: # src/components/node/CommentForm/index.tsx # src/utils/node.ts
This commit is contained in:
commit
332d09e3bd
46 changed files with 936 additions and 487 deletions
|
@ -25,14 +25,14 @@ type Props = ReturnType<typeof mapStateToProps> &
|
|||
typeof mapDispatchToProps & {
|
||||
file: IFile;
|
||||
isEditing?: boolean;
|
||||
onDrop?: (id: IFile['id']) => void;
|
||||
onDelete?: (id: IFile['id']) => void;
|
||||
onTitleChange?: (file_id: IFile['id'], title: IFile['metadata']['title']) => void;
|
||||
};
|
||||
|
||||
const AudioPlayerUnconnected = memo(
|
||||
({
|
||||
file,
|
||||
onDrop,
|
||||
onDelete,
|
||||
isEditing,
|
||||
onTitleChange,
|
||||
player: { file: current, status },
|
||||
|
@ -78,10 +78,10 @@ const AudioPlayerUnconnected = memo(
|
|||
);
|
||||
|
||||
const onDropClick = useCallback(() => {
|
||||
if (!onDrop) return;
|
||||
if (!onDelete) return;
|
||||
|
||||
onDrop(file.id);
|
||||
}, [file, onDrop]);
|
||||
onDelete(file.id);
|
||||
}, [file, onDelete]);
|
||||
|
||||
const title = useMemo(
|
||||
() =>
|
||||
|
@ -111,7 +111,7 @@ const AudioPlayerUnconnected = memo(
|
|||
|
||||
return (
|
||||
<div onClick={onPlay} className={classNames(styles.wrap, { playing })}>
|
||||
{onDrop && (
|
||||
{onDelete && (
|
||||
<div className={styles.drop} onMouseDown={onDropClick}>
|
||||
<Icon icon="close" />
|
||||
</div>
|
||||
|
@ -149,7 +149,4 @@ const AudioPlayerUnconnected = memo(
|
|||
}
|
||||
);
|
||||
|
||||
export const AudioPlayer = connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(AudioPlayerUnconnected);
|
||||
export const AudioPlayer = connect(mapStateToProps, mapDispatchToProps)(AudioPlayerUnconnected);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue