Commit bb86c23c authored by mgabdev's avatar mgabdev

Removed unused compactMode setting for Status components

• Removed:
- unused compactMode setting for Status components
parent cfa9aa0e
......@@ -8,7 +8,7 @@ import {
COMMENT_SORTING_TYPE_NEWEST,
COMMENT_SORTING_TYPE_TOP,
} from '../constants'
import { me, displayMedia, compactMode } from '../initial_state'
import { me, displayMedia } from '../initial_state'
import scheduleIdleTask from '../utils/schedule_idle_task'
import ComposeFormContainer from '../features/compose/containers/compose_form_container'
import ResponsiveClassesComponent from '../features/ui/util/responsive_classes_component'
......@@ -452,26 +452,21 @@ class Status extends ImmutablePureComponent {
}
const parentClasses = CX({
pb15: !isChild && !compactMode,
pb15: !isChild,
})
const containerClasses = CX({
default: 1,
radiusSmall: !isChild && !compactMode,
radiusSmall: !isChild,
bgPrimary: !isChild,
boxShadowBlock: !isChild && !compactMode,
borderRight1PX: !isChild && compactMode,
borderLeft1PX: !isChild && compactMode,
borderBottom1PX: !isChild && compactMode,
borderColorSecondary: !isChild && compactMode,
boxShadowBlock: !isChild,
})
const containerClassesXS = CX({
default: 1,
bgPrimary: !isChild,
boxShadowBlock: !isChild && !compactMode,
boxShadowBlock: !isChild,
borderTop1PX: !isChild,
borderBottom1PX: !isChild && compactMode,
borderColorSecondary: !isChild,
})
......@@ -579,7 +574,7 @@ class Status extends ImmutablePureComponent {
}
{
!isChild && !compactMode && !!me &&
!isChild && !!me &&
<ResponsiveClassesComponent
classNames={[_s.default, _s.borderTop1PX, _s.borderColorSecondary, _s.pt10, _s.px15, _s.mb10].join(' ')}
classNamesXS={[_s.default, _s.borderTop1PX, _s.borderColorSecondary, _s.pt10, _s.px10, _s.mb10].join(' ')}
......@@ -597,7 +592,7 @@ class Status extends ImmutablePureComponent {
}
{
descendantsIds && !compactMode && !isChild && !isNotification && descendantsIds.size > 0 &&
descendantsIds && !isChild && !isNotification && descendantsIds.size > 0 &&
<Fragment>
<div className={[_s.default, _s.mr10, _s.ml10, _s.mb10, _s.borderColorSecondary, _s.borderBottom1PX].join(' ')} />
......
......@@ -2,10 +2,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes'
import ImmutablePureComponent from 'react-immutable-pure-component'
import { defineMessages, injectIntl } from 'react-intl'
import { NavLink } from 'react-router-dom'
import {
me,
compactMode,
} from '../initial_state'
import { me } from '../initial_state'
import Text from './text'
import StatusActionBarItem from './status_action_bar_item'
import { CX } from '../constants'
......@@ -21,10 +18,6 @@ const messages = defineMessages({
commentsLabel: { id: 'comments.label', defaultMessage: '{number, plural, one {# comment} other {# comments}}' },
})
const NOU = (num) => {
return num <= 0 ? undefined : num
}
export default
@injectIntl
class StatusActionBar extends ImmutablePureComponent {
......@@ -101,9 +94,9 @@ class StatusActionBar extends ImmutablePureComponent {
py2: 1,
flexRow: 1,
width100PC: 1,
borderTop1PX: !shouldCondense && !compactMode,
borderColorSecondary: !shouldCondense && !compactMode,
mt5: hasInteractions && !compactMode,
borderTop1PX: !shouldCondense,
borderColorSecondary: !shouldCondense,
mt5: hasInteractions,
})
const likeBtnClasses = CX({
......@@ -133,7 +126,7 @@ class StatusActionBar extends ImmutablePureComponent {
return (
<div className={containerClasses}>
{
hasInteractions && !compactMode &&
hasInteractions &&
<div className={[_s.default, _s.flexRow, _s.alignItemsEnd, _s.px5].join(' ')}>
{
favoriteCount > 0 &&
......@@ -177,18 +170,18 @@ class StatusActionBar extends ImmutablePureComponent {
<div className={innerContainerClasses}>
<div className={[_s.default, _s.flexRow, _s.py2, _s.width100PC].join(' ')}>
<StatusActionBarItem
title={compactMode ? NOU(favoriteCount) : intl.formatMessage(messages.like)}
title={intl.formatMessage(messages.like)}
icon={!!status.get('favourited') ? 'liked' : 'like'}
active={!!status.get('favourited')}
onClick={this.handleFavoriteClick}
/>
<StatusActionBarItem
title={compactMode ? NOU(replyCount) : intl.formatMessage(messages.comment)}
title={intl.formatMessage(messages.comment)}
icon='comment'
onClick={this.handleReplyClick}
/>
<StatusActionBarItem
title={compactMode ? NOU(repostCount) : intl.formatMessage(messages.repost)}
title={intl.formatMessage(messages.repost)}
altTitle={!publicStatus ? intl.formatMessage(messages.cannot_repost) : ''}
icon={!publicStatus ? 'lock' : 'repost'}
disabled={!publicStatus}
......
import { compactMode } from '../initial_state'
import {
CX,
BREAKPOINT_EXTRA_SMALL,
......@@ -33,19 +32,10 @@ export default class StatusActionBarItem extends PureComponent {
altTitle
} = this.props
const containerClasses = CX({
default: 1,
px5: !compactMode,
px10: compactMode,
flexNormal: !compactMode,
})
const btnClasses = CX({
justifyContentCenter: 1,
alignItemsCenter: 1,
px10: !compactMode,
px15: compactMode,
pt10: compactMode,
px10: 1,
bgSubtle_onHover: !disabled,
})
......@@ -57,10 +47,9 @@ export default class StatusActionBarItem extends PureComponent {
const color = active ? 'brand' : 'secondary'
const weight = active ? 'bold' : 'medium'
const iconSize = compactMode ? '14px' : '16px'
return (
<div className={containerClasses}>
<div className={[_s.default, _s.px5, _s.flexNormal].join(' ')}>
<Button
isBlock
radiusSmall
......@@ -72,7 +61,7 @@ export default class StatusActionBarItem extends PureComponent {
onClick={onClick}
isDisabled={disabled}
icon={icon}
iconSize={iconSize}
iconSize='16px'
iconClassName={iconClasses}
>
{
......
......@@ -2,8 +2,6 @@ import { NavLink } from 'react-router-dom'
import { injectIntl, defineMessages, FormattedMessage } from 'react-intl'
import ImmutablePropTypes from 'react-immutable-proptypes'
import ImmutablePureComponent from 'react-immutable-pure-component'
import { compactMode } from '../initial_state'
import { CX } from '../constants'
import Icon from './icon'
import Text from './text'
......@@ -47,16 +45,8 @@ class StatusPrepend extends ImmutablePureComponent {
else if (isRepost) iconId = 'repost'
else if (isComment) iconId = 'comment'
const containerClasses = CX({
default: 1,
width100PC: 1,
alignItemsStart: 1,
borderBottom1PX: !compactMode,
borderColorSecondary: !compactMode,
})
return (
<div className={containerClasses}>
<div className={[_s.default, _s.width100PC, _s.alignItemsStart, _s.borderBottom1PX, _s.borderColorSecondary].join(' ')}>
<div className={[_s.default, _s.width100PC, _s.flexRow, _s.alignItemsCenter, _s.py5, _s.px15].join(' ')}>
<Icon id={iconId} size='12px' className={[_s.fillSecondary, _s.mr5].join(' ')} />
{
......
......@@ -25,6 +25,5 @@ export const unreadCount = getMeta('unread_count');
export const lastReadNotificationId = getMeta('last_read_notification_id');
export const monthlyExpensesComplete = getMeta('monthly_expenses_complete');
export const favouritesCount = getMeta('favourites_count');
export const compactMode = false;
export default initialState;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment