diff --git a/app/share.tsx b/app/share.tsx index f347c5ae..7c693391 100644 --- a/app/share.tsx +++ b/app/share.tsx @@ -72,7 +72,7 @@ const OutsideStack = () => { return ( - + ); }; diff --git a/app/views/WithoutServersView.tsx b/app/views/WithoutServersView.tsx index 91cfe131..36222976 100644 --- a/app/views/WithoutServersView.tsx +++ b/app/views/WithoutServersView.tsx @@ -1,12 +1,12 @@ -import React from 'react'; +import React, { useLayoutEffect } from 'react'; import { StyleSheet, Text, View } from 'react-native'; import ShareExtension from 'rn-extensions-share'; +import { useNavigation } from '@react-navigation/native'; import * as HeaderButton from '../containers/HeaderButton'; -import sharedStyles from './Styles'; import I18n from '../i18n'; -import { themes } from '../lib/constants'; -import { TSupportedThemes, withTheme } from '../theme'; +import { useTheme } from '../theme'; +import sharedStyles from './Styles'; const styles = StyleSheet.create({ container: { @@ -26,27 +26,25 @@ const styles = StyleSheet.create({ } }); -interface IWithoutServerViewProps { - theme: TSupportedThemes; -} +const WithoutServerView = (): React.ReactElement => { + const navigation = useNavigation(); + const { colors } = useTheme(); -class WithoutServerView extends React.Component { - static navigationOptions = () => ({ - title: 'Rocket.Chat', - headerLeft: () => - }); + useLayoutEffect(() => { + navigation.setOptions({ + title: 'Rocket.Chat', + headerLeft: () => + }); + }, [navigation]); - render() { - const { theme } = this.props; - return ( - - {I18n.t('Without_Servers')} - - {I18n.t('You_need_to_access_at_least_one_RocketChat_server_to_share_something')} - - - ); - } -} + return ( + + {I18n.t('Without_Servers')} + + {I18n.t('You_need_to_access_at_least_one_RocketChat_server_to_share_something')} + + + ); +}; -export default withTheme(WithoutServerView); +export default WithoutServerView;