diff --git a/app/src/screens/History.tsx b/app/src/screens/History.tsx index 1a17ef5..0cdbf5c 100644 --- a/app/src/screens/History.tsx +++ b/app/src/screens/History.tsx @@ -1,25 +1,23 @@ import { useNavigation } from '@react-navigation/native'; import { Text } from '@shadcn/components'; +import { iconWithClassName } from '@shadcn/icons/iconWithClassName'; import { Collections, Screens, Stacks, fireAuth, fireStore } from '@src/constants'; import type { HistoryActivity } from '@src/types'; import type { AppNavigation } from '@src/types'; import { collection, doc, getDocs, updateDoc } from 'firebase/firestore'; -import { UserIcon } from 'lucide-react-native'; +import { Brain, Heart, House, PenLine, RefreshCw, UserIcon } from 'lucide-react-native'; import React, { useEffect } from 'react'; import { useAuthState } from 'react-firebase-hooks/auth'; import { Image, ScrollView, TouchableOpacity, View } from 'react-native'; -import FeatherIcon from 'react-native-vector-icons/Feather'; -import type { IconProps } from 'react-native-vector-icons/Icon'; -import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'; + +iconWithClassName(PenLine); +iconWithClassName(RefreshCw); export const History: React.FC = () => { const { navigate } = useNavigation(); const [user] = useAuthState(fireAuth); const [activeTab, setActiveTab] = React.useState<'all' | 'favorites'>('all'); - const [items, setItems] = React.useState([] as HistoryActivity[]); - - const MCIIcon = MaterialCommunityIcons as unknown as React.FC; - const FeatherIconCasted = FeatherIcon as unknown as React.FC; + const [items, setItems] = React.useState([]); const fetchFavoriteActivities = async () => { if (!user) { @@ -104,11 +102,7 @@ export const History: React.FC = () => { }; // Decide which items to show based on activeTab - const itemsToShow = - activeTab === 'all' ? items : items.filter((item) => item.isFavourite === true); - - // Icon color - const iconColor = '#620674'; + const itemsToShow = activeTab === 'all' ? items : items.filter((item) => item.isFavourite); return ( @@ -125,7 +119,7 @@ export const History: React.FC = () => { - + @@ -179,23 +173,22 @@ export const History: React.FC = () => { handleToggleFavourite(item.id)}> {/* If isFavourite = true => heart (filled), else => heart-outline */} - - + {/* Bottom row */} - + replayActivity(item.id)}> - +