2017-12-24 15:16:45 +09:00
|
|
|
// Package imports.
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import React from 'react';
|
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
|
|
|
|
|
// Actions.
|
|
|
|
import {
|
|
|
|
cancelReplyCompose,
|
|
|
|
changeCompose,
|
|
|
|
changeComposeSensitivity,
|
|
|
|
changeComposeSpoilerText,
|
|
|
|
changeComposeSpoilerness,
|
|
|
|
changeComposeVisibility,
|
|
|
|
changeUploadCompose,
|
|
|
|
clearComposeSuggestions,
|
|
|
|
fetchComposeSuggestions,
|
|
|
|
insertEmojiCompose,
|
2018-01-06 11:30:06 +09:00
|
|
|
mountCompose,
|
2017-12-24 15:16:45 +09:00
|
|
|
selectComposeSuggestion,
|
|
|
|
submitCompose,
|
|
|
|
toggleComposeAdvancedOption,
|
|
|
|
undoUploadCompose,
|
2018-01-06 11:30:06 +09:00
|
|
|
unmountCompose,
|
2017-12-24 15:16:45 +09:00
|
|
|
uploadCompose,
|
|
|
|
} from 'flavours/glitch/actions/compose';
|
|
|
|
import {
|
|
|
|
closeModal,
|
|
|
|
openModal,
|
|
|
|
} from 'flavours/glitch/actions/modal';
|
|
|
|
|
|
|
|
// Components.
|
|
|
|
import ComposerOptions from './options';
|
|
|
|
import ComposerPublisher from './publisher';
|
|
|
|
import ComposerReply from './reply';
|
|
|
|
import ComposerSpoiler from './spoiler';
|
|
|
|
import ComposerTextarea from './textarea';
|
|
|
|
import ComposerUploadForm from './upload_form';
|
|
|
|
import ComposerWarning from './warning';
|
|
|
|
|
|
|
|
// Utils.
|
|
|
|
import { countableText } from 'flavours/glitch/util/counter';
|
|
|
|
import { me } from 'flavours/glitch/util/initial_state';
|
|
|
|
import { isMobile } from 'flavours/glitch/util/is_mobile';
|
|
|
|
import { assignHandlers } from 'flavours/glitch/util/react_helpers';
|
2017-12-27 09:54:28 +09:00
|
|
|
import { wrap } from 'flavours/glitch/util/redux_helpers';
|
2017-12-24 15:16:45 +09:00
|
|
|
|
|
|
|
// State mapping.
|
|
|
|
function mapStateToProps (state) {
|
|
|
|
const inReplyTo = state.getIn(['compose', 'in_reply_to']);
|
|
|
|
return {
|
|
|
|
acceptContentTypes: state.getIn(['media_attachments', 'accept_content_types']).toArray().join(','),
|
|
|
|
amUnlocked: !state.getIn(['accounts', me, 'locked']),
|
|
|
|
doNotFederate: state.getIn(['compose', 'advanced_options', 'do_not_federate']),
|
|
|
|
focusDate: state.getIn(['compose', 'focusDate']),
|
|
|
|
isSubmitting: state.getIn(['compose', 'is_submitting']),
|
|
|
|
isUploading: state.getIn(['compose', 'is_uploading']),
|
2018-01-04 05:36:21 +09:00
|
|
|
layout: state.getIn(['local_settings', 'layout']),
|
2017-12-24 15:16:45 +09:00
|
|
|
media: state.getIn(['compose', 'media_attachments']),
|
|
|
|
preselectDate: state.getIn(['compose', 'preselectDate']),
|
|
|
|
privacy: state.getIn(['compose', 'privacy']),
|
|
|
|
progress: state.getIn(['compose', 'progress']),
|
2018-01-06 13:04:13 +09:00
|
|
|
replyAccount: inReplyTo ? state.getIn(['statuses', inReplyTo, 'account']) : null,
|
2017-12-24 15:16:45 +09:00
|
|
|
replyContent: inReplyTo ? state.getIn(['statuses', inReplyTo, 'contentHtml']) : null,
|
|
|
|
resetFileKey: state.getIn(['compose', 'resetFileKey']),
|
|
|
|
sideArm: state.getIn(['local_settings', 'side_arm']),
|
|
|
|
sensitive: state.getIn(['compose', 'sensitive']),
|
|
|
|
showSearch: state.getIn(['search', 'submitted']) && !state.getIn(['search', 'hidden']),
|
|
|
|
spoiler: state.getIn(['compose', 'spoiler']),
|
|
|
|
spoilerText: state.getIn(['compose', 'spoiler_text']),
|
|
|
|
suggestionToken: state.getIn(['compose', 'suggestion_token']),
|
|
|
|
suggestions: state.getIn(['compose', 'suggestions']),
|
|
|
|
text: state.getIn(['compose', 'text']),
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
// Dispatch mapping.
|
2018-01-04 05:36:21 +09:00
|
|
|
const mapDispatchToProps = {
|
|
|
|
onCancelReply: cancelReplyCompose,
|
|
|
|
onChangeDescription: changeUploadCompose,
|
|
|
|
onChangeSensitivity: changeComposeSensitivity,
|
|
|
|
onChangeSpoilerText: changeComposeSpoilerText,
|
|
|
|
onChangeSpoilerness: changeComposeSpoilerness,
|
|
|
|
onChangeText: changeCompose,
|
|
|
|
onChangeVisibility: changeComposeVisibility,
|
|
|
|
onClearSuggestions: clearComposeSuggestions,
|
|
|
|
onCloseModal: closeModal,
|
|
|
|
onFetchSuggestions: fetchComposeSuggestions,
|
|
|
|
onInsertEmoji: insertEmojiCompose,
|
2018-01-06 11:30:06 +09:00
|
|
|
onMount: mountCompose,
|
2018-01-04 05:36:21 +09:00
|
|
|
onOpenActionsModal: openModal.bind(null, 'ACTIONS'),
|
|
|
|
onOpenDoodleModal: openModal.bind(null, 'DOODLE', { noEsc: true }),
|
|
|
|
onSelectSuggestion: selectComposeSuggestion,
|
|
|
|
onSubmit: submitCompose,
|
|
|
|
onToggleAdvancedOption: toggleComposeAdvancedOption,
|
|
|
|
onUndoUpload: undoUploadCompose,
|
2018-01-06 11:30:06 +09:00
|
|
|
onUnmount: unmountCompose,
|
2018-01-04 05:36:21 +09:00
|
|
|
onUpload: uploadCompose,
|
|
|
|
};
|
2017-12-24 15:16:45 +09:00
|
|
|
|
|
|
|
// Handlers.
|
|
|
|
const handlers = {
|
|
|
|
|
|
|
|
// Changes the text value of the spoiler.
|
2018-01-04 05:36:21 +09:00
|
|
|
handleChangeSpoiler ({ target: { value } }) {
|
|
|
|
const { onChangeSpoilerText } = this.props;
|
|
|
|
if (onChangeSpoilerText) {
|
|
|
|
onChangeSpoilerText(value);
|
2017-12-24 15:16:45 +09:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
// Inserts an emoji at the caret.
|
2018-01-04 05:36:21 +09:00
|
|
|
handleEmoji (data) {
|
2017-12-24 15:16:45 +09:00
|
|
|
const { textarea: { selectionStart } } = this;
|
2018-01-04 05:36:21 +09:00
|
|
|
const { onInsertEmoji } = this.props;
|
2017-12-24 15:16:45 +09:00
|
|
|
this.caretPos = selectionStart + data.native.length + 1;
|
2018-01-04 05:36:21 +09:00
|
|
|
if (onInsertEmoji) {
|
|
|
|
onInsertEmoji(selectionStart, data);
|
2017-12-24 15:16:45 +09:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
// Handles the secondary submit button.
|
2018-01-04 05:36:21 +09:00
|
|
|
handleSecondarySubmit () {
|
|
|
|
const { handleSubmit } = this.handlers;
|
2017-12-24 15:16:45 +09:00
|
|
|
const {
|
2018-01-04 05:36:21 +09:00
|
|
|
onChangeVisibility,
|
|
|
|
sideArm,
|
2017-12-24 15:16:45 +09:00
|
|
|
} = this.props;
|
2018-01-04 05:36:21 +09:00
|
|
|
if (sideArm !== 'none' && onChangeVisibility) {
|
|
|
|
onChangeVisibility(sideArm);
|
2017-12-24 15:16:45 +09:00
|
|
|
}
|
2018-01-04 05:36:21 +09:00
|
|
|
handleSubmit();
|
2017-12-24 15:16:45 +09:00
|
|
|
},
|
|
|
|
|
|
|
|
// Selects a suggestion from the autofill.
|
2018-01-04 05:36:21 +09:00
|
|
|
handleSelect (tokenStart, token, value) {
|
|
|
|
const { onSelectSuggestion } = this.props;
|
2017-12-24 15:16:45 +09:00
|
|
|
this.caretPos = null;
|
2018-01-04 05:36:21 +09:00
|
|
|
if (onSelectSuggestion) {
|
|
|
|
onSelectSuggestion(tokenStart, token, value);
|
2017-12-24 15:16:45 +09:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
// Submits the status.
|
2018-01-04 05:36:21 +09:00
|
|
|
handleSubmit () {
|
2017-12-24 15:16:45 +09:00
|
|
|
const { textarea: { value } } = this;
|
|
|
|
const {
|
2018-01-04 05:36:21 +09:00
|
|
|
onChangeText,
|
|
|
|
onSubmit,
|
|
|
|
text,
|
2017-12-24 15:16:45 +09:00
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
// If something changes inside the textarea, then we update the
|
|
|
|
// state before submitting.
|
2018-01-04 05:36:21 +09:00
|
|
|
if (onChangeText && text !== value) {
|
|
|
|
onChangeText(value);
|
2017-12-24 15:16:45 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
// Submits the status.
|
2018-01-04 05:36:21 +09:00
|
|
|
if (onSubmit) {
|
|
|
|
onSubmit();
|
2017-12-24 15:16:45 +09:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
// Sets a reference to the textarea.
|
2018-01-04 05:36:21 +09:00
|
|
|
handleRefTextarea (textareaComponent) {
|
|
|
|
if (textareaComponent) {
|
|
|
|
this.textarea = textareaComponent.textarea;
|
|
|
|
}
|
2017-12-24 15:16:45 +09:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
// The component.
|
2017-12-27 09:54:28 +09:00
|
|
|
class Composer extends React.Component {
|
2017-12-24 15:16:45 +09:00
|
|
|
|
|
|
|
// Constructor.
|
|
|
|
constructor (props) {
|
|
|
|
super(props);
|
|
|
|
assignHandlers(this, handlers);
|
|
|
|
|
|
|
|
// Instance variables.
|
|
|
|
this.caretPos = null;
|
|
|
|
this.textarea = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
// If this is the update where we've finished uploading,
|
|
|
|
// save the last caret position so we can restore it below!
|
|
|
|
componentWillReceiveProps (nextProps) {
|
2018-01-04 05:36:21 +09:00
|
|
|
const { textarea } = this;
|
|
|
|
const { isUploading } = this.props;
|
|
|
|
if (textarea && isUploading && !nextProps.isUploading) {
|
|
|
|
this.caretPos = textarea.selectionStart;
|
2017-12-24 15:16:45 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-06 11:30:06 +09:00
|
|
|
// Tells our state the composer has been mounted.
|
|
|
|
componentDidMount () {
|
|
|
|
const { onMount } = this.props;
|
|
|
|
if (onMount) {
|
|
|
|
onMount();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Tells our state the composer has been unmounted.
|
|
|
|
componentWillUnmount () {
|
|
|
|
const { onUnmount } = this.props;
|
|
|
|
if (onUnmount) {
|
|
|
|
onUnmount();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-24 15:16:45 +09:00
|
|
|
// This statement does several things:
|
|
|
|
// - If we're beginning a reply, and,
|
|
|
|
// - Replying to zero or one users, places the cursor at the end
|
|
|
|
// of the textbox.
|
|
|
|
// - Replying to more than one user, selects any usernames past
|
|
|
|
// the first; this provides a convenient shortcut to drop
|
|
|
|
// everyone else from the conversation.
|
|
|
|
// - If we've just finished uploading an image, and have a saved
|
|
|
|
// caret position, restores the cursor to that position after the
|
|
|
|
// text changes.
|
|
|
|
componentDidUpdate (prevProps) {
|
|
|
|
const {
|
|
|
|
caretPos,
|
|
|
|
textarea,
|
|
|
|
} = this;
|
|
|
|
const {
|
2018-01-04 05:36:21 +09:00
|
|
|
focusDate,
|
|
|
|
isUploading,
|
|
|
|
isSubmitting,
|
|
|
|
preselectDate,
|
|
|
|
text,
|
2017-12-24 15:16:45 +09:00
|
|
|
} = this.props;
|
|
|
|
let selectionEnd, selectionStart;
|
|
|
|
|
|
|
|
// Caret/selection handling.
|
2018-01-04 05:36:21 +09:00
|
|
|
if (focusDate !== prevProps.focusDate || (prevProps.isUploading && !isUploading && !isNaN(caretPos) && caretPos !== null)) {
|
2017-12-24 15:16:45 +09:00
|
|
|
switch (true) {
|
2018-01-04 05:36:21 +09:00
|
|
|
case preselectDate !== prevProps.preselectDate:
|
2017-12-24 15:16:45 +09:00
|
|
|
selectionStart = text.search(/\s/) + 1;
|
|
|
|
selectionEnd = text.length;
|
|
|
|
break;
|
|
|
|
case !isNaN(caretPos) && caretPos !== null:
|
|
|
|
selectionStart = selectionEnd = caretPos;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
selectionStart = selectionEnd = text.length;
|
|
|
|
}
|
2018-01-04 05:36:21 +09:00
|
|
|
if (textarea) {
|
|
|
|
textarea.setSelectionRange(selectionStart, selectionEnd);
|
|
|
|
textarea.focus();
|
|
|
|
}
|
2017-12-24 15:16:45 +09:00
|
|
|
|
|
|
|
// Refocuses the textarea after submitting.
|
2018-01-04 05:36:21 +09:00
|
|
|
} else if (textarea && prevProps.isSubmitting && !isSubmitting) {
|
2017-12-24 15:16:45 +09:00
|
|
|
textarea.focus();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
render () {
|
|
|
|
const {
|
2018-01-04 05:36:21 +09:00
|
|
|
handleChangeSpoiler,
|
|
|
|
handleEmoji,
|
|
|
|
handleSecondarySubmit,
|
|
|
|
handleSelect,
|
|
|
|
handleSubmit,
|
|
|
|
handleRefTextarea,
|
2017-12-24 15:16:45 +09:00
|
|
|
} = this.handlers;
|
|
|
|
const {
|
2018-01-04 05:36:21 +09:00
|
|
|
acceptContentTypes,
|
|
|
|
amUnlocked,
|
|
|
|
doNotFederate,
|
2017-12-24 15:16:45 +09:00
|
|
|
intl,
|
2018-01-04 05:36:21 +09:00
|
|
|
isSubmitting,
|
|
|
|
isUploading,
|
|
|
|
layout,
|
|
|
|
media,
|
|
|
|
onCancelReply,
|
|
|
|
onChangeDescription,
|
|
|
|
onChangeSensitivity,
|
|
|
|
onChangeSpoilerness,
|
|
|
|
onChangeText,
|
|
|
|
onChangeVisibility,
|
|
|
|
onClearSuggestions,
|
|
|
|
onCloseModal,
|
|
|
|
onFetchSuggestions,
|
|
|
|
onOpenActionsModal,
|
|
|
|
onOpenDoodleModal,
|
|
|
|
onToggleAdvancedOption,
|
|
|
|
onUndoUpload,
|
|
|
|
onUpload,
|
|
|
|
privacy,
|
|
|
|
progress,
|
|
|
|
replyAccount,
|
|
|
|
replyContent,
|
|
|
|
resetFileKey,
|
|
|
|
sensitive,
|
|
|
|
showSearch,
|
|
|
|
sideArm,
|
|
|
|
spoiler,
|
|
|
|
spoilerText,
|
|
|
|
suggestions,
|
|
|
|
text,
|
2017-12-24 15:16:45 +09:00
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
return (
|
2018-01-04 05:36:21 +09:00
|
|
|
<div className='composer'>
|
2017-12-24 15:16:45 +09:00
|
|
|
<ComposerSpoiler
|
|
|
|
hidden={!spoiler}
|
|
|
|
intl={intl}
|
2018-01-04 05:36:21 +09:00
|
|
|
onChange={handleChangeSpoiler}
|
|
|
|
onSubmit={handleSubmit}
|
2017-12-24 15:16:45 +09:00
|
|
|
text={spoilerText}
|
|
|
|
/>
|
|
|
|
{privacy === 'private' && amUnlocked ? <ComposerWarning /> : null}
|
|
|
|
{replyContent ? (
|
|
|
|
<ComposerReply
|
|
|
|
account={replyAccount}
|
|
|
|
content={replyContent}
|
|
|
|
intl={intl}
|
2018-01-04 05:36:21 +09:00
|
|
|
onCancel={onCancelReply}
|
2017-12-24 15:16:45 +09:00
|
|
|
/>
|
|
|
|
) : null}
|
|
|
|
<ComposerTextarea
|
2018-01-04 05:36:21 +09:00
|
|
|
autoFocus={!showSearch && !isMobile(window.innerWidth, layout)}
|
2017-12-24 15:16:45 +09:00
|
|
|
disabled={isSubmitting}
|
|
|
|
intl={intl}
|
2018-01-04 05:36:21 +09:00
|
|
|
onChange={onChangeText}
|
|
|
|
onPaste={onUpload}
|
|
|
|
onPickEmoji={handleEmoji}
|
|
|
|
onSubmit={handleSubmit}
|
|
|
|
onSuggestionsClearRequested={onClearSuggestions}
|
|
|
|
onSuggestionsFetchRequested={onFetchSuggestions}
|
|
|
|
onSuggestionSelected={handleSelect}
|
|
|
|
ref={handleRefTextarea}
|
2017-12-24 15:16:45 +09:00
|
|
|
suggestions={suggestions}
|
|
|
|
value={text}
|
|
|
|
/>
|
2018-01-04 05:36:21 +09:00
|
|
|
{isUploading || media && media.size ? (
|
2017-12-24 15:16:45 +09:00
|
|
|
<ComposerUploadForm
|
|
|
|
intl={intl}
|
|
|
|
media={media}
|
2018-01-04 05:36:21 +09:00
|
|
|
onChangeDescription={onChangeDescription}
|
|
|
|
onRemove={onUndoUpload}
|
2017-12-24 15:16:45 +09:00
|
|
|
progress={progress}
|
2018-01-04 05:36:21 +09:00
|
|
|
uploading={isUploading}
|
2017-12-24 15:16:45 +09:00
|
|
|
/>
|
|
|
|
) : null}
|
|
|
|
<ComposerOptions
|
|
|
|
acceptContentTypes={acceptContentTypes}
|
|
|
|
disabled={isSubmitting}
|
|
|
|
doNotFederate={doNotFederate}
|
|
|
|
full={media.size >= 4 || media.some(
|
|
|
|
item => item.get('type') === 'video'
|
|
|
|
)}
|
|
|
|
hasMedia={!!media.size}
|
|
|
|
intl={intl}
|
2018-01-04 05:36:21 +09:00
|
|
|
onChangeSensitivity={onChangeSensitivity}
|
|
|
|
onChangeVisibility={onChangeVisibility}
|
|
|
|
onDoodleOpen={onOpenDoodleModal}
|
|
|
|
onModalClose={onCloseModal}
|
|
|
|
onModalOpen={onOpenActionsModal}
|
|
|
|
onToggleAdvancedOption={onToggleAdvancedOption}
|
|
|
|
onToggleSpoiler={onChangeSpoilerness}
|
|
|
|
onUpload={onUpload}
|
2017-12-24 15:16:45 +09:00
|
|
|
privacy={privacy}
|
|
|
|
resetFileKey={resetFileKey}
|
|
|
|
sensitive={sensitive}
|
|
|
|
spoiler={spoiler}
|
|
|
|
/>
|
|
|
|
<ComposerPublisher
|
|
|
|
countText={`${spoilerText}${countableText(text)}${doNotFederate ? ' 👁️' : ''}`}
|
2018-01-04 05:36:21 +09:00
|
|
|
disabled={isSubmitting || isUploading || !!text.length && !text.trim().length}
|
2017-12-24 15:16:45 +09:00
|
|
|
intl={intl}
|
2018-01-04 05:36:21 +09:00
|
|
|
onSecondarySubmit={handleSecondarySubmit}
|
|
|
|
onSubmit={handleSubmit}
|
2017-12-24 15:16:45 +09:00
|
|
|
privacy={privacy}
|
|
|
|
sideArm={sideArm}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// Props.
|
|
|
|
Composer.propTypes = {
|
|
|
|
intl: PropTypes.object.isRequired,
|
2017-12-27 09:54:28 +09:00
|
|
|
|
2018-01-04 05:36:21 +09:00
|
|
|
// State props.
|
|
|
|
acceptContentTypes: PropTypes.string,
|
|
|
|
amUnlocked: PropTypes.bool,
|
|
|
|
doNotFederate: PropTypes.bool,
|
|
|
|
focusDate: PropTypes.instanceOf(Date),
|
|
|
|
isSubmitting: PropTypes.bool,
|
|
|
|
isUploading: PropTypes.bool,
|
|
|
|
layout: PropTypes.string,
|
|
|
|
media: ImmutablePropTypes.list,
|
|
|
|
preselectDate: PropTypes.instanceOf(Date),
|
|
|
|
privacy: PropTypes.string,
|
|
|
|
progress: PropTypes.number,
|
2018-01-06 13:04:13 +09:00
|
|
|
replyAccount: PropTypes.string,
|
2018-01-04 05:36:21 +09:00
|
|
|
replyContent: PropTypes.string,
|
|
|
|
resetFileKey: PropTypes.number,
|
|
|
|
sideArm: PropTypes.string,
|
|
|
|
sensitive: PropTypes.bool,
|
|
|
|
showSearch: PropTypes.bool,
|
|
|
|
spoiler: PropTypes.bool,
|
|
|
|
spoilerText: PropTypes.string,
|
|
|
|
suggestionToken: PropTypes.string,
|
|
|
|
suggestions: ImmutablePropTypes.list,
|
|
|
|
text: PropTypes.string,
|
|
|
|
|
|
|
|
// Dispatch props.
|
|
|
|
onCancelReply: PropTypes.func,
|
|
|
|
onChangeDescription: PropTypes.func,
|
|
|
|
onChangeSensitivity: PropTypes.func,
|
|
|
|
onChangeSpoilerText: PropTypes.func,
|
|
|
|
onChangeSpoilerness: PropTypes.func,
|
|
|
|
onChangeText: PropTypes.func,
|
|
|
|
onChangeVisibility: PropTypes.func,
|
|
|
|
onClearSuggestions: PropTypes.func,
|
|
|
|
onCloseModal: PropTypes.func,
|
|
|
|
onFetchSuggestions: PropTypes.func,
|
|
|
|
onInsertEmoji: PropTypes.func,
|
2018-01-06 11:30:06 +09:00
|
|
|
onMount: PropTypes.func,
|
2018-01-04 05:36:21 +09:00
|
|
|
onOpenActionsModal: PropTypes.func,
|
|
|
|
onOpenDoodleModal: PropTypes.func,
|
|
|
|
onSelectSuggestion: PropTypes.func,
|
|
|
|
onSubmit: PropTypes.func,
|
|
|
|
onToggleAdvancedOption: PropTypes.func,
|
|
|
|
onUndoUpload: PropTypes.func,
|
2018-01-06 11:30:06 +09:00
|
|
|
onUnmount: PropTypes.func,
|
2018-01-04 05:36:21 +09:00
|
|
|
onUpload: PropTypes.func,
|
2017-12-28 07:28:41 +09:00
|
|
|
};
|
|
|
|
|
2017-12-27 09:54:28 +09:00
|
|
|
// Connecting and export.
|
|
|
|
export { Composer as WrappedComponent };
|
|
|
|
export default wrap(Composer, mapStateToProps, mapDispatchToProps, true);
|