From 09fdc15f38f70983edce5373ecfc592a295fe2e6 Mon Sep 17 00:00:00 2001 From: Pham Ngoc Thach Date: Fri, 8 Dec 2023 14:42:52 +0700 Subject: [PATCH] Use SafeAreaView --- src/components/connectstatus/index.tsx | 32 ++++++++++++++------------ 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/components/connectstatus/index.tsx b/src/components/connectstatus/index.tsx index ef77f3e..4f036f0 100644 --- a/src/components/connectstatus/index.tsx +++ b/src/components/connectstatus/index.tsx @@ -3,7 +3,7 @@ import {useTranslation} from 'react-i18next'; import {View} from 'react-native'; import {NetworkConsumer} from 'react-native-offline'; import {Text, useTheme} from 'react-native-paper'; -import {useSafeAreaPaddingTop} from 'theme/styles'; +import {SafeAreaView} from 'react-native-safe-area-context'; /** * Connect Status @@ -11,23 +11,25 @@ import {useSafeAreaPaddingTop} from 'theme/styles'; const ConnectStatus = () => { const {t} = useTranslation(); const {colors} = useTheme(); - const safeInsets = useSafeAreaPaddingTop(); - const box = { - backgroundColor: colors.error, + const errorBox = { + backgroundColor: colors.errorContainer, + }; + const errorBoxText = { + color: colors.onErrorContainer, }; return ( - - {({isConnected}) => - isConnected ? ( - - ) : ( - - {t('no-internet-connection')} - - ) - } - + + + {({isConnected}) => + !isConnected && ( + + {t('no-internet-connection')} + + ) + } + + ); };