Commit Graph

98 Commits

Author SHA1 Message Date
Brandon Presley 1b1bb41ed7 Combine SetForm + EditSet
The abstraction here added more complexity than it saved.
2022-11-30 13:58:56 +13:00
Brandon Presley 5a5253ce82 Add missing margin to plan
Closes #120
2022-11-23 21:51:16 +13:00
Brandon Presley 1d8d7b070e Refresh settings for plan on focus
Closes #118
2022-11-16 17:05:49 +13:00
Brandon Presley b74f77e506 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.
2022-11-14 14:19:41 +13:00
Brandon Presley 6b74b5114c Move progress bar to bottom of StartPlan 2022-11-14 11:35:09 +13:00
Brandon Presley f66c180768 Ensure timers don't run when alarms are disabled 2022-11-12 18:22:58 +13:00
Brandon Presley 3a718142e5 Add progress bar to plan items
Deploy this after using it for a day
(on Sunday NZ time).
2022-11-12 18:19:39 +13:00
Brandon Presley c70e9f5c69 Remove blocking toasts from StartPlan
Some of these weren't extra information
and would happen too often. Toasts should
be rare and informational.
2022-11-12 17:26:38 +13:00
Brandon Presley bfa7518e40 Remove unused variables in StartPlan 2022-11-10 15:16:32 +13:00
Brandon Presley dc73035607 Add progress bar for rest timer in StartPlan 2022-11-10 15:15:27 +13:00
Brandon Presley 2e5edb741e Fix linting issue in StartPlan 2022-11-02 15:40:25 +13:00
Brandon Presley 2aaaac1929 Fix sets added by plan not showing image 2022-11-02 14:41:30 +13:00
Brandon Presley 3bf2193d46 Remove needless double negation in StartPlan
We used to store the numbers as sqlite presented
the booleans, but now TypeOrm automatically converts
it into bools for us so we don't need to.
2022-11-02 12:43:01 +13:00
Brandon Presley 31f1528c35 Replace settings context with theme context
The settings context was having a big performance
impact on the app. We only truly need the theme + color
to be a global context.
2022-11-01 16:50:03 +13:00
Brandon Presley 49b5eb48c6 Refactor MassiveSnack
Instead of using a context for the whole app
use DeviceEventEmitter with root state.
This will probably improve performance,
since I think the react context was
re-rendering the entire DOM tree.
2022-11-01 15:55:37 +13:00
Brandon Presley 3c4bba3f85 Fix infinite refreshing on first load of StartPlan 2022-11-01 12:29:54 +13:00
Brandon Presley bdb27894f7 Optimize root context 2022-10-31 21:00:10 +13:00
Brandon Presley bc7aca03e8 Remove semicolons from line endings 2022-10-31 17:22:08 +13:00
Brandon Presley e7321b6d8e Add typeorm migrations 2022-10-31 17:05:31 +13:00
Brandon Presley b7f1c2192e Pause converting to typeorm due to odd error
ERROR  TypeError: Cannot read property 'getItem' of undefined

This error is located at:
    in FlatList (created by SetList)
    in RCTView (created by View)
    in View (created by Page)
    in Page (created by SetList)
    in SetList (created by SceneView)
...

I found an open issue on the react-native github which seems
related https://github.com/facebook/react-native/issues/31523
but after following all of their suggestions I still have the
same error. I tried:
- Removing @babel/plugin-proposal-class-properties & @babel/plugin-transform-flow-strip-types
- Adding @babel/plugin-transform-flow-strip-types
2022-10-31 13:20:36 +13:00
Brandon Presley e0da621198 Add undo feature to StartPlan 2022-10-30 15:34:17 +13:00
Brandon Presley e33ff1172a Factor out StartPlanItem 2022-10-30 15:23:22 +13:00
Brandon Presley 2ae9d2a4c1 Improve performance of StartPlan 2022-10-30 14:46:32 +13:00
Brandon Presley eba33c2599 Revert "Revert "Optimize query in StartPlan""
This reverts commit 129b00dc5d.
2022-10-30 14:27:22 +13:00
Brandon Presley 5fafc6a63a Fix plan starting 2022-10-30 14:08:41 +13:00
Brandon Presley 129b00dc5d Revert "Optimize query in StartPlan"
This reverts commit 97827c68b2.
2022-10-30 13:42:20 +13:00
Brandon Presley e1a90a98fb Fix crashing of plans 2022-10-30 13:15:31 +13:00
Brandon Presley 6e75614d10 Add basic working unit tests 2022-10-30 12:56:58 +13:00
Brandon Presley e6dcd4a47e Use hermes engine
https://reactnative.dev/docs/hermes
2022-10-28 18:36:47 +13:00
Brandon Presley 4735b1589b Fix selection for plan starting
Old selection index was based on `workouts`
new one is based on the `counts`.
2022-10-27 10:07:02 +13:00
Brandon Presley cd602cee33 Cast plan description to string
If it's a number, then zero doesn't display
probably because the library is checking for
truthy.
2022-10-27 10:00:47 +13:00
Brandon Presley 97827c68b2 Optimize query in StartPlan
Closes #98
2022-10-26 18:31:40 +13:00
Brandon Presley 80b1a1ef56 Fix single views for new custom headers 2022-10-23 19:13:58 +13:00
Brandon Presley ae947d5405 Wait for data before displaying workouts on plans
Closes #92
2022-10-16 17:20:13 +13:00
Brandon Presley 6238b47e6a Fix plan not activating on radio button press
If you touched the radio button instead of the workout
item itself, it wouldn't toggle.
2022-10-16 16:57:23 +13:00
Brandon Presley 77db34b310 Add toggle for hiding maximum set count
Closes #90
2022-10-16 16:54:20 +13:00
Brandon Presley 3714db438e Fix max number of sets for plan
Previously we were trying to get the max # of sets
from our query on the number of sets completed for today.
This meant if we hadn't completed any sets today, we would
get no result for that workout.
2022-10-16 16:46:38 +13:00
Brandon Presley f078ede58a Get max sets for each workout in plan
Closes #91
2022-10-16 16:08:38 +13:00
Brandon Presley 2fd9635e40 Add new record notification to plan 2022-10-16 14:38:01 +13:00
Brandon Presley 6d29ac09be Remove auto focus on reps for starting a plan
Doesn't feel right to open the reps immediately on
a page with so much content. The keyboard hides some of the
stuff on the bottom. Also I find myself opening a plan up just
to see what's on that day rather than editing right away.
2022-10-15 11:14:02 +13:00
Brandon Presley 46f0875497 Create useSnackbar custom hook 2022-10-14 17:27:19 +13:00
Brandon Presley 8461f86e88 Wrap color context with useColor custom hook
I find it easier to import hooks by useX instead of
useContext(X). Like how the navigation library is just
useNavigation
2022-10-14 17:24:02 +13:00
Brandon Presley 2782d34a05 Use custom theme color for radio buttons 2022-10-14 17:06:23 +13:00
Brandon Presley b6665ed4b5 Use radio button for workouts on a plan 2022-10-14 16:55:12 +13:00
Brandon Presley ca09613d9b Include set image when adding a set from plan
If a user has set an image for a workout, then adding
a set should include it's image.
2022-10-12 17:17:47 +13:00
Brandon Presley 3b0391310b Visually select first workout in plan by default 2022-10-12 17:17:28 +13:00
Brandon Presley 5901722f22 Use flat list instead of chips for workouts 2022-10-12 14:51:30 +13:00
Brandon Presley e0b84af9e7 Move sessions page functionality onto Plan page
The sessions page mostly copied the exact same features as Plans,
which would confuse the user.
2022-10-12 14:07:48 +13:00