1
1
mirror of https://github.com/theoludwig/p61-project.git synced 2024-07-17 07:00:12 +02:00

feat: numeric habit progress with icon

This commit is contained in:
Xc165543337 2024-05-23 13:22:02 +02:00
parent 89aab00e6e
commit fdbbec3e11

View File

@ -2,6 +2,8 @@ import { useState } from "react"
import { ScrollView, StyleSheet, View } from "react-native" import { ScrollView, StyleSheet, View } from "react-native"
import { Button, Snackbar, Text, TextInput } from "react-native-paper" import { Button, Snackbar, Text, TextInput } from "react-native-paper"
import { SafeAreaView } from "react-native-safe-area-context" 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 type { GoalNumeric } from "@/domain/entities/Goal"
import { GoalNumericProgress } from "@/domain/entities/Goal" import { GoalNumericProgress } from "@/domain/entities/Goal"
@ -66,15 +68,34 @@ export const HabitProgress: React.FC<HabitProgressProps> = ({
paddingHorizontal: 20, paddingHorizontal: 20,
}} }}
> >
<Text <View
style={{ style={{
fontWeight: "bold", flexDirection: "row",
fontSize: 28, justifyContent: "center",
textAlign: "center", alignItems: "center",
gap: 15,
}} }}
> >
{habitHistory.habit.name} <FontAwesomeIcon
</Text> 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 <Text
style={{ style={{