From c58d621daf93c83cb764d297265c96a8bd357cc1 Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Tue, 13 Aug 2019 11:54:29 -0400 Subject: [PATCH] Updated components, style modules --- .../components/dropdown_menu/dropdown_menu.js | 3 +- .../gabsocial/components/icon/icon.js | 1 + .../components/load_more/load_more.js | 4 +- .../components/media_gallery/media_gallery.js | 3 +- .../modal/compose_modal/compose_modal.js | 15 +- .../gabsocial/components/modal/index.js | 2 +- .../modal/media_modal/media_modal.js | 5 +- .../components/modal/mute_modal/mute_modal.js | 20 +- .../modal/report_modal/report_modal.js | 20 +- .../components/modal_root/modal_root.js | 3 +- .../gabsocial/components/poll/poll.js | 6 +- .../gabsocial/components/search/index.js | 1 + .../gabsocial/components/search/search.js | 79 +++--- .../section_headline_bar.js | 14 +- .../setting_toggle/setting_toggle.js | 3 +- .../gabsocial/components/status/status.js | 2 +- .../status_check_box/status_check_box.js | 3 +- .../status_content/status_content.js | 3 +- .../timeline_compose_block/index.js | 1 + .../timeline_compose_block.js | 40 +++ .../timeline_compose_block.scss | 19 ++ .../account_gallery/account_gallery.js | 228 ++++++++++++++++++ .../account_gallery/account_gallery.scss | 5 + .../features/account_gallery/index.js | 217 +---------------- .../account_timeline/account_timeline.js | 155 ++++++++++++ .../features/account_timeline/index.js | 148 +----------- .../community_timeline/community_timeline.js | 121 ++++++++++ .../features/community_timeline/index.js | 122 +--------- .../compose_search/compose_search.js | 69 ++++++ .../components/compose_search/index.js | 1 + .../emoji_picker_dropdown.js | 5 +- .../compose/components/poll_form/poll_form.js | 2 +- .../features/compose/components/search.js | 98 -------- .../gabsocial/features/compose/compose.js | 5 +- .../compose/containers/search_container.js | 4 +- .../follow_requests/follow_requests.js | 63 +++++ .../features/follow_requests/index.js | 64 +---- .../generic_not_found/generic_not_found.js | 11 + .../features/generic_not_found/index.js | 8 +- .../gabsocial/features/groups/edit/index.js | 5 +- .../features/groups/timeline/index.js | 30 +-- .../column_settings/column_settings.js | 3 +- .../components/list_editor_search/index.js | 1 + .../list_editor_search.js} | 44 ++-- .../features/list_editor/list_editor.js | 4 +- .../column_settings/column_settings.js | 3 +- .../gabsocial/features/notifications/index.js | 188 +-------------- .../features/notifications/notifications.js | 188 +++++++++++++++ .../features/standalone/compose/compose.js | 19 ++ .../features/standalone/compose/index.js | 20 +- .../hashtag_timeline/hashtag_timeline.js | 82 +++++++ .../standalone/hashtag_timeline/index.js | 82 +------ .../standalone/public_timeline/index.js | 97 +------- .../public_timeline/public_timeline.js | 97 ++++++++ .../status/components/{ => card}/card.js | 7 +- .../features/status/components/card/index.js | 1 + app/javascript/gabsocial/pages/home_page.js | 24 +- 57 files changed, 1263 insertions(+), 1205 deletions(-) create mode 100644 app/javascript/gabsocial/components/timeline_compose_block/index.js create mode 100644 app/javascript/gabsocial/components/timeline_compose_block/timeline_compose_block.js create mode 100644 app/javascript/gabsocial/components/timeline_compose_block/timeline_compose_block.scss create mode 100644 app/javascript/gabsocial/features/account_gallery/account_gallery.js create mode 100644 app/javascript/gabsocial/features/account_gallery/account_gallery.scss create mode 100644 app/javascript/gabsocial/features/account_timeline/account_timeline.js create mode 100644 app/javascript/gabsocial/features/community_timeline/community_timeline.js create mode 100644 app/javascript/gabsocial/features/compose/components/compose_search/compose_search.js create mode 100644 app/javascript/gabsocial/features/compose/components/compose_search/index.js delete mode 100644 app/javascript/gabsocial/features/compose/components/search.js create mode 100644 app/javascript/gabsocial/features/follow_requests/follow_requests.js create mode 100644 app/javascript/gabsocial/features/generic_not_found/generic_not_found.js create mode 100644 app/javascript/gabsocial/features/list_editor/components/list_editor_search/index.js rename app/javascript/gabsocial/features/list_editor/components/{search.js => list_editor_search/list_editor_search.js} (52%) create mode 100644 app/javascript/gabsocial/features/notifications/notifications.js create mode 100644 app/javascript/gabsocial/features/standalone/compose/compose.js create mode 100644 app/javascript/gabsocial/features/standalone/hashtag_timeline/hashtag_timeline.js create mode 100644 app/javascript/gabsocial/features/standalone/public_timeline/public_timeline.js rename app/javascript/gabsocial/features/status/components/{ => card}/card.js (96%) create mode 100644 app/javascript/gabsocial/features/status/components/card/index.js 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)}