diff --git a/StartPlan.tsx b/StartPlan.tsx index 24c3e3b..9d5b89e 100644 --- a/StartPlan.tsx +++ b/StartPlan.tsx @@ -42,7 +42,7 @@ export default function StartPlan() { .join(',') console.log({questions, workouts}) const select = ` - SELECT workouts.name, COUNT(sets.id) as total + SELECT workouts.name, COUNT(sets.id) as total, sets.sets FROM (select 0 as name, 0 as sequence union values ${questions}) as workouts LEFT JOIN sets ON sets.name = workouts.name AND sets.created LIKE STRFTIME('%Y-%m-%d%%', 'now', 'localtime') diff --git a/StartPlanItem.tsx b/StartPlanItem.tsx index 4b97e50..1c0c6dd 100644 --- a/StartPlanItem.tsx +++ b/StartPlanItem.tsx @@ -1,7 +1,14 @@ import {NavigationProp, useNavigation} from '@react-navigation/native' import React, {useCallback, useState} from 'react' import {GestureResponderEvent, ListRenderItemInfo, View} from 'react-native' -import {List, Menu, RadioButton, useTheme} from 'react-native-paper' +import { + List, + Menu, + ProgressBar, + RadioButton, + Text, + useTheme, +} from 'react-native-paper' import {Like} from 'typeorm' import CountMany from './count-many' import {getNow, setRepo} from './db' @@ -66,7 +73,9 @@ export default function StartPlanItem(props: Props) { onSelect(index)} left={() => ( @@ -79,7 +88,12 @@ export default function StartPlanItem(props: Props) { )} right={() => ( - <> + + {item.sets > 0 && } - + )} /> )