diff --git a/app/javascript/flavours/glitch/features/ui/components/gif_modal.js b/app/javascript/flavours/glitch/features/ui/components/gif_modal.js index 8498602723..a13bfd60cb 100644 --- a/app/javascript/flavours/glitch/features/ui/components/gif_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/gif_modal.js @@ -1,15 +1,20 @@ import React from 'react'; import PropTypes from 'prop-types'; -import Button from 'flavours/glitch/components/button'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { connect } from 'react-redux'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { giphySet, uploadCompose } from 'flavours/glitch/actions/compose'; import IconButton from 'flavours/glitch/components/icon_button'; -import { debounce, mapValues } from 'lodash'; -import classNames from 'classnames'; import ReactGiphySearchbox from 'react-giphy-searchbox' -import { changeCompose } from 'flavours/glitch/actions/compose'; +import { defineMessages, injectIntl } from 'react-intl'; + +const messages = defineMessages({ + search: { id: 'giphy.search', defaultMessage: 'Search for GIFs' }, + error: { id: 'giphy.error', defaultMessage: 'Oops! Something went wrong. Please, try again.' }, + loading: { id: 'giphy.loading', defaultMessage: 'Loading...'}, + nomatches: { id: 'giphy.nomatches', defaultMessage: 'No matches found.' }, + close: { id: 'settings.close', defaultMessage: 'Close' }, +}); // Utility for converting base64 image to binary for upload // https://stackoverflow.com/questions/35940290/how-to-convert-base64-string-to-javascript-file-object-like-as-from-file-input-f @@ -34,19 +39,17 @@ const mapDispatchToProps = dispatch => ({ }); export default @connect(mapStateToProps, mapDispatchToProps) +@injectIntl class GIFModal extends ImmutablePureComponent { static propTypes = { + intl: PropTypes.object.isRequired, options: ImmutablePropTypes.map, onClose: PropTypes.func.isRequired, setOpt: PropTypes.func.isRequired, submit: PropTypes.func.isRequired, }; - componentDidMount() { - //If component mounted - } - onDoneButton = (item) => { const url = item["images"]["original"]["mp4"]; var modal = this; @@ -64,31 +67,14 @@ class GIFModal extends ImmutablePureComponent { }); }; - handleClick = () => { - this.props.onClose(); - } - - handleCancel = () => { - this.props.onClose(); - } - - setRef = (c) => { - this.button = c; - } - - toggleNotifications = () => { - this.props.onToggleNotifications(); - } - - changeMuteDuration = (e) => { - this.props.onChangeMuteDuration(e); - } - render () { + const { intl } = this.props; + return ( -