Skip to content

Commit

Permalink
Support tree species image url
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapawar1 committed Dec 7, 2024
1 parent b35442f commit d9bc505
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/screens/TreeInfo/TreeInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default function TreeInfoPage({ route }: TreeInfoPageProps) {
const [treeData, setTreeData] = useState<Tree>({
tree_id: treeId,
});
const treeBgImage = treeData.species?.image_link;

useEffect(() => {
(async () => {
Expand All @@ -46,7 +47,7 @@ export default function TreeInfoPage({ route }: TreeInfoPageProps) {
>
<ScrollView style={styles.container}>
<ImageBackground
source={TreeBg}
source={treeBgImage ? { uri: treeBgImage } : TreeBg}
style={styles.imageBg}
></ImageBackground>
<View style={styles.body}>
Expand Down

0 comments on commit d9bc505

Please sign in to comment.