-
Notifications
You must be signed in to change notification settings - Fork 3.7k
feat: date range filter UI and year picker fix (#81501) #85313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
1af8655
b81c113
38bf708
66ac605
81ae58c
237f56a
8fcd18d
bb90c1b
b57910a
f3af178
d854556
31921ca
ebb6b78
f260778
a460410
3340968
a583502
44f6975
b1cd093
ec9cf5e
360401e
4bfe962
2abd500
a02f4a0
5495b77
e7821fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,6 +2,7 @@ import React from 'react'; | |||||
| import {View} from 'react-native'; | ||||||
| import Text from '@components/Text'; | ||||||
| import useStyleUtils from '@hooks/useStyleUtils'; | ||||||
| import useTheme from '@hooks/useTheme'; | ||||||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||||||
| import getButtonState from '@libs/getButtonState'; | ||||||
|
|
||||||
|
|
@@ -23,17 +24,35 @@ type DayProps = { | |||||
| }; | ||||||
|
|
||||||
| function Day({disabled, selected, pressed, hovered, children}: DayProps) { | ||||||
| const theme = useTheme(); | ||||||
| const themeStyles = useThemeStyles(); | ||||||
| const StyleUtils = useStyleUtils(); | ||||||
| return ( | ||||||
| <View | ||||||
| // Prevent Android from flattening this View, which can cause | ||||||
| // background color changes (day selection) to not trigger a native repaint. | ||||||
| collapsable={false} | ||||||
| style={[ | ||||||
| themeStyles.calendarDayContainer, | ||||||
| selected ? themeStyles.buttonDefaultBG : {}, | ||||||
| !disabled ? StyleUtils.getButtonBackgroundColorStyle(getButtonState(hovered, pressed)) : {}, | ||||||
| // Always provide an explicit backgroundColor so Android (which | ||||||
| // does not reset a property when the style changes to {}) | ||||||
| // correctly transitions the selection highlight on every render. | ||||||
| {backgroundColor: selected ? theme.success : 'transparent'}, | ||||||
|
||||||
| {backgroundColor: selected ? theme.success : 'transparent'}, | |
| {backgroundColor: selected ? theme.success : theme.transparent}, |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| import React, {useEffect, useMemo, useState} from 'react'; | ||
| import {Keyboard} from 'react-native'; | ||
| import {Keyboard, Platform} from 'react-native'; | ||
| import HeaderWithBackButton from '@components/HeaderWithBackButton'; | ||
| import Modal from '@components/Modal'; | ||
| import ScreenWrapper from '@components/ScreenWrapper'; | ||
|
|
@@ -54,6 +54,7 @@ function YearPickerModal({isVisible, years, currentYear = new Date().getFullYear | |
| headerMessage, | ||
| maxLength: 4, | ||
| inputMode: CONST.INPUT_MODE.NUMERIC, | ||
| disableAutoFocus: Platform.OS === CONST.PLATFORM.ANDROID, | ||
|
||
| }), | ||
| [headerMessage, searchText, translate], | ||
| ); | ||
|
|
@@ -73,6 +74,7 @@ function YearPickerModal({isVisible, years, currentYear = new Date().getFullYear | |
| style={[styles.pb0]} | ||
| includePaddingTop={false} | ||
| enableEdgeToEdgeBottomSafeAreaPadding | ||
| shouldEnablePickerAvoiding={false} | ||
| testID="YearPickerModal" | ||
| > | ||
| <HeaderWithBackButton | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this isn't required, inline styles for backgroundColor and text color are enough.