From b74f77e5063b13ea2c62cc779d6c22283984dc3d Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Mon, 14 Nov 2022 14:19:41 +1300 Subject: [PATCH] Replace progress bar with toast in plan It doesn't feel obvious enough when a new set has been added with the progress bar + number incrementing. I frequently found myself double-checking I had actually submitted a new set. --- StartPlan.tsx | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/StartPlan.tsx b/StartPlan.tsx index b9eba7a..0cb0863 100644 --- a/StartPlan.tsx +++ b/StartPlan.tsx @@ -2,9 +2,9 @@ import {RouteProp, useRoute} from '@react-navigation/native' import {useCallback, useEffect, useMemo, useRef, useState} from 'react' import {NativeModules, TextInput, View} from 'react-native' import {FlatList} from 'react-native-gesture-handler' -import {Button, ProgressBar} from 'react-native-paper' +import {Button} from 'react-native-paper' import {getBestSet} from './best.service' -import {MARGIN, PADDING} from './constants' +import {PADDING} from './constants' import CountMany from './count-many' import {AppDataSource} from './data-source' import {getNow, setRepo, settingsRepo} from './db' @@ -99,6 +99,7 @@ export default function StartPlan() { (+weight > best.weight || (+reps > best.reps && +weight === best.weight)) ) toast("Great work King! That's a new record.") + else toast('Set added.') if (!settings.alarm) return const milliseconds = Number(best.minutes) * 60 * 1000 + Number(best.seconds) * 1000 @@ -113,11 +114,6 @@ export default function StartPlan() { toast('Commas and single quotes would break CSV exports') }, []) - const progress = useMemo(() => { - if (!counts || !counts[selected].sets) return - return counts[selected].total / (counts[selected].sets ?? 1) - }, [counts, selected]) - return ( <> @@ -165,9 +161,6 @@ export default function StartPlan() { /> )} - {progress && ( - - )}