Commit Graph

66 Commits

Author SHA1 Message Date
Brandon Presley dc27ae9868 Split up dark and light color settings
Previously it was possible to choose a color combination
that was almost impossible to read (due to contrast).
Now we have prevented this from happening, as well as
giving the user more customizability.
2022-11-26 13:15:12 +13:00
Brandon Presley 89edc661a4 Replace addColumn with query in add-color
Fixes #106
2022-11-15 17:36:01 +13:00
Brandon Presley 1e88a98353 Get color setting when changing system theme 2022-11-04 18:34:41 +13:00
Brandon Presley fcce1ad9ef Add native events to communicate the running timer
Closes #99
2022-11-03 20:04:15 +13:00
Brandon Presley 8835a3efd3 Prevent double initializing typeorm
App is re-mounted when the system theme is changed,
but the connection to the sqlite database stays active.
This means the previous code would fail to initialize
and then be a blank screen.
Closes #107
2022-11-02 15:37:32 +13:00
Brandon Presley 187a0fbc68 Only initialize typeorm if uninitialized 2022-11-02 15:22:57 +13:00
Brandon Presley 156f1fc33f Fix button color on snackbars 2022-11-02 13:39:51 +13:00
Brandon Presley 0ed3b9817c Add lighter purple color option 2022-11-02 12:36:48 +13:00
Brandon Presley 0a2e0086b3 Add import React to App.tsx
Paper seemed to complain about it for some reason.
I thought one of the parts of using Hermes meant
I didn't need to import React?
2022-11-01 19:59:48 +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 8d7fe149f5 Remove unused code 2022-11-01 16:11:39 +13:00
Brandon Presley 139d75493e Memoize action in App.tsx 2022-11-01 16:08:02 +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 1a53fa324b Remove redundant Color context
Settings already stores the color set by the user.
2022-10-31 21:32:33 +13:00
Brandon Presley bdb27894f7 Optimize root context 2022-10-31 21:00:10 +13:00
Brandon Presley eafad1f47e Simplify migrations in App.tsx 2022-10-31 18:16:11 +13:00
Brandon Presley bc7aca03e8 Remove semicolons from line endings 2022-10-31 17:22:08 +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 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 36e6637ba2 Revert "Revert "Add custom app bar""
This reverts commit e84dd7bdea.
2022-10-23 12:35:58 +13:00
Brandon Presley e84dd7bdea Revert "Add custom app bar"
This reverts commit a664b65ce2.
2022-10-23 12:32:44 +13:00
Brandon Presley a664b65ce2 Add custom app bar
The header bar provided by react-navigation was jumping on first
load, whereas this custom one doesn't.
2022-10-23 12:24:39 +13:00
Brandon Presley c73937396e Fix defaults for freshly installed app
Closes #95
2022-10-18 21:43:46 +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 eb53d58991 Add ability to set app theme
Closes #79
2022-10-04 14:35:56 +13:00
Brandon Presley f242f54078 Use Material icons instead of ionic icons
Some of our other icons were already Material design,
so these Ionic icons looked out of place.
2022-09-27 12:45:13 +13:00
Brandon Presley 2fb0503882 Make sure hex colors are always upper case 2022-09-27 12:19:19 +13:00
Brandon Presley acfd0e698d Minor refactors and renaming 2022-09-25 17:49:26 +13:00
Brandon Presley 39fafa353f Split out some type definitions into their own files 2022-09-24 18:47:31 +12:00
Brandon Presley 7feb98f7ce Make fab text black when primary color is cyan 2022-09-24 15:59:52 +12:00
Brandon Presley e516cdfdc0 Add ability to customize primary color
Closes #40
2022-09-24 13:57:51 +12:00
Brandon Presley 567bf182b4 Change toasts based on context of settings
The messages should explain what you have now changed
rather than the setting itself.
2022-09-11 15:35:20 +12:00
Brandon Presley 756a2089e9 Prevent race condition with database migrations 2022-08-30 23:21:25 +12:00
Brandon Presley f6dec0c3b2 Add images to sets 2022-08-28 20:55:12 +12:00
Brandon Presley 391f0e3c71 Fix app not loading on first install 2022-08-28 17:24:21 +12:00
Brandon Presley 4967cbf728 Disable new record notifications by default 2022-08-27 18:08:23 +12:00
Brandon Presley c636b3c802 Use dark color for snackbar on dark theme 2022-08-27 17:14:35 +12:00
Brandon Presley e8109ce871 Make background slightly darker 2022-08-27 16:15:24 +12:00
Brandon Presley cf55711ae3 Fix status bar not being dark on light mode 2022-08-27 13:40:16 +12:00
Brandon Presley 23d8c91c69 Add workouts page
The workouts page can be used to add a new type of workout,
or to edit the name of an already existing one.
Closes #1.
2022-08-26 15:10:28 +12:00
Brandon Presley fd38439756 Change color scheme 2022-08-26 13:54:51 +12:00
Brandon Presley 48d4d59ac8 Add ability to choose alarm sound
Closes #5
2022-08-25 20:41:15 +12:00
Brandon Presley 2c9242b03f Use react-native-paper snackbar instead of ToastAndroid 2022-08-25 13:01:01 +12:00
Brandon Presley 75b71b5851 Replace usage of react-native-async-storage with sqlite 2022-08-24 12:01:39 +12:00
Brandon Presley 4c185f0346 Add vibration setting for timers 2022-08-20 16:37:59 +12:00
Brandon Presley bdd712833c Reduce number of colors in theme 2022-07-15 18:06:33 +12:00
Brandon Presley a78a22207a Split out routes 2022-07-15 16:34:06 +12:00
Brandon Presley 87ed70155f Use stats-chart icon for Best 2022-07-11 13:06:26 +12:00
Brandon Presley e72cdc8db7 Make plans use stack navigation 2022-07-11 12:28:30 +12:00