diff --git a/app/javascript/gabsocial/components/dropdown_menu/dropdown_menu.js b/app/javascript/gabsocial/components/dropdown_menu/dropdown_menu.js index 8bb78cc7..20f5ab38 100644 --- a/app/javascript/gabsocial/components/dropdown_menu/dropdown_menu.js +++ b/app/javascript/gabsocial/components/dropdown_menu/dropdown_menu.js @@ -1,4 +1,5 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; +import ImmutablePureComponent from 'react-immutable-pure-component'; import detectPassiveEvents from 'detect-passive-events'; import Overlay from 'react-overlays/lib/Overlay'; import spring from 'react-motion/lib/spring'; @@ -159,7 +160,7 @@ class DropdownMenu extends PureComponent { } -export default class Dropdown extends PureComponent { +export default class Dropdown extends ImmutablePureComponent { static contextTypes = { router: PropTypes.object, diff --git a/app/javascript/gabsocial/components/icon/icon.js b/app/javascript/gabsocial/components/icon/icon.js index f31eca36..6b244602 100644 --- a/app/javascript/gabsocial/components/icon/icon.js +++ b/app/javascript/gabsocial/components/icon/icon.js @@ -1,5 +1,6 @@ import classNames from 'classnames'; +import './icon.scss'; export default class Icon extends PureComponent { static propTypes = { diff --git a/app/javascript/gabsocial/components/load_more/load_more.js b/app/javascript/gabsocial/components/load_more/load_more.js index 93e5b33a..70633591 100644 --- a/app/javascript/gabsocial/components/load_more/load_more.js +++ b/app/javascript/gabsocial/components/load_more/load_more.js @@ -1,4 +1,4 @@ -import { FormattedMessage, injectIntl, defineMessages } from 'react-intl'; +import { injectIntl, defineMessages } from 'react-intl'; import classNames from 'classnames'; import Icon from '../icon'; @@ -44,7 +44,7 @@ class LoadMore extends PureComponent { onClick={this.handleClick} aria-label={intl.formatMessage(messages.load_more)} > - {!gap && } + {!gap && intl.formatMessage(messages.load_more)} {gap && } ); diff --git a/app/javascript/gabsocial/components/media_gallery/media_gallery.js b/app/javascript/gabsocial/components/media_gallery/media_gallery.js index 07b163b9..db943f49 100644 --- a/app/javascript/gabsocial/components/media_gallery/media_gallery.js +++ b/app/javascript/gabsocial/components/media_gallery/media_gallery.js @@ -1,4 +1,5 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; +import ImmutablePureComponent from 'react-immutable-pure-component'; import { is } from 'immutable'; import { defineMessages, injectIntl } from 'react-intl'; import classNames from 'classnames'; @@ -15,7 +16,7 @@ const messages = defineMessages({ hidden: { id: 'status.media_hidden', defaultMessage: 'Media hidden' }, }); -class Item extends PureComponent { +class Item extends ImmutablePureComponent { static propTypes = { attachment: ImmutablePropTypes.map.isRequired, diff --git a/app/javascript/gabsocial/components/modal/compose_modal/compose_modal.js b/app/javascript/gabsocial/components/modal/compose_modal/compose_modal.js index 171b7c43..d1f6c7e8 100644 --- a/app/javascript/gabsocial/components/modal/compose_modal/compose_modal.js +++ b/app/javascript/gabsocial/components/modal/compose_modal/compose_modal.js @@ -1,11 +1,7 @@ -import ImmutablePropTypes from 'react-immutable-proptypes'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; -import Avatar from '../../avatar'; -import ComposeFormContainer from '../../../features/compose/containers/compose_form_container'; import { openModal } from '../../../actions/modal'; import { cancelReplyCompose } from '../../../actions/compose'; -import { me } from '../../../initial_state'; import ModalLayout from '../modal_layout'; const messages = defineMessages({ @@ -15,7 +11,6 @@ const messages = defineMessages({ const mapStateToProps = state => { return { - account: state.getIn(['accounts', me]), composeText: state.getIn(['compose', 'text']), }; }; @@ -25,7 +20,6 @@ export default @connect(mapStateToProps) class ComposeModal extends ImmutablePureComponent { static propTypes = { - account: ImmutablePropTypes.map, intl: PropTypes.object.isRequired, onClose: PropTypes.func.isRequired, composeText: PropTypes.string, @@ -49,16 +43,11 @@ class ComposeModal extends ImmutablePureComponent { }; render () { - const { intl, account } = this.props; + const { intl } = this.props; return ( -
-
- -
- -
+
); } diff --git a/app/javascript/gabsocial/components/modal/index.js b/app/javascript/gabsocial/components/modal/index.js index 0b3b90cb..c2eb25af 100644 --- a/app/javascript/gabsocial/components/modal/index.js +++ b/app/javascript/gabsocial/components/modal/index.js @@ -24,4 +24,4 @@ export { ReportModal, UnauthorizedModal, VideoModal, -} \ No newline at end of file +}; \ No newline at end of file diff --git a/app/javascript/gabsocial/components/modal/media_modal/media_modal.js b/app/javascript/gabsocial/components/modal/media_modal/media_modal.js index 26cad441..48776369 100644 --- a/app/javascript/gabsocial/components/modal/media_modal/media_modal.js +++ b/app/javascript/gabsocial/components/modal/media_modal/media_modal.js @@ -15,6 +15,7 @@ const messages = defineMessages({ close: { id: 'lightbox.close', defaultMessage: 'Close' }, previous: { id: 'lightbox.previous', defaultMessage: 'Previous' }, next: { id: 'lightbox.next', defaultMessage: 'Next' }, + viewContext: { id: 'lightbox.view_context', defaultMessage: 'View context' }, }); export const previewState = 'previewMediaModal'; @@ -228,7 +229,9 @@ class MediaModal extends ImmutablePureComponent { {status && (
1 })}> - + + {intl.formatMessage(messages.viewContext)} +
)} diff --git a/app/javascript/gabsocial/components/modal/mute_modal/mute_modal.js b/app/javascript/gabsocial/components/modal/mute_modal/mute_modal.js index eb55b76a..5a6e323f 100644 --- a/app/javascript/gabsocial/components/modal/mute_modal/mute_modal.js +++ b/app/javascript/gabsocial/components/modal/mute_modal/mute_modal.js @@ -1,10 +1,16 @@ -import { injectIntl, FormattedMessage } from 'react-intl'; +import { injectIntl, defineMessages } from 'react-intl'; import ToggleSwitch from '../../toggle_switch'; import Button from '../../button'; import { closeModal } from '../../../actions/modal'; import { muteAccount } from '../../../actions/accounts'; import { toggleHideNotifications } from '../../../actions/mutes'; +const messages = defineMessages({ + muteMessage: { id: 'confirmations.mute.message', defaultMessage: 'Are you sure you want to mute {name}?' }, + hideNotifications: { id: 'mute_modal.hide_notifications', defaultMessage: 'Hide notifications from this user?' }, + cancel: { id: 'confirmation_modal.cancel', defaultMessage: 'Cancel' }, + confirm: { id: 'confirmations.mute.confirm', defaultMessage: 'Mute' }, +}); const mapStateToProps = state => { return { @@ -72,15 +78,11 @@ class MuteModal extends PureComponent {

- @{account.get('acct')} }} - /> + {intl.formatMessage(messages.muteMessage, { name: @{account.get('acct')} })}

@@ -89,10 +91,10 @@ class MuteModal extends PureComponent {
diff --git a/app/javascript/gabsocial/components/modal/report_modal/report_modal.js b/app/javascript/gabsocial/components/modal/report_modal/report_modal.js index 1bc49568..df16b460 100644 --- a/app/javascript/gabsocial/components/modal/report_modal/report_modal.js +++ b/app/javascript/gabsocial/components/modal/report_modal/report_modal.js @@ -1,5 +1,5 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; -import { defineMessages, FormattedMessage, injectIntl } from 'react-intl'; +import { defineMessages, injectIntl } from 'react-intl'; import { OrderedSet } from 'immutable'; import ImmutablePureComponent from 'react-immutable-pure-component'; import ToggleSwitch from '../../toggle_switch'; @@ -14,6 +14,10 @@ const messages = defineMessages({ close: { id: 'lightbox.close', defaultMessage: 'Close' }, placeholder: { id: 'report.placeholder', defaultMessage: 'Additional comments' }, submit: { id: 'report.submit', defaultMessage: 'Submit' }, + hint: { id: 'report.hint', defaultMessage: 'The report will be sent to your server moderators. You can provide an explanation of why you are reporting this account below:' }, + forwardHint: { id: 'report.forward_hint', defaultMessage: 'The account is from another server. Send an anonymized copy of the report there as well?' }, + forward: { id: 'report.forward', defaultMessage: 'Forward to {target}' }, + target: { id: 'report.target', defaultMessage: 'Report {target}' }, }); const makeMapStateToProps = () => { @@ -89,12 +93,14 @@ class ReportModal extends ImmutablePureComponent {
- {account.get('acct')} }} /> + {intl.formatMessage(messages.target, { + target: {account.get('acct')} + })}
-

+

{intl.formatMessage(messages.hint)}