From fdbbec3e1181c68ee647221189bf3d4fe9eccdd5 Mon Sep 17 00:00:00 2001 From: Xc165543337 <90028194+Xc165543337@users.noreply.github.com> Date: Thu, 23 May 2024 13:22:02 +0200 Subject: [PATCH] feat: numeric habit progress with icon --- .../react-native/components/HabitProgress.tsx | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/presentation/react-native/components/HabitProgress.tsx b/presentation/react-native/components/HabitProgress.tsx index ecf8611..c834f35 100644 --- a/presentation/react-native/components/HabitProgress.tsx +++ b/presentation/react-native/components/HabitProgress.tsx @@ -2,6 +2,8 @@ import { useState } from "react" import { ScrollView, StyleSheet, View } from "react-native" import { Button, Snackbar, Text, TextInput } from "react-native-paper" import { SafeAreaView } from "react-native-safe-area-context" +import type { IconName } from "@fortawesome/free-solid-svg-icons" +import { FontAwesomeIcon } from "@fortawesome/react-native-fontawesome" import type { GoalNumeric } from "@/domain/entities/Goal" import { GoalNumericProgress } from "@/domain/entities/Goal" @@ -66,15 +68,34 @@ export const HabitProgress: React.FC<HabitProgressProps> = ({ paddingHorizontal: 20, }} > - <Text + <View style={{ - fontWeight: "bold", - fontSize: 28, - textAlign: "center", + flexDirection: "row", + justifyContent: "center", + alignItems: "center", + gap: 15, }} > - {habitHistory.habit.name} - </Text> + <FontAwesomeIcon + size={24} + icon={habitHistory.habit.icon as IconName} + style={[ + { + width: 30, + }, + ]} + /> + + <Text + style={{ + fontWeight: "bold", + fontSize: 28, + textAlign: "center", + }} + > + {habitHistory.habit.name} + </Text> + </View> <Text style={{ -- GitLab