diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index fa26aa56e1c14..6dc098f4797a0 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -3,6 +3,6 @@ xmlns:tools="http://schemas.android.com/tools"> - + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index cefe08dd125c2..5f8a5ca5adbb8 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -2,6 +2,7 @@ package="com.expensifyreactnative.chat"> + { + setNewOfflineStatus(!state.isConnected); +}); + /** * Events that happen on the pusher socket are used to determine if the app is online or offline. The offline setting * is stored in Ion so the rest of the app has access to it. diff --git a/src/page/HomePage/SidebarView.js b/src/page/HomePage/SidebarView.js index 0182598161797..f7edc1510594b 100644 --- a/src/page/HomePage/SidebarView.js +++ b/src/page/HomePage/SidebarView.js @@ -76,6 +76,10 @@ class SidebarView extends React.Component { render() { const reports = this.props.reports; this.updateUnreadReportIndicator(); + const indicatorStyles = [ + styles.statusIndicator, + this.props.isOffline ? styles.statusIndicatorOffline : styles.statusIndicatorOnline + ]; return ( @@ -106,9 +110,7 @@ class SidebarView extends React.Component { source={{uri: this.props.avatarURL}} style={[styles.historyItemAvatar]} /> - {this.props.isOffline && ( - - )} + {this.props.userDisplayName && ( diff --git a/src/style/StyleSheet.js b/src/style/StyleSheet.js index e8f69dda85360..53b6f60012dc5 100644 --- a/src/style/StyleSheet.js +++ b/src/style/StyleSheet.js @@ -233,7 +233,6 @@ const styles = { }, statusIndicator: { - backgroundColor: colors.icon, borderColor: colors.heading, borderRadius: 7, borderWidth: 2, @@ -245,6 +244,14 @@ const styles = { zIndex: 10, }, + statusIndicatorOnline: { + backgroundColor: colors.green, + }, + + statusIndicatorOffline: { + backgroundColor: colors.icon, + }, + sidebarFooterUsername: { color: '#FFFFFF', fontSize: 15, diff --git a/webpack.common.js b/webpack.common.js index 3f2e400c021d5..979dcb1c50d04 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -69,5 +69,9 @@ module.exports = { 'react-native-config': 'react-web-config', 'react-native$': 'react-native-web', }, + + // React Native libraries may have web-specific module implementations that appear with the extension `.web.js` + // without this, web will try to use native implementations and break in not very obvious ways + extensions: ['.web.js', '.js'], }, };