diff --git a/components/stats/Widget.tsx b/components/stats/Widget.tsx index f4e3e0b..182def4 100644 --- a/components/stats/Widget.tsx +++ b/components/stats/Widget.tsx @@ -1,5 +1,5 @@ import React, { ReactNode } from 'react'; -import { View, StyleSheet, Text, Image } from 'react-native'; // Add the missing import statement for Image +import { View, StyleSheet, Text, Image } from 'react-native'; import { useTheme } from '../../app/contexts/ThemeContext'; interface WidgetProps { @@ -7,14 +7,17 @@ interface WidgetProps { text?: string; children?: ReactNode; image?: any; + backgroundColor?: string; } -const Widget: React.FC = ({ title, text, children, image }) => { // Add the 'image' prop to the destructuring +const Widget: React.FC = ({ title, text, children, image, backgroundColor }) => { const { colors } = useTheme(); + const actualBackgroundColor = backgroundColor ? backgroundColor : colors.widgetBackgroundColor; + const styles = StyleSheet.create({ widgetContainer: { - backgroundColor: colors.widgetBackgroundColor, + backgroundColor: actualBackgroundColor, borderColor: colors.widgetBorderColor, borderRadius: 5, padding: 16,