This commit is contained in:
mgabdev
2020-05-06 00:33:54 -04:00
parent 01bb440385
commit e1e26afe11
23 changed files with 501 additions and 292 deletions

View File

@@ -277,8 +277,6 @@ class ComposeForm extends ImmutablePureComponent {
displayNone: length(this.props.text) === 0 || anyMedia,
})
console.log("reduxReplyToId:", reduxReplyToId, shouldCondense, isModalOpen)
return (
<div className={parentContainerClasses}>
<div className={[_s.default, _s.flexRow, _s.width100PC].join(' ')}>

View File

@@ -52,7 +52,6 @@ const mapDispatchToProps = (dispatch) => ({
dispatch(changeGroupDescription(value))
},
onCoverImageChange: (imageData) => {
console.log("imageData:", imageData)
dispatch(changeGroupCoverImage(imageData))
},
onResetEditor: () => {

View File

@@ -0,0 +1,76 @@
import {
BREAKPOINT_EXTRA_LARGE,
BREAKPOINT_LARGE,
BREAKPOINT_MEDIUM,
BREAKPOINT_SMALL,
BREAKPOINT_EXTRA_SMALL,
} from '../../../constants'
import { getWindowDimension } from '../../../utils/is_mobile'
const initialState = getWindowDimension()
export default class ResponsiveClassesComponent extends PureComponent {
static propTypes = {
classNames: PropTypes.string,
classNamesXL: PropTypes.string,
classNamesLarge: PropTypes.string,
classNamesMedium: PropTypes.string,
classNamesSmall: PropTypes.string,
classNamesXS: PropTypes.string,
}
state = {
width: initialState.width,
}
componentDidMount() {
this.handleResize()
window.addEventListener('resize', this.handleResize, false)
}
componentWillUnmount() {
window.removeEventListener('resize', this.handleResize, false)
}
handleResize = () => {
const { width } = getWindowDimension()
this.setState({ width })
}
render() {
const {
children,
classNames,
classNamesXL,
classNamesLarge,
classNamesMedium,
classNamesSmall,
classNamesXS,
} = this.props
const { width } = this.state
let classes;
if (width >= BREAKPOINT_EXTRA_LARGE) {
classes = classNamesXL || classNames
} else if (width < BREAKPOINT_EXTRA_LARGE && width >= BREAKPOINT_LARGE) {
classes = classNames //default
} else if (width < BREAKPOINT_LARGE && width >= BREAKPOINT_MEDIUM) {
classes = classNamesLarge || classNames
} else if (width < BREAKPOINT_MEDIUM && width >= BREAKPOINT_SMALL) {
classes = classNamesMedium || classNamesLarge || classNames
} else if (width < BREAKPOINT_SMALL && width >= BREAKPOINT_EXTRA_SMALL) {
classes = classNamesSmall || classNamesMedium || classNamesLarge || classNames
} else {
classes = classNamesXS || classNamesSmall || classNamesMedium || classNamesLarge || classNames
}
return (
<div className={classes}>
{children}
</div>
)
}
}

View File

@@ -3,6 +3,7 @@ import { getWindowDimension } from '../../../utils/is_mobile'
const initialState = getWindowDimension()
export default class Responsive extends PureComponent {
static propTypes = {
min: PropTypes.number,
max: PropTypes.number,
@@ -18,6 +19,7 @@ export default class Responsive extends PureComponent {
}
componentDidMount() {
this.handleResize()
window.addEventListener('resize', this.handleResize, false)
}
@@ -43,4 +45,5 @@ export default class Responsive extends PureComponent {
return shouldRender ? children : null
}
}