Skip to content

Commit

Permalink
feat(mobile): add dev tool handshake in debug mode
Browse files Browse the repository at this point in the history
Signed-off-by: Sacha Froment <sfroment42@gmail.com>
  • Loading branch information
sfroment committed Feb 7, 2019
1 parent 51031cd commit adb5cd4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion client/react-native/common/components/Screens/Chats/List.js
@@ -1,5 +1,5 @@
import React, { PureComponent } from 'react'
import { View } from 'react-native'
import { View, Platform } from 'react-native'
import {
Avatar,
EmptyList,
Expand All @@ -19,6 +19,7 @@ import { conversation as utils } from '../../../utils'
import { withNamespaces } from 'react-i18next'
import I18n from 'i18next'
import { hook } from 'cavy'
/* global __DEV__ */

const Message = withNamespaces()(({ data, t, ...props }) => {
switch (data.kind) {
Expand Down Expand Up @@ -183,6 +184,15 @@ const ItemBase = fragments.Conversation(
const Item = withNamespaces()(ItemBase)

class ListScreen extends PureComponent {
constructor (props) {
super(props)

if (Platform.OS !== 'web' && __DEV__) {
const DevMenu = require('react-native-dev-menu')
DevMenu.addItem('Dev tools', () => this.props.navigation.navigate('settings/devtools'))
}
}

static navigationOptions = ({ navigation }) => ({
header: (
<Header
Expand Down

0 comments on commit adb5cd4

Please sign in to comment.