diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index a73edc4e..a5a17f28 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -49,6 +49,7 @@ class AccountsController < ReactController statuses.merge!(hashtag_scope) if tag_requested? statuses.merge!(only_media_scope) if media_requested? statuses.merge!(no_replies_scope) unless replies_requested? + statuses.merge!(only_replies_scope) unless comments_only_requested? end end @@ -68,6 +69,10 @@ class AccountsController < ReactController Status.without_replies end + def only_replies_scope + Status.only_replies + end + def hashtag_scope tag = Tag.find_normalized(params[:tag]) @@ -97,6 +102,8 @@ class AccountsController < ReactController short_account_media_url(@account, max_id: max_id, min_id: min_id) elsif replies_requested? short_account_with_replies_url(@account, max_id: max_id, min_id: min_id) + elsif comments_only_requested? + short_account_comments_only_url(@account, max_id: max_id, min_id: min_id) else short_account_url(@account, max_id: max_id, min_id: min_id) end @@ -110,6 +117,10 @@ class AccountsController < ReactController request.path.ends_with?('/with_replies') end + def comments_only_requested? + request.path.ends_with?('/comments_only') + end + def tag_requested? request.path.ends_with?(Addressable::URI.parse("/tagged/#{params[:tag]}").normalize) end diff --git a/app/controllers/api/v1/account_by_username_controller.rb b/app/controllers/api/v1/account_by_username_controller.rb index 2d9b8774..30964101 100644 --- a/app/controllers/api/v1/account_by_username_controller.rb +++ b/app/controllers/api/v1/account_by_username_controller.rb @@ -3,6 +3,7 @@ class Api::V1::AccountByUsernameController < Api::BaseController before_action :set_account before_action :check_account_suspension + before_action :check_account_local respond_to :json @@ -17,4 +18,9 @@ class Api::V1::AccountByUsernameController < Api::BaseController def check_account_suspension gone if @account.suspended? end + + # if not our domain don't display + def check_account_local + gone unless @account.local? + end end diff --git a/app/controllers/api/v1/accounts/statuses_controller.rb b/app/controllers/api/v1/accounts/statuses_controller.rb index 8cd8f8e7..224a0567 100644 --- a/app/controllers/api/v1/accounts/statuses_controller.rb +++ b/app/controllers/api/v1/accounts/statuses_controller.rb @@ -32,6 +32,7 @@ class Api::V1::Accounts::StatusesController < Api::BaseController statuses.merge!(only_media_scope) if truthy_param?(:only_media) statuses.merge!(no_replies_scope) if truthy_param?(:exclude_replies) + statuses.merge!(only_replies_scope) if truthy_param?(:only_comments) statuses.merge!(no_reblogs_scope) if truthy_param?(:exclude_reblogs) statuses.merge!(hashtag_scope) if params[:tagged].present? @@ -64,6 +65,10 @@ class Api::V1::Accounts::StatusesController < Api::BaseController Status.without_replies end + def only_replies_scope + Status.only_replies + end + def no_reblogs_scope Status.without_reblogs end @@ -79,7 +84,7 @@ class Api::V1::Accounts::StatusesController < Api::BaseController end def pagination_params(core_params) - params.slice(:limit, :only_media, :exclude_replies).permit(:limit, :only_media, :exclude_replies).merge(core_params) + params.slice(:limit, :only_media, :exclude_replies, :only_comments).permit(:limit, :only_media, :exclude_replies, :only_comments).merge(core_params) end def insert_pagination_headers diff --git a/app/controllers/api/v1/gifs_controller.rb b/app/controllers/api/v1/gifs_controller.rb index 23963fe3..2a723dbf 100644 --- a/app/controllers/api/v1/gifs_controller.rb +++ b/app/controllers/api/v1/gifs_controller.rb @@ -1,14 +1,31 @@ # frozen_string_literal: true class Api::V1::GifsController < Api::BaseController + before_action :require_user! + respond_to :json skip_before_action :set_cache_headers - def index + def categories uri = URI('https://api.tenor.com/v1/categories') - params = { :key => "QHFJ0C5EWGBH" } - uri.query = URI.encode_www_form(params) + theOptions = { :key => "QHFJ0C5EWGBH" } + uri.query = URI.encode_www_form(theOptions) + + res = Net::HTTP.get_response(uri) + render json: res.body if res.is_a?(Net::HTTPSuccess) + end + + def search + uri = URI('https://api.tenor.com/v1/search') + theOptions = { + :key => "QHFJ0C5EWGBH", + :media_filter => "minimal", + :limit => 30, + :q => params[:search], + :pos => params[:next] || 0 + } + uri.query = URI.encode_www_form(theOptions) res = Net::HTTP.get_response(uri) render json: res.body if res.is_a?(Net::HTTPSuccess) diff --git a/app/controllers/api/v1/notifications_controller.rb b/app/controllers/api/v1/notifications_controller.rb index 51ea6223..5bf91126 100644 --- a/app/controllers/api/v1/notifications_controller.rb +++ b/app/controllers/api/v1/notifications_controller.rb @@ -4,6 +4,7 @@ class Api::V1::NotificationsController < Api::BaseController before_action -> { doorkeeper_authorize! :read, :'read:notifications' }, except: [:clear, :dismiss, :mark_read] before_action -> { doorkeeper_authorize! :write, :'write:notifications' }, only: [:clear, :dismiss, :mark_read] before_action :require_user! + before_action :set_filter_params after_action :insert_pagination_headers, only: :index respond_to :json @@ -49,7 +50,7 @@ class Api::V1::NotificationsController < Api::BaseController end def browserable_account_notifications - current_account.notifications.browserable(exclude_types, from_account) + current_account.notifications.browserable(exclude_types, from_account, params[:only_verified], params[:only_following]) end def target_statuses_from_notifications @@ -86,6 +87,13 @@ class Api::V1::NotificationsController < Api::BaseController val end + def set_filter_params + params.permit( + :only_verified, + :only_following + ) + end + def from_account params[:account_id] end diff --git a/app/javascript/gabsocial/actions/accounts.js b/app/javascript/gabsocial/actions/accounts.js index 4c2f3fa3..4f2d70bb 100644 --- a/app/javascript/gabsocial/actions/accounts.js +++ b/app/javascript/gabsocial/actions/accounts.js @@ -100,12 +100,11 @@ function getFromDB(dispatch, getState, index, id) { export function fetchAccount(id) { return (dispatch, getState) => { - dispatch(fetchRelationships([id])); - if (id === -1 || getState().getIn(['accounts', id], null) !== null) { return; } + dispatch(fetchRelationships([id])); dispatch(fetchAccountRequest(id)); openDB().then(db => getFromDB( @@ -128,8 +127,13 @@ export function fetchAccount(id) { export function fetchAccountByUsername(username) { return (dispatch, getState) => { + if (!username) { + return; + } + api(getState).get(`/api/v1/account_by_username/${username}`).then(response => { - dispatch(importFetchedAccount(response.data)); + dispatch(importFetchedAccount(response.data)) + dispatch(fetchRelationships([response.data.id])) }).then(() => { dispatch(fetchAccountSuccess()); }).catch(error => { diff --git a/app/javascript/gabsocial/actions/notifications.js b/app/javascript/gabsocial/actions/notifications.js index d0c516d1..52292228 100644 --- a/app/javascript/gabsocial/actions/notifications.js +++ b/app/javascript/gabsocial/actions/notifications.js @@ -165,14 +165,15 @@ export function expandNotifications({ maxId } = {}, done = noOp) { // filter verified and following here too const params = { max_id: maxId, - // only_verified: onlyVerified, - // only_following: onlyFollowing, exclude_types: activeFilter === 'all' ? null : excludeTypesFromFilter(activeFilter), // exclude_types: activeFilter === 'all' // ? excludeTypesFromSettings(getState()) // : excludeTypesFromFilter(activeFilter), }; + if (!!onlyVerified) params.only_verified = onlyVerified + if (!!onlyFollowing) params.only_following = onlyFollowing + if (!maxId && notifications.get('items').size > 0) { params.since_id = notifications.getIn(['items', 0, 'id']); } diff --git a/app/javascript/gabsocial/actions/tenor.js b/app/javascript/gabsocial/actions/tenor.js index 7b9fd53a..efd2f352 100644 --- a/app/javascript/gabsocial/actions/tenor.js +++ b/app/javascript/gabsocial/actions/tenor.js @@ -21,7 +21,7 @@ export const fetchGifCategories = () => { dispatch(fetchGifCategoriesRequest()) - api(getState).get('/api/v1/gifs').then(response => { + api(getState).get('/api/v1/gifs/categories').then(response => { dispatch(fetchGifCategoriesSuccess(response.data.tags)) }).catch(function (error) { dispatch(fetchGifCategoriesFail(error)) @@ -29,24 +29,25 @@ export const fetchGifCategories = () => { } } -export const fetchGifResults = (maxId) => { +export const fetchGifResults = (expand) => { return function (dispatch, getState) { if (!me) return dispatch(fetchGifResultsRequest()) - const searchText = getState().getIn(['tenor', 'searchText'], ''); + const search = getState().getIn(['tenor', 'searchText'], ''); + const pos = 0 //expand ? getState().getIn(['tenor', 'results'], []).length - axios.get(`https://api.tenor.com/v1/search?q=${searchText}&media_filter=minimal&limit=30&key=${tenorkey}`) - .then((response) => { - console.log('response:', response) - dispatch(fetchGifResultsSuccess(response.data.results)) - }).catch(function (error) { - dispatch(fetchGifResultsFail(error)) - }) + api(getState).get('/api/v1/gifs/search', { search, pos }).then((response) => { + console.log("response.data:", response.data) + dispatch(fetchGifResultsSuccess(response.data)) + }).catch(function (error) { + dispatch(fetchGifResultsFail(error)) + }) } } + export const clearGifResults = () => ({ type: GIFS_CLEAR_RESULTS, }) @@ -69,10 +70,10 @@ function fetchGifResultsRequest() { } } -function fetchGifResultsSuccess(results) { +function fetchGifResultsSuccess(data) { return { type: GIF_RESULTS_FETCH_SUCCESS, - results, + data, } } diff --git a/app/javascript/gabsocial/actions/timelines.js b/app/javascript/gabsocial/actions/timelines.js index 4313580e..16b0e4d2 100644 --- a/app/javascript/gabsocial/actions/timelines.js +++ b/app/javascript/gabsocial/actions/timelines.js @@ -149,7 +149,7 @@ export function expandTimeline(timelineId, path, params = {}, done = noOp) { export const expandHomeTimeline = ({ maxId } = {}, done = noOp) => expandTimeline('home', '/api/v1/timelines/home', { max_id: maxId }, done); export const expandCommunityTimeline = ({ maxId, onlyMedia } = {}, done = noOp) => expandTimeline(`community${onlyMedia ? ':media' : ''}`, '/api/v1/timelines/public', { local: true, max_id: maxId, only_media: !!onlyMedia }, done); -export const expandAccountTimeline = (accountId, { maxId, withReplies } = {}) => expandTimeline(`account:${accountId}${withReplies ? ':with_replies' : ''}`, `/api/v1/accounts/${accountId}/statuses`, { exclude_replies: !withReplies, max_id: maxId }); +export const expandAccountTimeline = (accountId, { maxId, withReplies, commentsOnly } = {}) => expandTimeline(`account:${accountId}${withReplies ? ':with_replies' : ''}${commentsOnly ? ':comments_only' : ''}`, `/api/v1/accounts/${accountId}/statuses`, { only_comments: commentsOnly, exclude_replies: (!withReplies && !commentsOnly), max_id: maxId }); export const expandAccountFeaturedTimeline = accountId => expandTimeline(`account:${accountId}:pinned`, `/api/v1/accounts/${accountId}/statuses`, { pinned: true }); export const expandAccountMediaTimeline = (accountId, { maxId, limit } = {}) => expandTimeline(`account:${accountId}:media`, `/api/v1/accounts/${accountId}/statuses`, { max_id: maxId, only_media: true, limit: limit || 20 }); export const expandListTimeline = (id, { maxId } = {}, done = noOp) => expandTimeline(`list:${id}`, `/api/v1/timelines/list/${id}`, { max_id: maxId }, done); diff --git a/app/javascript/gabsocial/components/button.js b/app/javascript/gabsocial/components/button.js index a3be6721..78e53aa9 100644 --- a/app/javascript/gabsocial/components/button.js +++ b/app/javascript/gabsocial/components/button.js @@ -136,6 +136,7 @@ export default class Button extends PureComponent { backgroundSubtle2Dark_onHover: backgroundColor === COLORS.tertiary || backgroundColor === COLORS.secondary, backgroundColorBlackOpaque_onHover: backgroundColor === COLORS.black, backgroundColorBrandDark_onHover: backgroundColor === COLORS.brand, + backgroundColorDangerDark_onHover: backgroundColor === COLORS.danger, backgroundColorBrand_onHover: color === COLORS.brand && outline, colorWhite_onHover: !!children && color === COLORS.brand && outline, diff --git a/app/javascript/gabsocial/components/comment.js b/app/javascript/gabsocial/components/comment.js index 3ceabe0a..5af7ed92 100644 --- a/app/javascript/gabsocial/components/comment.js +++ b/app/javascript/gabsocial/components/comment.js @@ -52,7 +52,7 @@ class Comment extends ImmutablePureComponent { // : todo : add media return ( -
+
diff --git a/app/javascript/gabsocial/components/comment_list.js b/app/javascript/gabsocial/components/comment_list.js index fec388c4..92cbb213 100644 --- a/app/javascript/gabsocial/components/comment_list.js +++ b/app/javascript/gabsocial/components/comment_list.js @@ -1,20 +1,30 @@ import ImmutablePropTypes from 'react-immutable-proptypes' import ImmutablePureComponent from 'react-immutable-pure-component' +import Button from './button' import Comment from './comment' +import Text from './text' export default class CommentList extends ImmutablePureComponent { static propTypes = { + commentsLimited: PropTypes.bool, descendants: ImmutablePropTypes.list, } render() { - const { descendants } = this.props + const { + descendants, + commentsLimited, + } = this.props + + const size = descendants.size + const max = Math.min(commentsLimited ? 2 : 6, size) + console.log("max:", size, max) return (
{ - descendants.map((descendant, i) => ( + descendants.slice(0, max).map((descendant, i) => ( )) } + { + size > 0 && size > max && +
+ +
+ + {max} +  of  + {size} + +
+
+ }
) } diff --git a/app/javascript/gabsocial/components/load_more.js b/app/javascript/gabsocial/components/load_more.js index b5c5c298..9b131fa0 100644 --- a/app/javascript/gabsocial/components/load_more.js +++ b/app/javascript/gabsocial/components/load_more.js @@ -33,29 +33,31 @@ class LoadMore extends PureComponent { const { disabled, visible, gap, intl } = this.props return ( - +
+ +
) } diff --git a/app/javascript/gabsocial/components/modal/gif_picker_modal.js b/app/javascript/gabsocial/components/modal/gif_picker_modal.js index 824233fc..7bfd877b 100644 --- a/app/javascript/gabsocial/components/modal/gif_picker_modal.js +++ b/app/javascript/gabsocial/components/modal/gif_picker_modal.js @@ -99,7 +99,7 @@ class GifPickerModal extends PureComponent { } handleSelectGifResult = (resultId) => { - + console.log("handleSelectGifResult:", resultId) } render() { diff --git a/app/javascript/gabsocial/components/modal/status_stats_modal.js b/app/javascript/gabsocial/components/modal/status_stats_modal.js new file mode 100644 index 00000000..723ad7e0 --- /dev/null +++ b/app/javascript/gabsocial/components/modal/status_stats_modal.js @@ -0,0 +1,68 @@ +import { injectIntl, defineMessages } from 'react-intl' +import { muteAccount } from '../../actions/accounts' + +const messages = defineMessages({ + muteMessage: { id: 'confirmations.mute.message', defaultMessage: 'Are you sure you want to mute {name}?' }, + cancel: { id: 'confirmation_modal.cancel', defaultMessage: 'Cancel' }, + confirm: { id: 'confirmations.mute.confirm', defaultMessage: 'Mute' }, +}) + +const mapStateToProps = (state) => ({ + isSubmitting: state.getIn(['reports', 'new', 'isSubmitting']), + account: state.getIn(['mutes', 'new', 'account']), +}) + +const mapDispatchToProps = (dispatch) => ({ + onConfirm(account, notifications) { + dispatch(muteAccount(account.get('id'), notifications)) + }, +}) + +export default +@connect(mapStateToProps, mapDispatchToProps) +@injectIntl +class UnfollowModal extends PureComponent { + + static propTypes = { + isSubmitting: PropTypes.bool.isRequired, + account: PropTypes.object.isRequired, + onConfirm: PropTypes.func.isRequired, + intl: PropTypes.object.isRequired, + } + + componentDidMount() { + this.button.focus() + } + + handleClick = () => { + this.props.onClose() + this.props.onConfirm(this.props.account, this.props.notifications) + } + + handleCancel = () => { + this.props.onClose() + } + + render() { + const { account, intl } = this.props + + // , { + // message: @{account.get('acct')} }} />, + // confirm: intl.formatMessage(messages.unfollowConfirm), + // onConfirm: () => dispatch(unfollowAccount(account.get('id'))), + // })); + + return ( + } + confirm={} + onConfirm={() => { + // dispatch(blockDomain(domain)) + // dispatch(blockDomain(domain)) + }} + /> + ) + } + +} diff --git a/app/javascript/gabsocial/components/profile_header.js b/app/javascript/gabsocial/components/profile_header.js index 3c98d368..cb745a25 100644 --- a/app/javascript/gabsocial/components/profile_header.js +++ b/app/javascript/gabsocial/components/profile_header.js @@ -1,7 +1,7 @@ -import axios from 'axios' import ImmutablePropTypes from 'react-immutable-proptypes' import ImmutablePureComponent from 'react-immutable-pure-component' import { defineMessages, injectIntl, FormattedMessage } from 'react-intl' +import Sticky from 'react-stickynode' import classNames from 'classnames/bind' import { followAccount, @@ -26,9 +26,11 @@ const cx = classNames.bind(_s) const messages = defineMessages({ follow: { id: 'follow', defaultMessage: 'Follow' }, + following: { id: 'following', defaultMessage: 'Following' }, unfollow: { id: 'unfollow', defaultMessage: 'Unfollow' }, requested: { id: 'requested', defaultMessage: 'Requested' }, unblock: { id: 'unblock', defaultMessage: 'Unblock' }, + blocked: { id: 'account.blocked', defaultMessage: 'Blocked' }, followers: { id: 'account.followers', defaultMessage: 'Followers' }, follows: { id: 'account.follows', defaultMessage: 'Follows' }, profile: { id: 'account.profile', defaultMessage: 'Profile' }, @@ -92,6 +94,10 @@ class ProfileHeader extends ImmutablePureComponent { openProfileOptionsPopover: PropTypes.func.isRequired, } + state = { + stickied: false, + } + handleOpenMore = () => { const { openProfileOptionsPopover, account } = this.props openProfileOptionsPopover({ @@ -110,7 +116,7 @@ class ProfileHeader extends ImmutablePureComponent { } // : todo : - makeInfo() { + makeInfo = () => { const { account, intl } = this.props const info = [] @@ -132,12 +138,24 @@ class ProfileHeader extends ImmutablePureComponent { return info } + onStickyStateChange = (status) => { + switch (status.status) { + case Sticky.STATUS_FIXED: + this.setState({ stickied: true }) + break; + default: + this.setState({ stickied: false }) + break; + } + } + setOpenMoreNodeRef = (n) => { this.openMoreNode = n } render() { const { account, intl } = this.props + const { stickied } = this.state const tabs = !account ? null : [ { @@ -160,6 +178,60 @@ class ProfileHeader extends ImmutablePureComponent { const headerSrc = !!account ? account.get('header') : '' const headerMissing = headerSrc.indexOf('/headers/original/missing.png') > -1 || !headerSrc + const avatarSize = headerMissing ? '75' : '150' + + let buttonText = '' + let buttonOptions = {} + + if (!account) { + // + } else { + if (!account.get('relationship')) { + // Wait until the relationship is loaded + } else { + const isRequested = account.getIn(['relationship', 'requested']) + const isBlocking = account.getIn(['relationship', 'blocking']) + const isFollowing = account.getIn(['relationship', 'following']) + const isBlockedBy = account.getIn(['relationship', 'blocked_by']) + + if (isRequested) { + buttonText = intl.formatMessage(messages.requested) + buttonOptions = { + onClick: this.handleFollow, + color: 'primary', + backgroundColor: 'tertiary', + } + } else if (isBlocking) { + buttonText = intl.formatMessage(messages.blocked) + buttonOptions = { + onClick: this.handleBlock, + color: 'white', + backgroundColor: 'danger', + } + } else if (isFollowing) { + buttonText = intl.formatMessage(messages.following) + buttonOptions = { + onClick: this.handleFollow, + color: 'white', + backgroundColor: 'brand', + } + } else if (isBlockedBy) { + //Don't show + } + else { + buttonText = intl.formatMessage(messages.follow) + buttonOptions = { + onClick: this.handleFollow, + color: 'brand', + backgroundColor: 'none', + outline: true, + } + } + } + } + + console.log('buttonOptions:', buttonText, buttonOptions) + console.log('account: ', account) const avatarContainerClasses = cx({ circle: 1, @@ -168,78 +240,18 @@ class ProfileHeader extends ImmutablePureComponent { border2PX: 1, }) - const avatarSize = headerMissing ? '75' : '150' + const stickyBarContainerClasses = cx({ + default: 1, + flexRow: 1, + px15: 1, + alignItemsCenter: 1, + displayNone: !stickied, + }) - let buttonText = '' - let buttonOptions = {} - - if (!account) { - console.log('no account') - } else { - if (!account.get('relationship')) { - console.log('no relationship') - // Wait until the relationship is loaded - } else if (account.getIn(['relationship', 'requested'])) { - buttonText = intl.formatMessage(messages.requested) - buttonOptions = { - narrow: true, - onClick: this.handleFollow, - color: 'primary', - backgroundColor: 'tertiary', - } - } else if (!account.getIn(['relationship', 'blocking'])) { - const isFollowing = account.getIn(['relationship', 'following']) - const isBlockedBy = account.getIn(['relationship', 'blocked_by']) - buttonText = intl.formatMessage(isFollowing ? messages.unfollow : messages.follow) - buttonOptions = { - narrow: true, - onClick: this.handleFollow, - color: 'primary', - backgroundColor: 'tertiary', - disabled: isBlockedBy, - } - } else if (account.getIn(['relationship', 'blocking'])) { - buttonText = intl.formatMessage(messages.unblock) - buttonOptions = { - narrow: true, - onClick: this.handleBlock, - color: 'primary', - backgroundColor: 'tertiary', - } - } else { - console.log('no nothin') - } - - // 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.unblock) - // buttonOptions = { - // narrow: true, - // onClick: requested ? this.handleFollow : this.handleBlock, - // color: 'primary', - // backgroundColor: 'tertiary', - // } - // } else if (!account.get('moved') || following) { - // buttonOptions = { - // narrow: true, - // outline: !following, - // color: !following ? 'brand' : 'white', - // backgroundColor: !following ? 'none' : 'brand', - // onClick: this.handleFollow, - // } - // buttonText = intl.formatMessage(following ? messages.unfollow : messages.follow) - // } else { - // console.log("SHOW ELSE") - // } - // } - } - - console.log('buttonOptions:', buttonText, buttonOptions) - console.log('account: ', account) + const tabBarContainerClasses = cx({ + default: 1, + displayNone: stickied, + }) // : todo : "follows you", "mutual follow" @@ -260,7 +272,7 @@ class ProfileHeader extends ImmutablePureComponent {
-
+
@@ -271,87 +283,103 @@ class ProfileHeader extends ImmutablePureComponent { account && account.get('locked') && } + { + /* : todo : + account.getIn(['relationship', 'muting']) + */ + }
- -
-
- -
- - { - account && account.get('id') === me && -
- + + +
+
+
- } - { - account && account.get('id') !== me && -
-
- + +
+ } -
- } -
+ { + account && account.get('id') !== me && +
+
+
+ +
+
+ } + +
+ } +
+
) diff --git a/app/javascript/gabsocial/components/sidebar.js b/app/javascript/gabsocial/components/sidebar.js index a853e277..1483f5f9 100644 --- a/app/javascript/gabsocial/components/sidebar.js +++ b/app/javascript/gabsocial/components/sidebar.js @@ -106,8 +106,6 @@ class Sidebar extends ImmutablePureComponent { const acct = account.get('acct') const isPro = account.get('is_pro') - console.log('showCommunityTimeline:', showCommunityTimeline) - const menuItems = [ { title: 'Home', diff --git a/app/javascript/gabsocial/components/status.js b/app/javascript/gabsocial/components/status.js index da8962c9..4de1458e 100644 --- a/app/javascript/gabsocial/components/status.js +++ b/app/javascript/gabsocial/components/status.js @@ -84,7 +84,6 @@ class Status extends ImmutablePureComponent { hidden: PropTypes.bool, onMoveUp: PropTypes.func, onMoveDown: PropTypes.func, - showThread: PropTypes.bool, getScrollPosition: PropTypes.func, updateScrollBottom: PropTypes.func, cacheMediaWidth: PropTypes.func, @@ -93,7 +92,6 @@ class Status extends ImmutablePureComponent { promoted: PropTypes.bool, onOpenProUpgradeModal: PropTypes.func, intl: PropTypes.object.isRequired, - borderless: PropTypes.bool, isChild: PropTypes.bool, } @@ -267,10 +265,8 @@ class Status extends ImmutablePureComponent { intl, hidden, featured, - showThread, group, promoted, - borderless, isChild, } = this.props @@ -386,8 +382,8 @@ class Status extends ImmutablePureComponent { const containerClasses = cx({ default: 1, - radiusSmall: !borderless && !isChild, - // mb15: !borderless && !isChild, + radiusSmall: !isChild, + // mb15: !isChild, // backgroundColorPrimary: 1, pb15: featured, borderBottom1PX: featured && !isChild, @@ -397,9 +393,9 @@ class Status extends ImmutablePureComponent { const innerContainerClasses = cx({ default: 1, overflowHidden: 1, - radiusSmall: !borderless, - borderColorSecondary: !borderless, - border1PX: !borderless, + radiusSmall: isChild, + borderColorSecondary: isChild, + border1PX: isChild, pb10: isChild && status.get('media_attachments').size === 0, pb5: isChild && status.get('media_attachments').size > 1, cursorPointer: isChild, @@ -409,7 +405,7 @@ class Status extends ImmutablePureComponent { return (
{ - if (me) { - this.props.onQuote(this.props.status, this.context.router.history) - } else { - this.props.onOpenUnauthorizedModal() - } - } - handleFavoriteClick = () => { if (me) { this.props.onFavorite(this.props.status) @@ -123,17 +115,29 @@ class StatusActionBar extends ImmutablePureComponent { handleRepostClick = e => { if (me) { - this.props.onRepost(this.props.status, e) + // this.props.onRepost(this.props.status, e) + this.props.onQuote(this.props.status, this.context.router.history) } else { this.props.onOpenUnauthorizedModal() } } handleShareClick = () => { - console.log("handleShareClick:", this.shareButton, this.props.status) this.props.onOpenStatusSharePopover(this.shareButton, this.props.status) } + openLikesList = () => { + + } + + toggleCommentsVisible = () => { + + } + + openRepostsList = () => { + + } + setShareButton = (n) => { this.shareButton = n } @@ -176,6 +180,7 @@ class StatusActionBar extends ImmutablePureComponent { text: 1, cursorPointer: 1, fontWeightNormal: 1, + underline_onHover: 1, mr10: 1, py5: 1, }) @@ -187,7 +192,7 @@ class StatusActionBar extends ImmutablePureComponent {
{ favoriteCount > 0 && -