From 0df3c073a5e720ae30eeaa48505d63a00a05e8cd Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Mon, 2 Mar 2020 17:26:25 -0500 Subject: [PATCH] Progress --- .../api/v1/notifications_controller.rb | 2 +- app/javascript/gabsocial/actions/favorites.js | 90 ++++---- .../gabsocial/actions/interactions.js | 24 +- app/javascript/gabsocial/assets/index.js | 2 + .../gabsocial/assets/search_alt_icon.js | 27 +++ .../gabsocial/components/account.js | 184 +++++++++++++++ .../gabsocial/components/account/account.js | 211 ------------------ .../gabsocial/components/account/account.scss | 42 ---- .../gabsocial/components/account/index.js | 1 - .../gabsocial/components/column_header.js | 4 +- .../gabsocial/components/hashtag_item.js | 2 +- app/javascript/gabsocial/components/icon.js | 2 + .../components/modal/focal_point_modal.js | 121 ---------- .../focal_point_modal/focal_point_modal.scss | 36 --- .../gabsocial/components/modal/modal_root.js | 2 - .../components/panel/profile_info_panel.js | 2 +- .../components/panel/search_filter_panel.js | 35 +++ .../components/panel/who_to_follow_panel.js | 5 +- .../gabsocial/components/sidebar.js | 10 +- .../components/sidebar_section_item.js | 2 +- .../gabsocial/components/status/status.js | 2 +- .../components/status_action_bar_item.js | 2 +- .../gabsocial/components/status_header.js | 4 +- .../gabsocial/containers/account_container.js | 44 ++-- .../account_gallery/account_gallery.js | 21 -- .../account_timeline/account_timeline.js | 29 +-- .../components/compose_extra_button.js | 2 +- .../components/compose_form/compose_form.js | 10 +- .../compose/components/upload/upload.js | 83 ++++--- .../compose/containers/upload_container.js | 4 - .../favorited_statuses/favorited_statuses.js | 54 ++--- .../gabsocial/features/followers/followers.js | 8 +- .../gabsocial/features/following/following.js | 10 +- .../notification/notification-alt.js | 50 +++++ .../components/notification/notification.js | 54 +++-- .../features/notifications/notifications.js | 82 ++++--- .../features/status/components/card/card.js | 4 +- app/javascript/gabsocial/features/ui/ui.js | 4 - .../gabsocial/layouts/search_layout.js | 5 +- app/javascript/gabsocial/pages/search_page.js | 13 +- .../gabsocial/reducers/status_lists.js | 22 +- app/javascript/gabsocial/reducers/statuses.js | 8 +- app/javascript/styles/global.css | 2 +- 43 files changed, 602 insertions(+), 719 deletions(-) create mode 100644 app/javascript/gabsocial/assets/search_alt_icon.js create mode 100644 app/javascript/gabsocial/components/account.js delete mode 100644 app/javascript/gabsocial/components/account/account.js delete mode 100644 app/javascript/gabsocial/components/account/account.scss delete mode 100644 app/javascript/gabsocial/components/account/index.js delete mode 100644 app/javascript/gabsocial/components/modal/focal_point_modal.js delete mode 100644 app/javascript/gabsocial/components/modal/focal_point_modal/focal_point_modal.scss create mode 100644 app/javascript/gabsocial/components/panel/search_filter_panel.js create mode 100644 app/javascript/gabsocial/features/notifications/components/notification/notification-alt.js diff --git a/app/controllers/api/v1/notifications_controller.rb b/app/controllers/api/v1/notifications_controller.rb index d97b39f2..8cc3455f 100644 --- a/app/controllers/api/v1/notifications_controller.rb +++ b/app/controllers/api/v1/notifications_controller.rb @@ -8,7 +8,7 @@ class Api::V1::NotificationsController < Api::BaseController respond_to :json - DEFAULT_NOTIFICATIONS_LIMIT = 15 + DEFAULT_NOTIFICATIONS_LIMIT = 50 def index @notifications = load_notifications diff --git a/app/javascript/gabsocial/actions/favorites.js b/app/javascript/gabsocial/actions/favorites.js index 2e60d271..f94830b7 100644 --- a/app/javascript/gabsocial/actions/favorites.js +++ b/app/javascript/gabsocial/actions/favorites.js @@ -1,41 +1,41 @@ -import api, { getLinks } from '../api'; -import { importFetchedStatuses } from './importer'; -import { me } from '../initial_state'; +import api, { getLinks } from '../api' +import { importFetchedStatuses } from './importer' +import { me } from '../initial_state' -export const FAVORITED_STATUSES_FETCH_REQUEST = 'FAVORITED_STATUSES_FETCH_REQUEST'; -export const FAVORITED_STATUSES_FETCH_SUCCESS = 'FAVORITED_STATUSES_FETCH_SUCCESS'; -export const FAVORITED_STATUSES_FETCH_FAIL = 'FAVORITED_STATUSES_FETCH_FAIL'; +export const FAVORITED_STATUSES_FETCH_REQUEST = 'FAVORITED_STATUSES_FETCH_REQUEST' +export const FAVORITED_STATUSES_FETCH_SUCCESS = 'FAVORITED_STATUSES_FETCH_SUCCESS' +export const FAVORITED_STATUSES_FETCH_FAIL = 'FAVORITED_STATUSES_FETCH_FAIL' -export const FAVORITED_STATUSES_EXPAND_REQUEST = 'FAVORITED_STATUSES_EXPAND_REQUEST'; -export const FAVORITED_STATUSES_EXPAND_SUCCESS = 'FAVORITED_STATUSES_EXPAND_SUCCESS'; -export const FAVORITED_STATUSES_EXPAND_FAIL = 'FAVORITED_STATUSES_EXPAND_FAIL'; +export const FAVORITED_STATUSES_EXPAND_REQUEST = 'FAVORITED_STATUSES_EXPAND_REQUEST' +export const FAVORITED_STATUSES_EXPAND_SUCCESS = 'FAVORITED_STATUSES_EXPAND_SUCCESS' +export const FAVORITED_STATUSES_EXPAND_FAIL = 'FAVORITED_STATUSES_EXPAND_FAIL' export function fetchFavoritedStatuses() { return (dispatch, getState) => { - if (!me) return; + if (!me) return - if (getState().getIn(['status_lists', 'favourites', 'isLoading'])) { - return; + if (getState().getIn(['status_lists', 'favorites', 'isLoading'])) { + return } - dispatch(fetchFavoritedStatusesRequest()); + dispatch(fetchFavoritedStatusesRequest()) api(getState).get('/api/v1/favourites').then(response => { - const next = getLinks(response).refs.find(link => link.rel === 'next'); - dispatch(importFetchedStatuses(response.data)); - dispatch(fetchFavoritedStatusesSuccess(response.data, next ? next.uri : null)); + const next = getLinks(response).refs.find(link => link.rel === 'next') + dispatch(importFetchedStatuses(response.data)) + dispatch(fetchFavoritedStatusesSuccess(response.data, next ? next.uri : null)) }).catch(error => { - dispatch(fetchFavoritedStatusesFail(error)); - }); - }; -}; + dispatch(fetchFavoritedStatusesFail(error)) + }) + } +} export function fetchFavoritedStatusesRequest() { return { type: FAVORITED_STATUSES_FETCH_REQUEST, skipLoading: true, - }; -}; + } +} export function fetchFavoritedStatusesSuccess(statuses, next) { return { @@ -43,56 +43,56 @@ export function fetchFavoritedStatusesSuccess(statuses, next) { statuses, next, skipLoading: true, - }; -}; + } +} export function fetchFavoritedStatusesFail(error) { return { type: FAVORITED_STATUSES_FETCH_FAIL, error, skipLoading: true, - }; -}; + } +} export function expandFavoritedStatuses() { return (dispatch, getState) => { - if (!me) return; - - const url = getState().getIn(['status_lists', 'favourites', 'next'], null); + if (!me) return - if (url === null || getState().getIn(['status_lists', 'favourites', 'isLoading'])) { - return; + const url = getState().getIn(['status_lists', 'favorites', 'next'], null) + + if (url === null || getState().getIn(['status_lists', 'favorites', 'isLoading'])) { + return } - dispatch(expandFavoritedStatusesRequest()); + dispatch(expandFavoritedStatusesRequest()) api(getState).get(url).then(response => { - const next = getLinks(response).refs.find(link => link.rel === 'next'); - dispatch(importFetchedStatuses(response.data)); - dispatch(expandFavoritedStatusesSuccess(response.data, next ? next.uri : null)); + const next = getLinks(response).refs.find(link => link.rel === 'next') + dispatch(importFetchedStatuses(response.data)) + dispatch(expandFavoritedStatusesSuccess(response.data, next ? next.uri : null)) }).catch(error => { - dispatch(expandFavoritedStatusesFail(error)); - }); - }; -}; + dispatch(expandFavoritedStatusesFail(error)) + }) + } +} export function expandFavoritedStatusesRequest() { return { type: FAVORITED_STATUSES_EXPAND_REQUEST, - }; -}; + } +} export function expandFavoritedStatusesSuccess(statuses, next) { return { type: FAVORITED_STATUSES_EXPAND_SUCCESS, statuses, next, - }; -}; + } +} export function expandFavoritedStatusesFail(error) { return { type: FAVORITED_STATUSES_EXPAND_FAIL, error, - }; -}; + } +} diff --git a/app/javascript/gabsocial/actions/interactions.js b/app/javascript/gabsocial/actions/interactions.js index 9cd06675..bfa79fcd 100644 --- a/app/javascript/gabsocial/actions/interactions.js +++ b/app/javascript/gabsocial/actions/interactions.js @@ -6,17 +6,17 @@ export const REBLOG_REQUEST = 'REBLOG_REQUEST'; export const REBLOG_SUCCESS = 'REBLOG_SUCCESS'; export const REBLOG_FAIL = 'REBLOG_FAIL'; -export const FAVOURITE_REQUEST = 'FAVOURITE_REQUEST'; -export const FAVOURITE_SUCCESS = 'FAVOURITE_SUCCESS'; -export const FAVOURITE_FAIL = 'FAVOURITE_FAIL'; +export const FAVORITE_REQUEST = 'FAVORITE_REQUEST'; +export const FAVORITE_SUCCESS = 'FAVORITE_SUCCESS'; +export const FAVORITE_FAIL = 'FAVORITE_FAIL'; export const UNREBLOG_REQUEST = 'UNREBLOG_REQUEST'; export const UNREBLOG_SUCCESS = 'UNREBLOG_SUCCESS'; export const UNREBLOG_FAIL = 'UNREBLOG_FAIL'; -export const UNFAVOURITE_REQUEST = 'UNFAVOURITE_REQUEST'; -export const UNFAVOURITE_SUCCESS = 'UNFAVOURITE_SUCCESS'; -export const UNFAVOURITE_FAIL = 'UNFAVOURITE_FAIL'; +export const UNFAVORITE_REQUEST = 'UNFAVORITE_REQUEST'; +export const UNFAVORITE_SUCCESS = 'UNFAVORITE_SUCCESS'; +export const UNFAVORITE_FAIL = 'UNFAVORITE_FAIL'; export const REBLOGS_FETCH_REQUEST = 'REBLOGS_FETCH_REQUEST'; export const REBLOGS_FETCH_SUCCESS = 'REBLOGS_FETCH_SUCCESS'; @@ -144,7 +144,7 @@ export function unfavourite(status) { export function favouriteRequest(status) { return { - type: FAVOURITE_REQUEST, + type: FAVORITE_REQUEST, status: status, skipLoading: true, }; @@ -152,7 +152,7 @@ export function favouriteRequest(status) { export function favouriteSuccess(status) { return { - type: FAVOURITE_SUCCESS, + type: FAVORITE_SUCCESS, status: status, skipLoading: true, }; @@ -160,7 +160,7 @@ export function favouriteSuccess(status) { export function favouriteFail(status, error) { return { - type: FAVOURITE_FAIL, + type: FAVORITE_FAIL, status: status, error: error, skipLoading: true, @@ -169,7 +169,7 @@ export function favouriteFail(status, error) { export function unfavouriteRequest(status) { return { - type: UNFAVOURITE_REQUEST, + type: UNFAVORITE_REQUEST, status: status, skipLoading: true, }; @@ -177,7 +177,7 @@ export function unfavouriteRequest(status) { export function unfavouriteSuccess(status) { return { - type: UNFAVOURITE_SUCCESS, + type: UNFAVORITE_SUCCESS, status: status, skipLoading: true, }; @@ -185,7 +185,7 @@ export function unfavouriteSuccess(status) { export function unfavouriteFail(status, error) { return { - type: UNFAVOURITE_FAIL, + type: UNFAVORITE_FAIL, status: status, error: error, skipLoading: true, diff --git a/app/javascript/gabsocial/assets/index.js b/app/javascript/gabsocial/assets/index.js index 2d86010b..b978a377 100644 --- a/app/javascript/gabsocial/assets/index.js +++ b/app/javascript/gabsocial/assets/index.js @@ -26,6 +26,7 @@ import PlayIcon from './play_icon' import PollIcon from './poll_icon' import RepostIcon from './repost_icon' import SearchIcon from './search_icon' +import SearchAltIcon from './search_alt_icon' import ShareIcon from './share_icon' import ShopIcon from './shop_icon' import SubtractIcon from './subtract_icon' @@ -62,6 +63,7 @@ export { PollIcon, RepostIcon, SearchIcon, + SearchAltIcon, ShareIcon, ShopIcon, SubtractIcon, diff --git a/app/javascript/gabsocial/assets/search_alt_icon.js b/app/javascript/gabsocial/assets/search_alt_icon.js new file mode 100644 index 00000000..c6486960 --- /dev/null +++ b/app/javascript/gabsocial/assets/search_alt_icon.js @@ -0,0 +1,27 @@ +const SearchAltIcon = ({ + className = '', + width = '16px', + height = '16px', + viewBox = '0 0 64 64', + title = 'Search', +}) => ( + + + + + + +) + +export default SearchAltIcon \ No newline at end of file diff --git a/app/javascript/gabsocial/components/account.js b/app/javascript/gabsocial/components/account.js new file mode 100644 index 00000000..ad6a622f --- /dev/null +++ b/app/javascript/gabsocial/components/account.js @@ -0,0 +1,184 @@ +import { Fragment } from 'react' +import { NavLink } from 'react-router-dom' +import ImmutablePropTypes from 'react-immutable-proptypes' +import { defineMessages, injectIntl } from 'react-intl' +import ImmutablePureComponent from 'react-immutable-pure-component' +import { me } from '../initial_state' +import Avatar from './avatar' +import DisplayName from './display_name' +import Button from './button' +import Text from './text' + +const messages = defineMessages({ + follow: { id: 'follow', defaultMessage: 'Follow' }, + unfollow: { id: 'unfollow', defaultMessage: 'Unfollow' }, + requested: { id: 'requested', defaultMessage: 'Requested' }, + unblock: { id: 'unblock', defaultMessage: 'Unblock' }, + unmute: { id: 'unmute', defaultMessage: 'Unmute' }, + mute_notifications: { id: 'account.mute_notifications', defaultMessage: 'Mute notifications from @{name}' }, + unmute_notifications: { id: 'account.unmute_notifications', defaultMessage: 'Unmute notifications from @{name}' }, +}) + +export default +@injectIntl +class Account extends ImmutablePureComponent { + + static propTypes = { + account: ImmutablePropTypes.map.isRequired, + onFollow: PropTypes.func.isRequired, + onBlock: PropTypes.func.isRequired, + onMute: PropTypes.func.isRequired, + onMuteNotifications: PropTypes.func, + intl: PropTypes.object.isRequired, + hidden: PropTypes.bool, + actionIcon: PropTypes.string, + actionTitle: PropTypes.string, + onActionClick: PropTypes.func, + compact: PropTypes.bool, + showDismiss: PropTypes.bool, + dismissAction: PropTypes.func, + } + + handleFollow = () => { + this.props.onFollow(this.props.account) + } + + handleBlock = () => { + this.props.onBlock(this.props.account) + } + + handleMute = () => { + this.props.onMute(this.props.account) + } + + handleMuteNotifications = () => { + this.props.onMuteNotifications(this.props.account, true) + } + + handleUnmuteNotifications = () => { + this.props.onMuteNotifications(this.props.account, false) + } + + handleAction = () => { + this.props.onActionClick(this.props.account) + } + + handleUnrequest = () => { + // + } + + render() { + const { + account, + intl, + hidden, + onActionClick, + actionIcon, + actionTitle, + compact, + dismissAction, + showDismiss, + } = this.props + + if (!account) return null + + if (hidden) { + return ( + + {account.get('display_name')} + {account.get('username')} + + ) + } + + let buttonOptions + let buttonText + + if (onActionClick && actionIcon) { + buttonText = actionTitle + buttonOptions = { + onClick: this.handleAction, + outline: true, + color: 'brand', + backgroundColor: 'none', + } + } else if (account.get('id') !== me && account.get('relationship', null) !== null) { + const following = account.getIn(['relationship', 'following']) + const requested = account.getIn(['relationship', 'requested']) + const blocking = account.getIn(['relationship', 'blocking']) + + if (requested || blocking) { + buttonText = intl.formatMessage(requested ? messages.requested : messages.blocking) + buttonOptions = { + narrow: true, + onClick: requested ? this.handleUnrequest : this.handleBlock, + color: 'primary', + backgroundColor: 'tertiary', + className: _s.marginTop5PX, + } + } else if (!account.get('moved') || following) { + buttonOptions = { + narrow: true, + outline: !following, + color: !following ? 'brand' : 'white', + backgroundColor: !following ? 'none' : 'brand', + className: _s.marginTop5PX, + onClick: this.handleFollow, + } + buttonText = intl.formatMessage(following ? messages.unfollow : messages.follow) + } + } + + const button = !buttonOptions ? null : ( + + ) + + const avatarSize = compact ? 42 : 52 + const dismissBtn = ( + - - - - - ) - } - - return ( -
-
- - - - - -
- - - - - -
- -
- -
- -
-
- ) - } - -} diff --git a/app/javascript/gabsocial/components/account/account.scss b/app/javascript/gabsocial/components/account/account.scss deleted file mode 100644 index a888801d..00000000 --- a/app/javascript/gabsocial/components/account/account.scss +++ /dev/null @@ -1,42 +0,0 @@ -.account { - padding: 10px; - - &:not(:last-of-type) { - border-bottom: 1px solid lighten($ui-base-color, 8%); - } - - &__display-name { - display: block; - flex: 1 1 auto; - color: $darker-text-color; - overflow: hidden; - text-decoration: none; - font-size: 14px; - - strong { - display: block; - color: $primary-text-color; - - @include text-overflow(nowrap); - } - } - - &__wrapper { - display: flex; - } - - &__relationship { - height: auto; - position: relative; - padding: 0 0 0 5px; - } - - &__avatar-wrapper { - float: left; - margin-right: 12px; - } - - &__avatar { - display: block; - } -} \ No newline at end of file diff --git a/app/javascript/gabsocial/components/account/index.js b/app/javascript/gabsocial/components/account/index.js deleted file mode 100644 index b573a430..00000000 --- a/app/javascript/gabsocial/components/account/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './account' \ No newline at end of file diff --git a/app/javascript/gabsocial/components/column_header.js b/app/javascript/gabsocial/components/column_header.js index a6cc9178..6555714f 100644 --- a/app/javascript/gabsocial/components/column_header.js +++ b/app/javascript/gabsocial/components/column_header.js @@ -60,7 +60,7 @@ class ColumnHeader extends PureComponent { { showBackBtn && } @@ -85,7 +85,7 @@ class ColumnHeader extends PureComponent { key={`column-header-action-btn-${i}`} className={[_s.default, _s.marginLeft5PX, _s.cursorPointer, _s.backgroundSubtle2, _s.paddingHorizontal10PX, _s.paddingVertical10PX, _s.radiusSmall].join(' ')} > - + )) } diff --git a/app/javascript/gabsocial/components/hashtag_item.js b/app/javascript/gabsocial/components/hashtag_item.js index 467d92af..51d630b0 100644 --- a/app/javascript/gabsocial/components/hashtag_item.js +++ b/app/javascript/gabsocial/components/hashtag_item.js @@ -48,7 +48,7 @@ export default class HashtagItem extends ImmutablePureComponent { icon='caret-down' iconWidth='8px' iconHeight='8px' - iconClassName={_s.fillcolorSecondary} + iconClassName={_s.fillColorSecondary} className={_s.marginLeftAuto} /> diff --git a/app/javascript/gabsocial/components/icon.js b/app/javascript/gabsocial/components/icon.js index cca347b9..662f4c65 100644 --- a/app/javascript/gabsocial/components/icon.js +++ b/app/javascript/gabsocial/components/icon.js @@ -67,6 +67,8 @@ export default class Icon extends PureComponent { return case 'search': return + case 'search-alt': + return case 'share': return case 'shop': diff --git a/app/javascript/gabsocial/components/modal/focal_point_modal.js b/app/javascript/gabsocial/components/modal/focal_point_modal.js deleted file mode 100644 index 01ffd454..00000000 --- a/app/javascript/gabsocial/components/modal/focal_point_modal.js +++ /dev/null @@ -1,121 +0,0 @@ -import ImmutablePropTypes from 'react-immutable-proptypes'; -import ImmutablePureComponent from 'react-immutable-pure-component'; -import classNames from 'classnames'; -import { changeUploadCompose } from '../../actions/compose'; -import { getPointerPosition } from '../../utils/element_position'; -import ImageLoader from '../image_loader'; - -const mapStateToProps = (state, { id }) => ({ - media: state.getIn(['compose', 'media_attachments']).find(item => item.get('id') === id), -}); - -const mapDispatchToProps = (dispatch, { id }) => ({ - - onSave: (x, y) => { - dispatch(changeUploadCompose(id, { focus: `${x.toFixed(2)},${y.toFixed(2)}` })); - }, - -}); - -export default -@connect(mapStateToProps, mapDispatchToProps) -class FocalPointModal extends ImmutablePureComponent { - - static propTypes = { - media: ImmutablePropTypes.map.isRequired, - }; - - state = { - x: 0, - y: 0, - focusX: 0, - focusY: 0, - dragging: false, - }; - - componentWillMount () { - this.updatePositionFromMedia(this.props.media); - } - - componentWillReceiveProps (nextProps) { - if (this.props.media.get('id') !== nextProps.media.get('id')) { - this.updatePositionFromMedia(nextProps.media); - } - } - - componentWillUnmount () { - document.removeEventListener('mousemove', this.handleMouseMove); - document.removeEventListener('mouseup', this.handleMouseUp); - } - - handleMouseDown = e => { - document.addEventListener('mousemove', this.handleMouseMove); - document.addEventListener('mouseup', this.handleMouseUp); - - this.updatePosition(e); - this.setState({ dragging: true }); - } - - handleMouseMove = e => { - this.updatePosition(e); - } - - handleMouseUp = () => { - document.removeEventListener('mousemove', this.handleMouseMove); - document.removeEventListener('mouseup', this.handleMouseUp); - - this.setState({ dragging: false }); - this.props.onSave(this.state.focusX, this.state.focusY); - } - - updatePosition = e => { - const { x, y } = getPointerPosition(this.node, e); - const focusX = (x - .5) * 2; - const focusY = (y - .5) * -2; - - this.setState({ x, y, focusX, focusY }); - } - - updatePositionFromMedia = media => { - const focusX = media.getIn(['meta', 'focus', 'x']); - const focusY = media.getIn(['meta', 'focus', 'y']); - - if (focusX && focusY) { - const x = (focusX / 2) + .5; - const y = (focusY / -2) + .5; - - this.setState({ x, y, focusX, focusY }); - } else { - this.setState({ x: 0.5, y: 0.5, focusX: 0, focusY: 0 }); - } - } - - setRef = c => { - this.node = c; - } - - render () { - const { media } = this.props; - const { x, y, dragging } = this.state; - - const width = media.getIn(['meta', 'original', 'width']) || null; - const height = media.getIn(['meta', 'original', 'height']) || null; - - return ( -
-
- - -
-
-
-
- ); - } - -} diff --git a/app/javascript/gabsocial/components/modal/focal_point_modal/focal_point_modal.scss b/app/javascript/gabsocial/components/modal/focal_point_modal/focal_point_modal.scss deleted file mode 100644 index 7b778311..00000000 --- a/app/javascript/gabsocial/components/modal/focal_point_modal/focal_point_modal.scss +++ /dev/null @@ -1,36 +0,0 @@ -.focal-point-modal { - position: relative; - - @include max-size(80vw, 80vh); -} - -.focal-point { - position: relative; - cursor: pointer; - overflow: hidden; - - &.dragging { - cursor: move; - } - - img { - margin: auto; - - @include max-size(80vw, 80vh); - @include size(auto); - } - - &__reticle { - position: absolute; - transform: translate(-50%, -50%); - background: url('/assets/images/reticle.png') no-repeat 0 0; - box-shadow: 0 0 0 9999em rgba($base-shadow-color, 0.35); - - @include circle(100px); - } - - &__overlay { - @include size(100%); - @include abs-position(0, auto, auto, 0); - } -} \ No newline at end of file diff --git a/app/javascript/gabsocial/components/modal/modal_root.js b/app/javascript/gabsocial/components/modal/modal_root.js index 57b13452..80ba2dd0 100644 --- a/app/javascript/gabsocial/components/modal/modal_root.js +++ b/app/javascript/gabsocial/components/modal/modal_root.js @@ -16,7 +16,6 @@ import MediaModal from './media_modal' import VideoModal from './video_modal' import BoostModal from './boost_modal' import ConfirmationModal from './confirmation_modal' -import FocalPointModal from './focal_point_modal' import HotkeysModal from './hotkeys_modal' import ComposeModal from './compose_modal' import UnauthorizedModal from './unauthorized_modal' @@ -29,7 +28,6 @@ const MODAL_COMPONENTS = { 'COMPOSE': () => Promise.resolve({ default: ComposeModal }), 'CONFIRM': () => Promise.resolve({ default: ConfirmationModal }), 'EMBED': EmbedModal, - 'FOCAL_POINT': () => Promise.resolve({ default: FocalPointModal }), 'HOTKEYS': () => Promise.resolve({ default: HotkeysModal }), 'MEDIA': () => Promise.resolve({ default: MediaModal }), 'MUTE': MuteModal, diff --git a/app/javascript/gabsocial/components/panel/profile_info_panel.js b/app/javascript/gabsocial/components/panel/profile_info_panel.js index d1eb167c..9b2e4fdd 100644 --- a/app/javascript/gabsocial/components/panel/profile_info_panel.js +++ b/app/javascript/gabsocial/components/panel/profile_info_panel.js @@ -70,7 +70,7 @@ class ProfileInfoPanel extends ImmutablePureComponent { }
- + + + + ) + } +} \ No newline at end of file diff --git a/app/javascript/gabsocial/components/panel/who_to_follow_panel.js b/app/javascript/gabsocial/components/panel/who_to_follow_panel.js index 8e425111..d5440062 100644 --- a/app/javascript/gabsocial/components/panel/who_to_follow_panel.js +++ b/app/javascript/gabsocial/components/panel/who_to_follow_panel.js @@ -57,11 +57,10 @@ class WhoToFollowPanel extends ImmutablePureComponent {
{suggestions && suggestions.map(accountId => ( ))}
diff --git a/app/javascript/gabsocial/components/sidebar.js b/app/javascript/gabsocial/components/sidebar.js index ae230973..6e10e077 100644 --- a/app/javascript/gabsocial/components/sidebar.js +++ b/app/javascript/gabsocial/components/sidebar.js @@ -114,17 +114,17 @@ class Sidebar extends ImmutablePureComponent { to: '/', count: 124, }, - { - title: 'Search', - icon: 'search-sidebar', - to: '/search', - }, { title: 'Notifications', icon: 'notifications', to: '/notifications', count: 40, }, + { + title: 'Search', + icon: 'search-alt', + to: '/search', + }, { title: 'Groups', icon: 'group', diff --git a/app/javascript/gabsocial/components/sidebar_section_item.js b/app/javascript/gabsocial/components/sidebar_section_item.js index 22f11ba6..ebdee42d 100644 --- a/app/javascript/gabsocial/components/sidebar_section_item.js +++ b/app/javascript/gabsocial/components/sidebar_section_item.js @@ -63,7 +63,7 @@ export default class SidebarSectionItem extends PureComponent { const iconClasses = cx({ fillColorBlack: shouldShowActive, - fillcolorSecondary: !hovering && !active, + fillColorSecondary: !hovering && !active, }) const countClasses = cx({ diff --git a/app/javascript/gabsocial/components/status/status.js b/app/javascript/gabsocial/components/status/status.js index c5cf3087..373e8d79 100644 --- a/app/javascript/gabsocial/components/status/status.js +++ b/app/javascript/gabsocial/components/status/status.js @@ -324,7 +324,7 @@ class Status extends ImmutablePureComponent { id='pin' width='10px' height='10px' - className={_s.fillcolorSecondary} + className={_s.fillColorSecondary} /> {intl.formatMessage(messages.pinned)} diff --git a/app/javascript/gabsocial/components/status_action_bar_item.js b/app/javascript/gabsocial/components/status_action_bar_item.js index 42940593..0d623a53 100644 --- a/app/javascript/gabsocial/components/status_action_bar_item.js +++ b/app/javascript/gabsocial/components/status_action_bar_item.js @@ -43,7 +43,7 @@ export default class StatusActionBarItem extends PureComponent { active={active} disabled={disabled} > - + {title}
diff --git a/app/javascript/gabsocial/components/status_header.js b/app/javascript/gabsocial/components/status_header.js index ba338cfe..56ed74f8 100644 --- a/app/javascript/gabsocial/components/status_header.js +++ b/app/javascript/gabsocial/components/status_header.js @@ -197,7 +197,7 @@ export default class StatusHeader extends ImmutablePureComponent { icon='ellipsis' iconWidth='20px' iconHeight='20px' - iconClassName={_s.fillcolorSecondary} + iconClassName={_s.fillColorSecondary} className={_s.marginLeftAuto} onClick={this.handleStatusOptionsClick} /> @@ -218,7 +218,7 @@ export default class StatusHeader extends ImmutablePureComponent { - + { !!status.get('group') && diff --git a/app/javascript/gabsocial/containers/account_container.js b/app/javascript/gabsocial/containers/account_container.js index c0e0287d..268ff488 100644 --- a/app/javascript/gabsocial/containers/account_container.js +++ b/app/javascript/gabsocial/containers/account_container.js @@ -1,4 +1,4 @@ -import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; +import { defineMessages, injectIntl, FormattedMessage } from 'react-intl' import { followAccount, unfollowAccount, @@ -6,26 +6,26 @@ import { unblockAccount, muteAccount, unmuteAccount, -} from '../actions/accounts'; -import { openModal } from '../actions/modal'; -import { initMuteModal } from '../actions/mutes'; -import { unfollowModal } from '../initial_state'; -import { makeGetAccount } from '../selectors'; -import Account from '../components/account'; +} from '../actions/accounts' +import { openModal } from '../actions/modal' +import { initMuteModal } from '../actions/mutes' +import { unfollowModal } from '../initial_state' +import { makeGetAccount } from '../selectors' +import Account from '../components/account' const messages = defineMessages({ unfollowConfirm: { id: 'confirmations.unfollow.confirm', defaultMessage: 'Unfollow' }, -}); +}) const makeMapStateToProps = () => { - const getAccount = makeGetAccount(); + const getAccount = makeGetAccount() const mapStateToProps = (state, props) => ({ account: getAccount(state, props.id), - }); + }) - return mapStateToProps; -}; + return mapStateToProps +} const mapDispatchToProps = (dispatch, { intl }) => ({ @@ -36,35 +36,35 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ message: @{account.get('acct')} }} />, confirm: intl.formatMessage(messages.unfollowConfirm), onConfirm: () => dispatch(unfollowAccount(account.get('id'))), - })); + })) } else { - dispatch(unfollowAccount(account.get('id'))); + dispatch(unfollowAccount(account.get('id'))) } } else { - dispatch(followAccount(account.get('id'))); + dispatch(followAccount(account.get('id'))) } }, onBlock (account) { if (account.getIn(['relationship', 'blocking'])) { - dispatch(unblockAccount(account.get('id'))); + dispatch(unblockAccount(account.get('id'))) } else { - dispatch(blockAccount(account.get('id'))); + dispatch(blockAccount(account.get('id'))) } }, onMute (account) { if (account.getIn(['relationship', 'muting'])) { - dispatch(unmuteAccount(account.get('id'))); + dispatch(unmuteAccount(account.get('id'))) } else { - dispatch(initMuteModal(account)); + dispatch(initMuteModal(account)) } }, onMuteNotifications (account, notifications) { - dispatch(muteAccount(account.get('id'), notifications)); + dispatch(muteAccount(account.get('id'), notifications)) }, -}); +}) -export default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Account)); +export default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Account)) diff --git a/app/javascript/gabsocial/features/account_gallery/account_gallery.js b/app/javascript/gabsocial/features/account_gallery/account_gallery.js index a60a5d82..df39efde 100644 --- a/app/javascript/gabsocial/features/account_gallery/account_gallery.js +++ b/app/javascript/gabsocial/features/account_gallery/account_gallery.js @@ -173,27 +173,6 @@ class AccountGallery extends ImmutablePureComponent { return (
- { /* */ } -
{attachments.map((attachment, index) => attachment === null ? ( 0 ? attachments.getIn(index - 1, 'id') : null} onLoadMore={this.handleLoadMore} /> diff --git a/app/javascript/gabsocial/features/account_timeline/account_timeline.js b/app/javascript/gabsocial/features/account_timeline/account_timeline.js index f61359dc..b4a07fb0 100644 --- a/app/javascript/gabsocial/features/account_timeline/account_timeline.js +++ b/app/javascript/gabsocial/features/account_timeline/account_timeline.js @@ -109,35 +109,12 @@ class AccountTimeline extends ImmutablePureComponent { const { statusIds, featuredStatusIds, isLoading, hasMore, isAccount, accountId, unavailable, accountUsername, intl } = this.props; if (!isAccount && accountId !== -1) { - return (); + return } else if (accountId === -1 || (!statusIds && isLoading)) { - return (); + return } else if (unavailable) { - return (); + return } - - /* - */ - return ( this.handleOnMouseEnter()} onMouseLeave={() => this.handleOnMouseLeave()} > - + { !small && diff --git a/app/javascript/gabsocial/features/compose/components/compose_form/compose_form.js b/app/javascript/gabsocial/features/compose/components/compose_form/compose_form.js index f9258741..646c84dd 100644 --- a/app/javascript/gabsocial/features/compose/components/compose_form/compose_form.js +++ b/app/javascript/gabsocial/features/compose/components/compose_form/compose_form.js @@ -316,13 +316,15 @@ class ComposeForm extends ImmutablePureComponent { small={shouldCondense} textarea > - { /* - !condensed && +
- {!edit && } + { + !edit && + + }
- */ } + { /* quoteOfId && */} diff --git a/app/javascript/gabsocial/features/compose/components/upload/upload.js b/app/javascript/gabsocial/features/compose/components/upload/upload.js index fd262e5f..1ff818d3 100644 --- a/app/javascript/gabsocial/features/compose/components/upload/upload.js +++ b/app/javascript/gabsocial/features/compose/components/upload/upload.js @@ -1,15 +1,15 @@ -import ImmutablePropTypes from 'react-immutable-proptypes'; -import ImmutablePureComponent from 'react-immutable-pure-component'; -import { defineMessages, injectIntl } from 'react-intl'; -import classNames from 'classnames'; -import spring from 'react-motion/lib/spring'; -import Motion from '../../../ui/util/optional_motion'; -import IconButton from '../../../../components/icon_button'; +import ImmutablePropTypes from 'react-immutable-proptypes' +import ImmutablePureComponent from 'react-immutable-pure-component' +import { defineMessages, injectIntl } from 'react-intl' +import classNames from 'classnames' +import spring from 'react-motion/lib/spring' +import Motion from '../../../ui/util/optional_motion' +import Button from '../../../../components/button' const messages = defineMessages({ description: { id: 'upload_form.description', defaultMessage: 'Describe for the visually impaired' }, delete: { id: 'upload_form.undo', defaultMessage: 'Delete' }, -}); +}) export default @injectIntl @@ -17,82 +17,76 @@ class Upload extends ImmutablePureComponent { static contextTypes = { router: PropTypes.object, - }; + } static propTypes = { media: ImmutablePropTypes.map.isRequired, intl: PropTypes.object.isRequired, onUndo: PropTypes.func.isRequired, onDescriptionChange: PropTypes.func.isRequired, - onOpenFocalPoint: PropTypes.func.isRequired, onSubmit: PropTypes.func.isRequired, - }; + } state = { hovered: false, focused: false, dirtyDescription: null, - }; + } handleKeyDown = (e) => { if (e.keyCode === 13 && (e.ctrlKey || e.metaKey)) { - this.handleSubmit(); + this.handleSubmit() } } handleSubmit = () => { - this.handleInputBlur(); - this.props.onSubmit(this.context.router.history); + this.handleInputBlur() + this.props.onSubmit(this.context.router.history) } handleUndoClick = e => { - e.stopPropagation(); - this.props.onUndo(this.props.media.get('id')); - } - - handleFocalPointClick = e => { - e.stopPropagation(); - this.props.onOpenFocalPoint(this.props.media.get('id')); + e.stopPropagation() + this.props.onUndo(this.props.media.get('id')) } handleInputChange = e => { - this.setState({ dirtyDescription: e.target.value }); + this.setState({ dirtyDescription: e.target.value }) } handleMouseEnter = () => { - this.setState({ hovered: true }); + this.setState({ hovered: true }) } handleMouseLeave = () => { - this.setState({ hovered: false }); + this.setState({ hovered: false }) } handleInputFocus = () => { - this.setState({ focused: true }); + this.setState({ focused: true }) } handleClick = () => { - this.setState({ focused: true }); + this.setState({ focused: true }) } handleInputBlur = () => { - const { dirtyDescription } = this.state; + const { dirtyDescription } = this.state - this.setState({ focused: false, dirtyDescription: null }); + this.setState({ focused: false, dirtyDescription: null }) if (dirtyDescription !== null) { - this.props.onDescriptionChange(this.props.media.get('id'), dirtyDescription); + this.props.onDescriptionChange(this.props.media.get('id'), dirtyDescription) } } - render () { - const { intl, media } = this.props; - const active = this.state.hovered || this.state.focused; - const description = this.state.dirtyDescription || (this.state.dirtyDescription !== '' && media.get('description')) || ''; - const focusX = media.getIn(['meta', 'focus', 'x']); - const focusY = media.getIn(['meta', 'focus', 'y']); - const x = ((focusX / 2) + .5) * 100; - const y = ((focusY / -2) + .5) * 100; + render() { + const { intl, media } = this.props + const active = this.state.hovered || this.state.focused + const description = this.state.dirtyDescription || (this.state.dirtyDescription !== '' && media.get('description')) || '' + const focusX = media.getIn(['meta', 'focus', 'x']) + const focusY = media.getIn(['meta', 'focus', 'y']) + const x = ((focusX / 2) + .5) * 100 + const y = ((focusY / -2) + .5) * 100 return (
@@ -100,13 +94,18 @@ class Upload extends ImmutablePureComponent { {({ scale }) => (
- - {media.get('type') === 'image' && } +