fix: image not shown
This commit is contained in:
parent
62e71d1b49
commit
a51dee6795
2 changed files with 3 additions and 3 deletions
|
|
@ -53,7 +53,7 @@ export default function Page() {
|
||||||
<Widget>
|
<Widget>
|
||||||
<BudgetRemaining budget={budget} spent={spent} />
|
<BudgetRemaining budget={budget} spent={spent} />
|
||||||
</Widget>
|
</Widget>
|
||||||
<Widget text='#TODO Insert Pie-Chart' image='../../../assets/images/8b14el.jpg'/>
|
<Widget text='#TODO Insert Pie-Chart' image={require('../../../assets/images/8b14el.jpg')}/>
|
||||||
<Widget>
|
<Widget>
|
||||||
<BudgetOverview budget={budget} spent={spent} />
|
<BudgetOverview budget={budget} spent={spent} />
|
||||||
</Widget>
|
</Widget>
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ interface WidgetProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
text?: string;
|
text?: string;
|
||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
image?: string;
|
image?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Widget: React.FC<WidgetProps> = ({ title, text, children, image }) => { // Add the 'image' prop to the destructuring
|
const Widget: React.FC<WidgetProps> = ({ title, text, children, image }) => { // Add the 'image' prop to the destructuring
|
||||||
|
|
@ -54,7 +54,7 @@ const Widget: React.FC<WidgetProps> = ({ title, text, children, image }) => { //
|
||||||
<View style={styles.widgetContainer}>
|
<View style={styles.widgetContainer}>
|
||||||
{!!title && <Text style={styles.widgetTitle}>{title}</Text>}
|
{!!title && <Text style={styles.widgetTitle}>{title}</Text>}
|
||||||
{!!text && <Text style={styles.widgetText}>{text}</Text>}
|
{!!text && <Text style={styles.widgetText}>{text}</Text>}
|
||||||
{!!image && <Image source={{ uri: image }} style={styles.imageStyle} />}
|
{!!image && <Image source={image} style={styles.imageStyle} />}
|
||||||
{children}
|
{children}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Reference in a new issue