From 334b1bad7b686f065d351d17b4844511d4b1e187 Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Thu, 17 Mar 2022 17:21:19 -0400 Subject: [PATCH] Chore: Evaluate BackgroundContainer - TypeScript (#3917) * update: `BackgroundContainer` * remove: `theme` from `IBackgroundContainer` * update: return type for `BackgroundContainer` --- app/containers/BackgroundContainer/index.tsx | 22 +++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/app/containers/BackgroundContainer/index.tsx b/app/containers/BackgroundContainer/index.tsx index a485611c..c9fc70d5 100644 --- a/app/containers/BackgroundContainer/index.tsx +++ b/app/containers/BackgroundContainer/index.tsx @@ -1,13 +1,12 @@ import React from 'react'; import { ActivityIndicator, ImageBackground, StyleSheet, Text, View } from 'react-native'; -import { withTheme } from '../../theme'; +import { useTheme } from '../../theme'; import sharedStyles from '../../views/Styles'; import { themes } from '../../constants/colors'; interface IBackgroundContainer { text?: string; - theme?: string; loading?: boolean; } @@ -32,12 +31,15 @@ const styles = StyleSheet.create({ } }); -const BackgroundContainer = ({ theme, text, loading }: IBackgroundContainer) => ( - - - {text && !loading ? {text} : null} - {loading ? : null} - -); +const BackgroundContainer = ({ text, loading }: IBackgroundContainer): React.ReactElement => { + const { theme } = useTheme(); + return ( + + + {text && !loading ? {text} : null} + {loading ? : null} + + ); +}; -export default withTheme(BackgroundContainer); +export default BackgroundContainer;