This commit is contained in:
Diego Mello 2020-05-28 16:24:18 -03:00
parent ff5b5b33cc
commit 0b0e768ff2
10 changed files with 36 additions and 38 deletions

View File

@ -1,3 +1,4 @@
/* eslint-disable */
import React from 'react';
import { Linking } from 'react-native';
import { AppearanceProvider } from 'react-native-appearance';
@ -27,7 +28,7 @@ import {
isTablet, isIOS, setWidth, supportSystemTheme
} from './utils/deviceInfo';
import { KEY_COMMAND } from './commands';
import Tablet, { initTabletNav } from './tablet';
// import Tablet, { initTabletNav } from './tablet.js__';
import { SplitContext } from './split';
import AppContainer from './AppContainer';
import TwoFactor from './containers/TwoFactor';
@ -65,9 +66,9 @@ export default class Root extends React.Component {
darkLevel: 'dark'
}
};
if (isTablet) {
this.initTablet();
}
// if (isTablet) {
// this.initTablet();
// }
}
componentDidMount() {
@ -129,14 +130,14 @@ export default class Root extends React.Component {
});
}
initTablet = async() => {
initTabletNav(args => this.setState(args));
await KeyCommands.setKeyCommands([]);
this.onKeyCommands = KeyCommandsEmitter.addListener(
'onKeyCommand',
command => EventEmitter.emit(KEY_COMMAND, { event: command })
);
}
// initTablet = async() => {
// initTabletNav(args => this.setState(args));
// await KeyCommands.setKeyCommands([]);
// this.onKeyCommands = KeyCommandsEmitter.addListener(
// 'onKeyCommand',
// command => EventEmitter.emit(KEY_COMMAND, { event: command })
// );
// }
initCrashReport = () => {
RocketChat.getAllowCrashReport()
@ -163,23 +164,23 @@ export default class Root extends React.Component {
let content = <AppContainer />;
if (isTablet) {
const { inside, showModal } = this.state;
content = (
<SplitContext.Provider value={{ split }}>
<Tablet
theme={theme}
tablet={split}
inside={inside}
showModal={showModal}
closeModal={this.closeModal}
onLayout={this.onLayout}
>
{content}
</Tablet>
</SplitContext.Provider>
);
}
// if (isTablet) {
// const { inside, showModal } = this.state;
// content = (
// <SplitContext.Provider value={{ split }}>
// <Tablet
// theme={theme}
// tablet={split}
// inside={inside}
// showModal={showModal}
// closeModal={this.closeModal}
// onLayout={this.onLayout}
// >
// {content}
// </Tablet>
// </SplitContext.Provider>
// );
// }
return (
<AppearanceProvider>
<Provider store={store}>

View File

@ -7,7 +7,9 @@ import moment from 'moment';
import 'moment/min/locales';
import * as types from '../actions/actionsTypes';
import { appStart, ROOT_SET_USERNAME, ROOT_INSIDE, ROOT_LOADING, ROOT_OUTSIDE } from '../actions/app';
import {
appStart, ROOT_SET_USERNAME, ROOT_INSIDE, ROOT_LOADING, ROOT_OUTSIDE
} from '../actions/app';
import { serverFinishAdd, selectServerRequest } from '../actions/server';
import {
loginFailure, loginSuccess, setUser, logout

View File

@ -1,5 +1,4 @@
import React, { useState, useContext } from 'react';
import { View } from 'react-native';
import React, { useContext } from 'react';
import PropTypes from 'prop-types';
import { NavigationContainer } from '@react-navigation/native';
import { AppearanceProvider } from 'react-native-appearance';

View File

@ -10,7 +10,7 @@ import StatusBar from '../containers/StatusBar';
import ActivityIndicator from '../containers/ActivityIndicator';
import { withTheme } from '../theme';
import debounce from '../utils/debounce';
import { LegalButton, CloseModalButton } from '../containers/HeaderButton';
import { CloseModalButton } from '../containers/HeaderButton';
const userAgent = isIOS
? 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1'

View File

@ -6,7 +6,6 @@ import {
import RNUserDefaults from 'rn-user-defaults';
import I18n from '../i18n';
import { themedHeader } from '../utils/navigation';
import { withTheme } from '../theme';
import { themes } from '../constants/colors';
import sharedStyles from './Styles';

View File

@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
import { StyleSheet } from 'react-native';
import { HeaderBackButton } from '@react-navigation/stack';
import { isIOS } from '../../../utils/deviceInfo';
import { themes } from '../../../constants/colors';
import Avatar from '../../../containers/Avatar';

View File

@ -4,7 +4,6 @@ import { StyleSheet, Switch, ScrollView } from 'react-native';
import { connect } from 'react-redux';
import I18n from '../i18n';
import { themedHeader } from '../utils/navigation';
import { withTheme } from '../theme';
import { themes, SWITCH_TRACK_COLOR } from '../constants/colors';
import StatusBar from '../containers/StatusBar';

View File

@ -6,7 +6,6 @@ import {
import RNUserDefaults from 'rn-user-defaults';
import I18n from '../i18n';
import { themedHeader } from '../utils/navigation';
import { withTheme } from '../theme';
import { themes } from '../constants/colors';
import sharedStyles from './Styles';

View File

@ -1,6 +1,6 @@
import React from 'react';
import { ScrollView, View, StyleSheet } from 'react-native';
import { HeaderBackButton } from 'react-navigation-stack';
import { HeaderBackButton } from '@react-navigation/stack';
import HeaderComponent from '../../app/views/RoomView/Header/Header';
// import { CustomHeaderButtons, Item } from '../../app/containers/HeaderButton';