web-ridge / react-native-paper-dates

Smooth and fast cross platform Material Design date and time picker for React Native Paper
https://www.reactnativepaperdates.com
MIT License
662 stars 170 forks source link

Dark mode year selector does not use darkmode onSurface or text color for older theme #277

Closed jennifer-dickinson closed 1 year ago

jennifer-dickinson commented 1 year ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch react-native-paper-dates@0.15.1 for the project I'm working on.

I use v2 of the react-native paper theme, and when using dark mode, the year text shows as dark text. Replacing the color value from undefined to either theme.colors.text or theme.colors.onSurface fixes the issue

Dark mode without fix Dark mode with fix
simulator_screenshot_E91662DE-15E1-486D-8878-8F90E26299D9 simulator_screenshot_97DDC140-479A-4F9F-91DE-898BBD851F9F

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-paper-dates/src/Date/YearPicker.tsx b/node_modules/react-native-paper-dates/src/Date/YearPicker.tsx
index 3178557..a4a23d6 100644
--- a/node_modules/react-native-paper-dates/src/Date/YearPicker.tsx
+++ b/node_modules/react-native-paper-dates/src/Date/YearPicker.tsx
@@ -105,7 +105,7 @@ function YearPure({
                 : {
                     color: theme.isV3
                       ? theme.colors.onSurfaceVariant
-                      : undefined,
+                      : theme.colors.onSurface,
                   },
               { ...textFont },
             ]}

This issue body was partially generated by patch-package.

iM-GeeKy commented 1 year ago

Hi @jennifersalas thanks for finding this and providing the fix. I've created https://github.com/web-ridge/react-native-paper-dates/pull/278 and @RichardLindhout will merge it when he's available. Until then, just use the your patch.

iM-GeeKy commented 1 year ago

Closed by https://github.com/web-ridge/react-native-paper-dates/pull/278