@@ -64,25 +85,34 @@ class NavigationBar extends ImmutablePureComponent {
-
+
+
+
+ { /** actions */}
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
- {
- !!account &&
-
- }
+ {
+ !!account &&
+
+ }
+
diff --git a/app/javascript/gabsocial/components/sidebar_section_item.js b/app/javascript/gabsocial/components/sidebar_section_item.js
index 12d15f3d..6b90a579 100644
--- a/app/javascript/gabsocial/components/sidebar_section_item.js
+++ b/app/javascript/gabsocial/components/sidebar_section_item.js
@@ -1,9 +1,11 @@
-import classNames from 'classnames/bind'
+import {
+ CX,
+ BREAKPOINT_SMALL
+} from '../constants'
import Button from './button'
import Icon from './icon'
import Image from './image'
-
-const cx = classNames.bind(_s)
+import Responsive from '../features/ui/util/responsive_component'
export default class SidebarSectionItem extends PureComponent {
@@ -57,7 +59,7 @@ export default class SidebarSectionItem extends PureComponent {
const shouldShowActive = hovering || active || currentPathname === to || currentPathname === href
const isNotifications = to === '/notifications'
- const containerClasses = cx({
+ const containerClasses = CX({
default: 1,
maxWidth100PC: 1,
width100PC: 1,
@@ -74,7 +76,7 @@ export default class SidebarSectionItem extends PureComponent {
bgPrimary: shouldShowActive,
})
- const textClasses = cx({
+ const textClasses = CX({
default: 1,
fontWeightNormal: 1,
fs15PX: 1,
@@ -83,11 +85,11 @@ export default class SidebarSectionItem extends PureComponent {
colorPrimary: 1,
})
- const iconClasses = cx({
+ const iconClasses = CX({
fillPrimary: 1,
})
- const countClasses = cx({
+ const countClasses = CX({
default: 1,
text: 1,
mlAuto: 1,
@@ -130,9 +132,11 @@ export default class SidebarSectionItem extends PureComponent {
/>
}
-
- {title}
-
+
+
+ {title}
+
+
{
count > 0 &&
diff --git a/app/javascript/gabsocial/components/status.js b/app/javascript/gabsocial/components/status.js
index 48f74dde..94b72ac3 100644
--- a/app/javascript/gabsocial/components/status.js
+++ b/app/javascript/gabsocial/components/status.js
@@ -4,7 +4,10 @@ import ImmutablePureComponent from 'react-immutable-pure-component'
import { HotKeys } from 'react-hotkeys'
import classNames from 'classnames/bind'
import { me, displayMedia, compactMode } 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'
+import ColumnIndicator from './column_indicator'
import StatusContent from './status_content'
import StatusPrepend from './status_prepend'
import StatusActionBar from './status_action_bar'
@@ -133,12 +136,14 @@ class Status extends ImmutablePureComponent {
if (nextProps.isChild) return null
if (!nextProps.isHidden && (nextProps.isIntersecting || !nextProps.commentsLimited) && !prevState.loadedComments) {
+ console.log("111111111111111111111111111111111111", nextProps.isHidden, nextProps.isIntersecting)
return {
loadedComments: true
}
}
if (nextProps.status && nextProps.status.get('id') !== prevState.statusId) {
+ console.log("2222222222222222222222222222222222222")
return {
loadedComments: false, //reset
showMedia: defaultMediaVisibility(nextProps.status),
@@ -154,12 +159,14 @@ class Status extends ImmutablePureComponent {
// timeline lazy loading comments
if (!prevState.loadedComments && this.state.loadedComments && this.props.status && !this.props.isChild) {
const commentCount = this.props.status.get('replies_count')
- if (commentCount > 0 && !this.props.isComment) {
- this.props.onFetchComments(this.props.status.get('id'))
- // this._measureHeight(prevState.height !== this.state.height)
- } else {
- console.log("before fetch:", this.props.status)
+ if (this.props.isComment) {
this.props.onFetchContext(this.props.status.get('id'))
+ this._measureHeight(prevState.height !== this.state.height)
+ } else {
+ if (commentCount > 0) {
+ this._measureHeight(prevState.height !== this.state.height)
+ this.props.onFetchComments(this.props.status.get('id'))
+ }
}
}
@@ -170,6 +177,7 @@ class Status extends ImmutablePureComponent {
if (snapshot !== null && this.props.updateScrollBottom) {
if (this.node && this.node.offsetTop < snapshot.top) {
+ console.log("updateScrollBottom")
this.props.updateScrollBottom(snapshot.height - snapshot.top)
}
}
@@ -332,15 +340,15 @@ class Status extends ImmutablePureComponent {
return status
}
- _measureHeight (heightJustChanged) {
+ _measureHeight(heightJustChanged) {
try {
scheduleIdleTask(() => this.node && this.setState({ height: Math.ceil(this.node.scrollHeight) + 1 }))
-
+
if (heightJustChanged) {
this.props.onHeightChange()
- }
+ }
} catch (error) {
-
+ //
}
}
@@ -360,12 +368,18 @@ class Status extends ImmutablePureComponent {
commentsLimited,
ancestorStatus,
isComment,
+ contextType,
} = this.props
-
+ // const { height } = this.state
+
let { status } = this.props
if (!status) return null
+ if (isComment && !ancestorStatus && !isChild) {
+ return
+ }
+
let reblogContent, rebloggedByText = null
if (ancestorStatus) {
@@ -394,35 +408,27 @@ class Status extends ImmutablePureComponent {
toggleSensitive: this.handleHotkeyToggleSensitive,
}
- if (isHidden) {
- return (
-
-
- {status.getIn(['account', 'display_name']) || status.getIn(['account', 'username'])}
- {status.get('content')}
-
-
- )
- }
-
- if (status.get('filtered') || status.getIn(['reblog', 'filtered'])) {
- return null
- }
+ const parentClasses = cx({
+ pb15: !isChild && !compactMode,
+ })
const containerClasses = cx({
- default: 1,
- pb15: isFeatured,
radiusSmall: !isChild && !compactMode,
bgPrimary: !isChild,
boxShadowBlock: !isChild && !compactMode,
- outlineNone: 1,
- mb15: !isChild && !compactMode,
borderRight1PX: !isChild && compactMode,
borderLeft1PX: !isChild && compactMode,
borderBottom1PX: !isChild && compactMode,
borderColorSecondary: !isChild && compactMode,
})
+ const containerClassesXS = cx({
+ bgPrimary: !isChild,
+ boxShadowBlock: !isChild && !compactMode,
+ borderBottom1PX: !isChild && compactMode,
+ borderColorSecondary: !isChild && compactMode,
+ })
+
const innerContainerClasses = cx({
default: 1,
overflowHidden: 1,
@@ -435,95 +441,117 @@ class Status extends ImmutablePureComponent {
bgSubtle_onHover: isChild,
})
+ if (status.get('filtered') || status.getIn(['reblog', 'filtered'])) {
+ return null
+ }
+
+ if (isHidden) {
+ return (
+
+
+ {status.getIn(['account', 'display_name']) || status.getIn(['account', 'username'])}
+ {status.get('content')}
+
+
+ )
+ }
+
return (
-
-
+
+
+
+
-
+
-
+
-
+
-
-
+
+
+
+
+
+
+ {
+ !!status.get('quote') && !isChild &&
+
+
+
+ }
+
+ {
+ !isChild &&
+
+ }
+
+ {
+ !isChild && !compactMode && !!me &&
+
+
+
+ }
+
+ {
+ descendantsIds && !compactMode && !isChild && descendantsIds.size > 0 &&
+
+ }
+
+ {
+ descendantsIds && !compactMode && !isChild && descendantsIds.size > 0 &&
+
+ }
+
-
-
-
- {
- !!status.get('quote') && !isChild &&
-
-
-
- }
-
- {
- !isChild &&
-
- }
-
- {
- !isChild && !compactMode && !!me &&
-
-
-
- }
-
- {
- descendantsIds && !compactMode && !isChild && descendantsIds.size > 0 &&
-
- }
-
- {
- descendantsIds && !compactMode && !isChild && descendantsIds.size > 0 &&
-
- }
-
+
)
diff --git a/app/javascript/gabsocial/components/status_card.js b/app/javascript/gabsocial/components/status_card.js
index 295ab075..d2196209 100644
--- a/app/javascript/gabsocial/components/status_card.js
+++ b/app/javascript/gabsocial/components/status_card.js
@@ -3,6 +3,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes'
import ImmutablePureComponent from 'react-immutable-pure-component'
import punycode from 'punycode'
import { DEFAULT_REL } from '../constants'
+import ResponsiveClassesComponent from '../features/ui/util/responsive_classes_component'
import Icon from './icon'
const IDNA_PREFIX = 'xn--'
@@ -67,7 +68,7 @@ export default class Card extends ImmutablePureComponent {
embedded: false,
}
- componentWillReceiveProps (nextProps) {
+ componentWillReceiveProps(nextProps) {
if (!Immutable.is(this.props.card, nextProps.card)) {
this.setState({ embedded: false })
}
@@ -111,12 +112,12 @@ export default class Card extends ImmutablePureComponent {
}
}
- renderVideo () {
- const { card } = this.props
- const content = { __html: addAutoPlay(card.get('html')) }
+ renderVideo() {
+ const { card } = this.props
+ const content = { __html: addAutoPlay(card.get('html')) }
const { width } = this.state
- const ratio = card.get('width') / card.get('height')
- const height = width / ratio
+ const ratio = card.get('width') / card.get('height')
+ const height = width / ratio
return (
:
-
+ (
+
+
+
+ )
if (interactive) {
if (embedded) {
@@ -193,9 +201,9 @@ export default class Card extends ImmutablePureComponent {
- { !!embed && embed}
- { !embed && thumbnail}
- { !embed &&
+ {!!embed && embed}
+ {!embed && thumbnail}
+ {!embed &&
)
diff --git a/app/javascript/gabsocial/components/status_content.js b/app/javascript/gabsocial/components/status_content.js
index b85d3147..b4086210 100644
--- a/app/javascript/gabsocial/components/status_content.js
+++ b/app/javascript/gabsocial/components/status_content.js
@@ -169,7 +169,12 @@ class StatusContent extends ImmutablePureComponent {
}
render() {
- const { status, intl, isComment } = this.props
+ const {
+ collapsable,
+ intl,
+ isComment,
+ status,
+ } = this.props
const { collapsed } = this.state
if (status.get('content').length === 0) return null
@@ -302,7 +307,7 @@ class StatusContent extends ImmutablePureComponent {
onMouseUp={this.handleMouseUp}
/>
{
- this.state.collapsed &&
+ this.state.collapsed && collapsable &&