forked from Ivasoft/mattermost-mobile
MM-18542 Fix file attachment scroll on tablets, MM-18732 Slow scroll in landscape & MM-18836 settings sidebar width (#3323)
This commit is contained in:
committed by
Elias Nahum
parent
03692f1975
commit
41bcc75df9
@@ -13,7 +13,6 @@ exports[`PostAttachmentOpenGraph should match snapshot with a single image file
|
||||
>
|
||||
<FileAttachment
|
||||
canDownloadFiles={true}
|
||||
deviceWidth={660}
|
||||
file={
|
||||
Object {
|
||||
"caption": "image.png",
|
||||
|
||||
@@ -21,7 +21,6 @@ import FileAttachmentImage from './file_attachment_image';
|
||||
export default class FileAttachment extends PureComponent {
|
||||
static propTypes = {
|
||||
canDownloadFiles: PropTypes.bool.isRequired,
|
||||
deviceWidth: PropTypes.number.isRequired,
|
||||
file: PropTypes.object.isRequired,
|
||||
id: PropTypes.string.isRequired,
|
||||
index: PropTypes.number.isRequired,
|
||||
@@ -89,7 +88,6 @@ export default class FileAttachment extends PureComponent {
|
||||
render() {
|
||||
const {
|
||||
canDownloadFiles,
|
||||
deviceWidth,
|
||||
file,
|
||||
theme,
|
||||
onLongPress,
|
||||
@@ -137,10 +135,8 @@ export default class FileAttachment extends PureComponent {
|
||||
);
|
||||
}
|
||||
|
||||
const width = deviceWidth * 0.72;
|
||||
|
||||
return (
|
||||
<View style={[style.fileWrapper, {width}]}>
|
||||
<View style={[style.fileWrapper]}>
|
||||
{fileAttachmentComponent}
|
||||
<TouchableOpacity
|
||||
onLongPress={onLongPress}
|
||||
@@ -195,7 +191,7 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
|
||||
borderWidth: 1,
|
||||
borderColor: changeOpacity(theme.centerChannelColor, 0.2),
|
||||
borderRadius: 2,
|
||||
maxWidth: 350,
|
||||
width: 300,
|
||||
},
|
||||
circularProgress: {
|
||||
width: '100%',
|
||||
|
||||
@@ -25,8 +25,6 @@ export default class FileAttachmentList extends Component {
|
||||
showModalOverCurrentContext: PropTypes.func.isRequired,
|
||||
}).isRequired,
|
||||
canDownloadFiles: PropTypes.bool.isRequired,
|
||||
deviceHeight: PropTypes.number.isRequired,
|
||||
deviceWidth: PropTypes.number.isRequired,
|
||||
fileIds: PropTypes.array.isRequired,
|
||||
files: PropTypes.array,
|
||||
isFailed: PropTypes.bool,
|
||||
@@ -129,14 +127,13 @@ export default class FileAttachmentList extends Component {
|
||||
});
|
||||
|
||||
renderItems = () => {
|
||||
const {canDownloadFiles, deviceWidth, fileIds, files} = this.props;
|
||||
const {canDownloadFiles, fileIds, files} = this.props;
|
||||
|
||||
if (!files.length && fileIds.length > 0) {
|
||||
return fileIds.map((id, idx) => (
|
||||
<FileAttachment
|
||||
key={id}
|
||||
canDownloadFiles={canDownloadFiles}
|
||||
deviceWidth={deviceWidth}
|
||||
file={{loading: true}}
|
||||
id={id}
|
||||
index={idx}
|
||||
@@ -155,7 +152,6 @@ export default class FileAttachmentList extends Component {
|
||||
<FileAttachment
|
||||
key={file.id}
|
||||
canDownloadFiles={canDownloadFiles}
|
||||
deviceWidth={deviceWidth}
|
||||
file={f}
|
||||
id={file.id}
|
||||
index={idx}
|
||||
|
||||
@@ -10,7 +10,6 @@ import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
|
||||
|
||||
import {showModalOverCurrentContext} from 'app/actions/navigation';
|
||||
import {loadFilesForPostIfNecessary} from 'app/actions/views/channel';
|
||||
import {getDimensions} from 'app/selectors/device';
|
||||
|
||||
import FileAttachmentList from './file_attachment_list';
|
||||
|
||||
@@ -18,7 +17,6 @@ function makeMapStateToProps() {
|
||||
const getFilesForPost = makeGetFilesForPost();
|
||||
return function mapStateToProps(state, ownProps) {
|
||||
return {
|
||||
...getDimensions(state),
|
||||
canDownloadFiles: canDownloadFilesOnMobile(state),
|
||||
files: getFilesForPost(state, ownProps.postId),
|
||||
theme: getTheme(state),
|
||||
|
||||
@@ -20,8 +20,6 @@ import {
|
||||
import telemetry from 'app/telemetry';
|
||||
|
||||
const MIN_SWIPE_DISTANCE = 3;
|
||||
const DEVICE_WIDTH = parseFloat(Dimensions.get('window').width);
|
||||
const THRESHOLD = DEVICE_WIDTH / 2;
|
||||
const VX_MAX = 0.1;
|
||||
|
||||
const IDLE = 'Idle';
|
||||
@@ -29,6 +27,7 @@ const DRAGGING = 'Dragging';
|
||||
const SETTLING = 'Settling';
|
||||
const emptyObject = {};
|
||||
|
||||
export const DRAWER_INITIAL_OFFSET = 40;
|
||||
export const TABLET_WIDTH = 250;
|
||||
|
||||
export type PropType = {
|
||||
@@ -50,8 +49,10 @@ export type PropType = {
|
||||
|
||||
export type StateType = {
|
||||
accessibilityViewIsModal: boolean,
|
||||
deviceWidth: number,
|
||||
drawerShown: boolean,
|
||||
openValue: any,
|
||||
threshold: number,
|
||||
};
|
||||
|
||||
export type EventType = {
|
||||
@@ -106,13 +107,33 @@ export default class DrawerLayout extends Component {
|
||||
|
||||
this.canClose = true;
|
||||
this.openValue = new Animated.Value(0);
|
||||
const deviceWidth = parseFloat(Dimensions.get('window').width);
|
||||
this.state = {
|
||||
accessibilityViewIsModal: false,
|
||||
deviceWidth,
|
||||
drawerShown: false,
|
||||
threshold: deviceWidth / 2,
|
||||
};
|
||||
this.openValue.addListener(this.handleOpenValueChanged);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
Dimensions.addEventListener('change', this.handleDimensionsChange);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.openValue?.removeListener(this.handleOpenValueChanged);
|
||||
Dimensions.removeEventListener('change', this.handleDimensionsChange);
|
||||
}
|
||||
|
||||
handleDimensionsChange = ({window}) => {
|
||||
const deviceWidth = parseFloat(window.width);
|
||||
this.setState({
|
||||
deviceWidth,
|
||||
threshold: deviceWidth / 2,
|
||||
});
|
||||
};
|
||||
|
||||
handleOpenValueChanged = ({ value }) => {
|
||||
const drawerShown = value > 0;
|
||||
const accessibilityViewIsModal = drawerShown;
|
||||
@@ -338,10 +359,11 @@ export default class DrawerLayout extends Component {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.getDrawerPosition() === 'left') {
|
||||
const overlayArea = DEVICE_WIDTH -
|
||||
(DEVICE_WIDTH - this.props.drawerWidth);
|
||||
const {deviceWidth} = this.state;
|
||||
const overlayArea = deviceWidth -
|
||||
(deviceWidth - this.props.drawerWidth);
|
||||
|
||||
if (this.getDrawerPosition() === 'left') {
|
||||
if (this._lastOpenValue === 1) {
|
||||
if (
|
||||
(dx < 0 && Math.abs(dx) > Math.abs(dy) * 3) ||
|
||||
@@ -360,8 +382,6 @@ export default class DrawerLayout extends Component {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
const overlayArea = DEVICE_WIDTH - this.props.drawerWidth;
|
||||
|
||||
if (this._lastOpenValue === 1) {
|
||||
if (
|
||||
(dx > 0 && Math.abs(dx) > Math.abs(dy) * 3) ||
|
||||
@@ -372,7 +392,7 @@ export default class DrawerLayout extends Component {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (moveX >= DEVICE_WIDTH - 35 && dx < 0) {
|
||||
if (moveX >= deviceWidth - 35 && dx < 0) {
|
||||
this._isClosing = false;
|
||||
return true;
|
||||
}
|
||||
@@ -406,20 +426,21 @@ export default class DrawerLayout extends Component {
|
||||
e: EventType,
|
||||
{ moveX, vx }: PanResponderEventType,
|
||||
) => {
|
||||
const {threshold} = this.state;
|
||||
const previouslyOpen = this._isClosing;
|
||||
const isWithinVelocityThreshold = vx < VX_MAX && vx > -VX_MAX;
|
||||
|
||||
if (this.getDrawerPosition() === 'left') {
|
||||
if (
|
||||
(vx > 0 && moveX > THRESHOLD) ||
|
||||
(vx > 0 && moveX > threshold) ||
|
||||
vx >= VX_MAX ||
|
||||
(isWithinVelocityThreshold &&
|
||||
previouslyOpen &&
|
||||
moveX > THRESHOLD)
|
||||
moveX > threshold)
|
||||
) {
|
||||
this.openDrawer({ velocity: vx });
|
||||
} else if (
|
||||
(vx < 0 && moveX < THRESHOLD) ||
|
||||
(vx < 0 && moveX < threshold) ||
|
||||
vx < -VX_MAX ||
|
||||
(isWithinVelocityThreshold && !previouslyOpen)
|
||||
) {
|
||||
@@ -431,15 +452,15 @@ export default class DrawerLayout extends Component {
|
||||
}
|
||||
} else {
|
||||
if (
|
||||
(vx < 0 && moveX < THRESHOLD) ||
|
||||
(vx < 0 && moveX < threshold) ||
|
||||
vx <= -VX_MAX ||
|
||||
(isWithinVelocityThreshold &&
|
||||
previouslyOpen &&
|
||||
moveX < THRESHOLD)
|
||||
moveX < threshold)
|
||||
) {
|
||||
this.openDrawer({ velocity: (-1) * vx });
|
||||
} else if (
|
||||
(vx > 0 && moveX > THRESHOLD) ||
|
||||
(vx > 0 && moveX > threshold) ||
|
||||
vx > VX_MAX ||
|
||||
(isWithinVelocityThreshold && !previouslyOpen)
|
||||
) {
|
||||
@@ -464,13 +485,14 @@ export default class DrawerLayout extends Component {
|
||||
|
||||
_getOpenValueForX(x: number): number {
|
||||
const { drawerWidth } = this.props;
|
||||
const { deviceWidth } = this.state;
|
||||
|
||||
if (this.getDrawerPosition() === 'left') {
|
||||
return x / drawerWidth;
|
||||
}
|
||||
|
||||
// position === 'right'
|
||||
return (DEVICE_WIDTH - x) / drawerWidth;
|
||||
return (deviceWidth - x) / drawerWidth;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
exports[`MainSidebar should match, full snapshot 1`] = `
|
||||
<DrawerLayout
|
||||
drawerPosition="left"
|
||||
drawerWidth={-30}
|
||||
drawerWidth={710}
|
||||
isTablet={false}
|
||||
onDrawerClose={[Function]}
|
||||
onDrawerOpen={[Function]}
|
||||
|
||||
@@ -11,7 +11,6 @@ import {getCurrentTeamId, getMyTeamsCount} from 'mattermost-redux/selectors/enti
|
||||
|
||||
import {setChannelDisplayName, setChannelLoading} from 'app/actions/views/channel';
|
||||
import {makeDirectChannel} from 'app/actions/views/more_dms';
|
||||
import {getDimensions} from 'app/selectors/device';
|
||||
import telemetry from 'app/telemetry';
|
||||
|
||||
import MainSidebar from './main_sidebar.js';
|
||||
@@ -38,7 +37,6 @@ function mapStateToProps(state) {
|
||||
const {currentUserId} = state.entities.users;
|
||||
|
||||
return {
|
||||
...getDimensions(state),
|
||||
currentTeamId: getCurrentTeamId(state),
|
||||
currentUserId,
|
||||
teamsCount: getMyTeamsCount(state),
|
||||
|
||||
@@ -17,7 +17,7 @@ import {General, WebsocketEvents} from 'mattermost-redux/constants';
|
||||
import EventEmitter from 'mattermost-redux/utils/event_emitter';
|
||||
|
||||
import SafeAreaView from 'app/components/safe_area_view';
|
||||
import DrawerLayout, {TABLET_WIDTH} from 'app/components/sidebars/drawer_layout';
|
||||
import DrawerLayout, {DRAWER_INITIAL_OFFSET, TABLET_WIDTH} from 'app/components/sidebars/drawer_layout';
|
||||
import {DeviceTypes} from 'app/constants';
|
||||
import mattermostManaged from 'app/mattermost_managed';
|
||||
import tracker from 'app/utils/time_tracker';
|
||||
@@ -29,8 +29,6 @@ import TeamsList from './teams_list';
|
||||
|
||||
import telemetry from 'app/telemetry';
|
||||
|
||||
const DRAWER_INITIAL_OFFSET = 40;
|
||||
|
||||
export default class ChannelSidebar extends Component {
|
||||
static propTypes = {
|
||||
actions: PropTypes.shape({
|
||||
@@ -44,7 +42,6 @@ export default class ChannelSidebar extends Component {
|
||||
children: PropTypes.node,
|
||||
currentTeamId: PropTypes.string.isRequired,
|
||||
currentUserId: PropTypes.string.isRequired,
|
||||
deviceWidth: PropTypes.number.isRequired,
|
||||
teamsCount: PropTypes.number.isRequired,
|
||||
theme: PropTypes.object.isRequired,
|
||||
previewChannel: PropTypes.func,
|
||||
@@ -61,6 +58,7 @@ export default class ChannelSidebar extends Component {
|
||||
this.drawerRef = React.createRef();
|
||||
this.channelListRef = React.createRef();
|
||||
this.state = {
|
||||
deviceWidth: Dimensions.get('window').width,
|
||||
show: false,
|
||||
openDrawerOffset: DRAWER_INITIAL_OFFSET,
|
||||
drawerOpened: false,
|
||||
@@ -83,15 +81,14 @@ export default class ChannelSidebar extends Component {
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps, nextState) {
|
||||
const {currentTeamId, deviceWidth, teamsCount, theme} = this.props;
|
||||
const {openDrawerOffset, isSplitView, permanentSidebar, show, searching} = this.state;
|
||||
const {currentTeamId, teamsCount, theme} = this.props;
|
||||
const {deviceWidth, openDrawerOffset, isSplitView, permanentSidebar, show, searching} = this.state;
|
||||
|
||||
if (nextState.openDrawerOffset !== openDrawerOffset || nextState.show !== show || nextState.searching !== searching) {
|
||||
if (nextState.openDrawerOffset !== openDrawerOffset || nextState.show !== show || nextState.searching !== searching || nextState.deviceWidth !== deviceWidth) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return nextProps.currentTeamId !== currentTeamId ||
|
||||
nextProps.deviceWidth !== deviceWidth ||
|
||||
nextProps.teamsCount !== teamsCount ||
|
||||
nextProps.theme !== theme ||
|
||||
nextState.isSplitView !== isSplitView ||
|
||||
@@ -105,7 +102,7 @@ export default class ChannelSidebar extends Component {
|
||||
EventEmitter.off('renderDrawer', this.handleShowDrawerContent);
|
||||
EventEmitter.off(DeviceTypes.PERMANENT_SIDEBAR_SETTINGS, this.handlePermanentSidebar);
|
||||
BackHandler.removeEventListener('hardwareBackPress', this.handleAndroidBack);
|
||||
Dimensions.addEventListener('change', this.handleDimensions);
|
||||
Dimensions.removeEventListener('change', this.handleDimensions);
|
||||
}
|
||||
|
||||
handleAndroidBack = () => {
|
||||
@@ -132,7 +129,7 @@ export default class ChannelSidebar extends Component {
|
||||
openDrawerOffset = window.width * 0.5;
|
||||
}
|
||||
|
||||
this.setState({openDrawerOffset});
|
||||
this.setState({openDrawerOffset, deviceWidth: window.width});
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -400,8 +397,8 @@ export default class ChannelSidebar extends Component {
|
||||
};
|
||||
|
||||
render() {
|
||||
const {children, deviceWidth} = this.props;
|
||||
const {openDrawerOffset} = this.state;
|
||||
const {children} = this.props;
|
||||
const {deviceWidth, openDrawerOffset} = this.state;
|
||||
const isTablet = DeviceTypes.IS_TABLET && !this.state.isSplitView && this.state.permanentSidebar;
|
||||
const drawerWidth = DeviceTypes.IS_TABLET ? TABLET_WIDTH : (deviceWidth - openDrawerOffset);
|
||||
|
||||
|
||||
@@ -14,8 +14,6 @@ import {
|
||||
dismissModal,
|
||||
} from 'app/actions/navigation';
|
||||
|
||||
import {isLandscape, getDimensions} from 'app/selectors/device';
|
||||
|
||||
import SettingsSidebar from './settings_sidebar';
|
||||
|
||||
function mapStateToProps(state) {
|
||||
@@ -23,8 +21,6 @@ function mapStateToProps(state) {
|
||||
const status = getStatusForUserId(state, currentUser.id);
|
||||
|
||||
return {
|
||||
...getDimensions(state),
|
||||
isLandscape: isLandscape(state),
|
||||
currentUser,
|
||||
status,
|
||||
theme: getTheme(state),
|
||||
|
||||
@@ -6,6 +6,7 @@ import PropTypes from 'prop-types';
|
||||
import {intlShape} from 'react-intl';
|
||||
import {
|
||||
BackHandler,
|
||||
Dimensions,
|
||||
InteractionManager,
|
||||
Keyboard,
|
||||
ScrollView,
|
||||
@@ -17,7 +18,7 @@ import {General} from 'mattermost-redux/constants';
|
||||
import EventEmitter from 'mattermost-redux/utils/event_emitter';
|
||||
|
||||
import SafeAreaView from 'app/components/safe_area_view';
|
||||
import DrawerLayout from 'app/components/sidebars/drawer_layout';
|
||||
import DrawerLayout, {DRAWER_INITIAL_OFFSET, TABLET_WIDTH} from 'app/components/sidebars/drawer_layout';
|
||||
import UserStatus from 'app/components/user_status';
|
||||
import {DeviceTypes, NavigationTypes} from 'app/constants';
|
||||
import {confirmOutOfOfficeDisabled} from 'app/utils/status';
|
||||
@@ -29,9 +30,6 @@ import DrawerItem from './drawer_item';
|
||||
import UserInfo from './user_info';
|
||||
import StatusLabel from './status_label';
|
||||
|
||||
const DRAWER_INITIAL_OFFSET = 80;
|
||||
const DRAWER_TABLET_WIDTH = 300;
|
||||
|
||||
export default class SettingsDrawer extends PureComponent {
|
||||
static propTypes = {
|
||||
actions: PropTypes.shape({
|
||||
@@ -44,8 +42,6 @@ export default class SettingsDrawer extends PureComponent {
|
||||
blurPostTextBox: PropTypes.func.isRequired,
|
||||
children: PropTypes.node,
|
||||
currentUser: PropTypes.object.isRequired,
|
||||
deviceWidth: PropTypes.number.isRequired,
|
||||
isLandscape: PropTypes.bool.isRequired,
|
||||
status: PropTypes.string,
|
||||
theme: PropTypes.object.isRequired,
|
||||
};
|
||||
@@ -65,18 +61,39 @@ export default class SettingsDrawer extends PureComponent {
|
||||
MaterialIcon.getImageSource('close', 20, props.theme.sidebarHeaderTextColor).then((source) => {
|
||||
this.closeButton = source;
|
||||
});
|
||||
|
||||
this.state = {
|
||||
deviceWidth: Dimensions.get('window').width,
|
||||
openDrawerOffset: DRAWER_INITIAL_OFFSET,
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.mounted = true;
|
||||
this.handleDimensions({window: Dimensions.get('window')});
|
||||
EventEmitter.on('close_settings_sidebar', this.closeSettingsSidebar);
|
||||
BackHandler.addEventListener('hardwareBackPress', this.handleAndroidBack);
|
||||
Dimensions.addEventListener('change', this.handleDimensions);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.mounted = false;
|
||||
EventEmitter.off('close_settings_sidebar', this.closeSettingsSidebar);
|
||||
BackHandler.removeEventListener('hardwareBackPress', this.handleAndroidBack);
|
||||
Dimensions.removeEventListener('change', this.handleDimensions);
|
||||
}
|
||||
|
||||
confirmReset = (status) => {
|
||||
const {intl} = this.context;
|
||||
confirmOutOfOfficeDisabled(intl, status, this.updateStatus);
|
||||
};
|
||||
|
||||
closeSettingsSidebar = () => {
|
||||
if (this.refs.drawer && this.drawerOpened) {
|
||||
this.refs.drawer.closeDrawer();
|
||||
}
|
||||
};
|
||||
|
||||
handleAndroidBack = () => {
|
||||
if (this.refs.drawer && this.drawerOpened) {
|
||||
this.refs.drawer.closeDrawer();
|
||||
@@ -86,20 +103,6 @@ export default class SettingsDrawer extends PureComponent {
|
||||
return false;
|
||||
};
|
||||
|
||||
openSettingsSidebar = () => {
|
||||
this.props.blurPostTextBox();
|
||||
|
||||
if (this.refs.drawer && !this.drawerOpened) {
|
||||
this.refs.drawer.openDrawer();
|
||||
}
|
||||
};
|
||||
|
||||
closeSettingsSidebar = () => {
|
||||
if (this.refs.drawer && this.drawerOpened) {
|
||||
this.refs.drawer.closeDrawer();
|
||||
}
|
||||
};
|
||||
|
||||
handleDrawerClose = () => {
|
||||
this.drawerOpened = false;
|
||||
Keyboard.dismiss();
|
||||
@@ -110,6 +113,19 @@ export default class SettingsDrawer extends PureComponent {
|
||||
Keyboard.dismiss();
|
||||
};
|
||||
|
||||
handleDimensions = ({window}) => {
|
||||
if (this.mounted) {
|
||||
if (this.state.openDrawerOffset !== 0) {
|
||||
let openDrawerOffset = DRAWER_INITIAL_OFFSET;
|
||||
if ((window.width > window.height) || DeviceTypes.IS_TABLET) {
|
||||
openDrawerOffset = window.width * 0.5;
|
||||
}
|
||||
|
||||
this.setState({openDrawerOffset, deviceWidth: window.width});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handleSetStatus = preventDoubleTap(() => {
|
||||
const {actions} = this.props;
|
||||
const items = [{
|
||||
@@ -215,6 +231,14 @@ export default class SettingsDrawer extends PureComponent {
|
||||
});
|
||||
};
|
||||
|
||||
openSettingsSidebar = () => {
|
||||
this.props.blurPostTextBox();
|
||||
|
||||
if (this.refs.drawer && !this.drawerOpened) {
|
||||
this.refs.drawer.openDrawer();
|
||||
}
|
||||
};
|
||||
|
||||
renderUserStatusIcon = (userId) => {
|
||||
return (
|
||||
<UserStatus
|
||||
@@ -321,11 +345,6 @@ export default class SettingsDrawer extends PureComponent {
|
||||
);
|
||||
};
|
||||
|
||||
confirmReset = (status) => {
|
||||
const {intl} = this.context;
|
||||
confirmOutOfOfficeDisabled(intl, status, this.updateStatus);
|
||||
};
|
||||
|
||||
updateStatus = (status) => {
|
||||
const {currentUser: {id: currentUserId}} = this.props;
|
||||
this.props.actions.setStatus({
|
||||
@@ -348,8 +367,9 @@ export default class SettingsDrawer extends PureComponent {
|
||||
};
|
||||
|
||||
render() {
|
||||
const {children, deviceWidth} = this.props;
|
||||
const drawerWidth = DeviceTypes.IS_TABLET ? DRAWER_TABLET_WIDTH : (deviceWidth - DRAWER_INITIAL_OFFSET);
|
||||
const {children} = this.props;
|
||||
const {deviceWidth, openDrawerOffset} = this.state;
|
||||
const drawerWidth = DeviceTypes.IS_TABLET ? TABLET_WIDTH : (deviceWidth - openDrawerOffset);
|
||||
|
||||
return (
|
||||
<DrawerLayout
|
||||
|
||||
24
package-lock.json
generated
24
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mattermost-mobile",
|
||||
"version": "1.23.0",
|
||||
"version": "1.24.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@@ -9187,9 +9187,9 @@
|
||||
"integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE="
|
||||
},
|
||||
"handlebars": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz",
|
||||
"integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==",
|
||||
"version": "4.3.1",
|
||||
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.3.1.tgz",
|
||||
"integrity": "sha512-c0HoNHzDiHpBt4Kqe99N8tdLPKAnGCQ73gYMPWtAYM4PwGnf7xl8PBUHJqh9ijlzt2uQKaSRxbXRt+rZ7M2/kA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"neo-async": "^2.6.0",
|
||||
@@ -9212,9 +9212,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"uglify-js": {
|
||||
"version": "3.5.10",
|
||||
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.10.tgz",
|
||||
"integrity": "sha512-/GTF0nosyPLbdJBd+AwYiZ+Hu5z8KXWnO0WCGt1BQ/u9Iamhejykqmz5o1OHJ53+VAk6xVxychonnApDjuqGsw==",
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz",
|
||||
"integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -14958,9 +14958,9 @@
|
||||
"integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw=="
|
||||
},
|
||||
"neo-async": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.0.tgz",
|
||||
"integrity": "sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==",
|
||||
"version": "2.6.1",
|
||||
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz",
|
||||
"integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==",
|
||||
"dev": true
|
||||
},
|
||||
"nested-error-stacks": {
|
||||
@@ -16518,8 +16518,8 @@
|
||||
}
|
||||
},
|
||||
"react-native-device-info": {
|
||||
"version": "github:mattermost/react-native-device-info#66d730b4f675038867ca389be7374714c2db63b2",
|
||||
"from": "github:mattermost/react-native-device-info#66d730b4f675038867ca389be7374714c2db63b2"
|
||||
"version": "github:mattermost/react-native-device-info#a434e5378a59825b4c33c9a31bf0d8dc98a45966",
|
||||
"from": "github:mattermost/react-native-device-info#a434e5378a59825b4c33c9a31bf0d8dc98a45966"
|
||||
},
|
||||
"react-native-doc-viewer": {
|
||||
"version": "2.7.8",
|
||||
|
||||
Reference in New Issue
Block a user