docstring_tokens
stringlengths
0
76.5k
code_tokens
stringlengths
75
1.81M
label_window
listlengths
4
2.12k
html_url
stringlengths
74
116
file_name
stringlengths
3
311
return color(this.toolbarDefaultBg).darken(0.2).hex();
<mask> toolbarBtnTextColor: platform === PLATFORM.IOS ? '#007aff' : '#fff', <mask> iosStatusbar: 'dark-content', <mask> toolbarDefaultBorder: platform === PLATFORM.IOS ? '#a7a6ab' : '#3F51B5', <mask> get statusBarColor() { <mask> return color(this.toolbarDefaultBg) <mask> .darken(0.2) <mask> .hex(); <mask> }, <mask> get darkenHeader() { <mask> return color(this.tabBgColor) <mask> .darken(0.03) <mask> .hex(); </s> fix: checkbox fontsize and iconSize changed </s> remove return color(this.toolbarDefaultBg) .darken(0.2) .hex(); </s> add return color(this.toolbarDefaultBg).darken(0.2).hex(); </s> remove return color(this.tabBgColor) .darken(0.03) .hex(); </s> add return color(this.tabBgColor).darken(0.03).hex(); </s> remove return color(this.tabBgColor) .darken(0.03) .hex(); </s> add return color(this.tabBgColor).darken(0.03).hex(); </s> remove CheckboxIconSize: platform === PLATFORM.IOS ? 21 : 16, </s> add CheckboxIconSize: platform === PLATFORM.IOS ? 19 : 16, </s> remove CheckboxIconSize: platform === PLATFORM.IOS ? 21 : 16, </s> add CheckboxIconSize: platform === PLATFORM.IOS ? 19 : 16,
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4a2b387f6ae3cd0457784185bf9e7cbcd1c499c9
src/theme/variables/commonColor.js
return color(this.tabBgColor).darken(0.03).hex();
<mask> .darken(0.2) <mask> .hex(); <mask> }, <mask> get darkenHeader() { <mask> return color(this.tabBgColor) <mask> .darken(0.03) <mask> .hex(); <mask> }, <mask> <mask> // Icon <mask> iconFamily: 'Ionicons', <mask> iconFontSize: platform === PLATFORM.IOS ? 30 : 28, </s> fix: checkbox fontsize and iconSize changed </s> remove return color(this.tabBgColor) .darken(0.03) .hex(); </s> add return color(this.tabBgColor).darken(0.03).hex(); </s> remove return color(this.toolbarDefaultBg) .darken(0.2) .hex(); </s> add return color(this.toolbarDefaultBg).darken(0.2).hex(); </s> remove return color(this.toolbarDefaultBg) .darken(0.2) .hex(); </s> add return color(this.toolbarDefaultBg).darken(0.2).hex(); </s> remove CheckboxFontSize: platform === PLATFORM.IOS ? 23 / 0.9 : 17, </s> add CheckboxFontSize: platform === PLATFORM.IOS ? 12 / 0.9 : 17, </s> remove CheckboxIconSize: platform === PLATFORM.IOS ? 21 : 16, </s> add CheckboxIconSize: platform === PLATFORM.IOS ? 19 : 16,
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4a2b387f6ae3cd0457784185bf9e7cbcd1c499c9
src/theme/variables/commonColor.js
bottomInset: 34,
<mask> portrait: { <mask> topInset: 24, <mask> leftInset: 0, <mask> rightInset: 0, <mask> bottomInset: 34 <mask> }, <mask> landscape: { <mask> topInset: 0, <mask> leftInset: 44, <mask> rightInset: 44, </s> fix: checkbox fontsize and iconSize changed </s> remove bottomInset: 34 </s> add bottomInset: 34, </s> remove bottomInset: 21 } } </s> add bottomInset: 21, }, }, </s> remove bottomInset: 21 } } </s> add bottomInset: 21, }, }, </s> remove return color(this.tabBgColor) .darken(0.03) .hex(); </s> add return color(this.tabBgColor).darken(0.03).hex(); </s> remove return color(this.tabBgColor) .darken(0.03) .hex(); </s> add return color(this.tabBgColor).darken(0.03).hex();
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4a2b387f6ae3cd0457784185bf9e7cbcd1c499c9
src/theme/variables/commonColor.js
bottomInset: 21, }, },
<mask> landscape: { <mask> topInset: 0, <mask> leftInset: 44, <mask> rightInset: 44, <mask> bottomInset: 21 <mask> } <mask> } <mask> }; </s> fix: checkbox fontsize and iconSize changed </s> remove bottomInset: 21 } } </s> add bottomInset: 21, }, }, </s> remove bottomInset: 34 </s> add bottomInset: 34, </s> remove bottomInset: 34 </s> add bottomInset: 34, </s> remove WEB: 'web' </s> add WEB: 'web', </s> remove return color(this.toolbarDefaultBg) .darken(0.2) .hex(); </s> add return color(this.toolbarDefaultBg).darken(0.2).hex();
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4a2b387f6ae3cd0457784185bf9e7cbcd1c499c9
src/theme/variables/commonColor.js
CheckboxIconSize: platform === PLATFORM.IOS ? 19 : 16,
<mask> CheckboxRadius: platform === PLATFORM.IOS ? 13 : 0, <mask> CheckboxBorderWidth: platform === PLATFORM.IOS ? 1 : 2, <mask> CheckboxPaddingLeft: platform === PLATFORM.IOS ? 4 : 2, <mask> CheckboxPaddingBottom: platform === PLATFORM.IOS ? 0 : 5, <mask> CheckboxIconSize: platform === PLATFORM.IOS ? 21 : 16, <mask> CheckboxIconMarginTop: platform === PLATFORM.IOS ? undefined : 1, <mask> CheckboxFontSize: platform === PLATFORM.IOS ? 23 / 0.9 : 17, <mask> checkboxBgColor: '#039BE5', <mask> checkboxSize: 20, <mask> checkboxTickColor: '#fff', </s> fix: checkbox fontsize and iconSize changed
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4a2b387f6ae3cd0457784185bf9e7cbcd1c499c9
src/theme/variables/platform.js
CheckboxFontSize: platform === PLATFORM.IOS ? 12 / 0.9 : 17,
<mask> CheckboxPaddingLeft: platform === PLATFORM.IOS ? 4 : 2, <mask> CheckboxPaddingBottom: platform === PLATFORM.IOS ? 0 : 5, <mask> CheckboxIconSize: platform === PLATFORM.IOS ? 21 : 16, <mask> CheckboxIconMarginTop: platform === PLATFORM.IOS ? undefined : 1, <mask> CheckboxFontSize: platform === PLATFORM.IOS ? 23 / 0.9 : 17, <mask> checkboxBgColor: '#039BE5', <mask> checkboxSize: 20, <mask> checkboxTickColor: '#fff', <mask> checkboxDefaultColor: 'transparent', <mask> checkboxTextShadowRadius: 0, </s> fix: checkbox fontsize and iconSize changed </s> remove CheckboxFontSize: platform === PLATFORM.IOS ? 23 / 0.9 : 17, </s> add CheckboxFontSize: platform === PLATFORM.IOS ? 12 / 0.9 : 17, </s> remove CheckboxIconSize: platform === PLATFORM.IOS ? 21 : 16, </s> add CheckboxIconSize: platform === PLATFORM.IOS ? 19 : 16, </s> remove CheckboxIconSize: platform === PLATFORM.IOS ? 21 : 16, </s> add CheckboxIconSize: platform === PLATFORM.IOS ? 19 : 16, </s> remove return color(this.toolbarDefaultBg) .darken(0.2) .hex(); </s> add return color(this.toolbarDefaultBg).darken(0.2).hex(); </s> remove return color(this.toolbarDefaultBg) .darken(0.2) .hex(); </s> add return color(this.toolbarDefaultBg).darken(0.2).hex();
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4a2b387f6ae3cd0457784185bf9e7cbcd1c499c9
src/theme/variables/platform.js
return color(this.toolbarDefaultBg).darken(0.2).hex();
<mask> toolbarBtnTextColor: platform === PLATFORM.IOS ? '#007aff' : '#fff', <mask> toolbarDefaultBorder: platform === PLATFORM.IOS ? '#a7a6ab' : '#3F51B5', <mask> iosStatusbar: platform === PLATFORM.IOS ? 'dark-content' : 'light-content', <mask> get statusBarColor() { <mask> return color(this.toolbarDefaultBg) <mask> .darken(0.2) <mask> .hex(); <mask> }, <mask> get darkenHeader() { <mask> return color(this.tabBgColor) <mask> .darken(0.03) <mask> .hex(); </s> fix: checkbox fontsize and iconSize changed </s> remove return color(this.toolbarDefaultBg) .darken(0.2) .hex(); </s> add return color(this.toolbarDefaultBg).darken(0.2).hex(); </s> remove return color(this.tabBgColor) .darken(0.03) .hex(); </s> add return color(this.tabBgColor).darken(0.03).hex(); </s> remove return color(this.tabBgColor) .darken(0.03) .hex(); </s> add return color(this.tabBgColor).darken(0.03).hex(); </s> remove CheckboxIconSize: platform === PLATFORM.IOS ? 21 : 16, </s> add CheckboxIconSize: platform === PLATFORM.IOS ? 19 : 16, </s> remove CheckboxIconSize: platform === PLATFORM.IOS ? 21 : 16, </s> add CheckboxIconSize: platform === PLATFORM.IOS ? 19 : 16,
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4a2b387f6ae3cd0457784185bf9e7cbcd1c499c9
src/theme/variables/platform.js
return color(this.tabBgColor).darken(0.03).hex();
<mask> .darken(0.2) <mask> .hex(); <mask> }, <mask> get darkenHeader() { <mask> return color(this.tabBgColor) <mask> .darken(0.03) <mask> .hex(); <mask> }, <mask> <mask> // Icon <mask> iconFamily: 'Ionicons', <mask> iconFontSize: platform === PLATFORM.IOS ? 30 : 28, </s> fix: checkbox fontsize and iconSize changed
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4a2b387f6ae3cd0457784185bf9e7cbcd1c499c9
src/theme/variables/platform.js
bottomInset: 34,
<mask> portrait: { <mask> topInset: 24, <mask> leftInset: 0, <mask> rightInset: 0, <mask> bottomInset: 34 <mask> }, <mask> landscape: { <mask> topInset: 0, <mask> leftInset: 44, <mask> rightInset: 44, </s> fix: checkbox fontsize and iconSize changed
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4a2b387f6ae3cd0457784185bf9e7cbcd1c499c9
src/theme/variables/platform.js
bottomInset: 21, }, },
<mask> landscape: { <mask> topInset: 0, <mask> leftInset: 44, <mask> rightInset: 44, <mask> bottomInset: 21 <mask> } <mask> } <mask> }; </s> fix: checkbox fontsize and iconSize changed
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4a2b387f6ae3cd0457784185bf9e7cbcd1c499c9
src/theme/variables/platform.js
const { children } = props; const state = useCheckboxGroupState(props); const { groupProps } = useCheckboxGroup(
<mask> function CheckboxGroup( <mask> { size, colorScheme, ...props }: ICheckboxGroupProps, <mask> ref?: any <mask> ) { <mask> let { children } = props; <mask> let state = useCheckboxGroupState(props); <mask> let { groupProps } = useCheckboxGroup( <mask> { 'aria-label': props.accessibilityLabel, ...props }, <mask> state <mask> ); <mask> const formControlContext = useFormControlContext(); <mask> //TODO: refactor for responsive prop </s> fix: image, checkbox, radio and switch </s> remove let ret: any = {}; </s> add const ret: any = {}; </s> remove let { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; let colorScheme = getColorScheme(props); </s> add const { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; const colorScheme = getColorScheme(props); </s> remove let dimValues = Object.values(values); </s> add const dimValues = Object.values(values);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4c4ab7a1e99b47f5848b73f0726553de21999b86
src/components/primitives/Checkbox/CheckboxGroup.tsx
const { hoverProps, isHovered } = useHover(); const { pressableProps, isPressed } = useIsPressed(); const { focusProps, isFocused } = useFocus();
<mask> useIsPressed, <mask> } from '../../primitives/Pressable/Pressable'; <mask> <mask> const Radio = ({ icon, wrapperRef, size, ...props }: IRadioProps, ref: any) => { <mask> const contextState = React.useContext(RadioContext); <mask> <mask> const { <mask> isInvalid, <mask> isReadOnly, <mask> isIndeterminate, </s> fix: image, checkbox, radio and switch </s> remove let { children } = props; let state = useCheckboxGroupState(props); let { groupProps } = useCheckboxGroup( </s> add const { children } = props; const state = useCheckboxGroupState(props); const { groupProps } = useCheckboxGroup( </s> remove let { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; let colorScheme = getColorScheme(props); </s> add const { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; const colorScheme = getColorScheme(props); </s> remove let ret: any = {}; </s> add const ret: any = {}; </s> remove } = usePropsResolution('Switch', props, { isHovered, isDisabled }); </s> add } = usePropsResolution('Switch', props, { isHovered, isDisabled, isInvalid, isChecked: checked, }); </s> remove for (let scaleKey in scale) { </s> add for (const scaleKey in scale) {
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4c4ab7a1e99b47f5848b73f0726553de21999b86
src/components/primitives/Radio/Radio.tsx
</Center> {/* Label */} {props.children} </Center>
<mask> </Center> <mask> {/* Label */} <mask> {props.children} <mask> </Center> <mask> ); <mask> }} <mask> </Pressable> <mask> ); <mask> }; <mask> <mask> export default memo(forwardRef(Radio)); </s> fix: image, checkbox, radio and switch </s> remove let { children } = props; let state = useCheckboxGroupState(props); let { groupProps } = useCheckboxGroup( </s> add const { children } = props; const state = useCheckboxGroupState(props); const { groupProps } = useCheckboxGroup( </s> remove '2xs': { size: 6 }, 'xs': { size: 10 }, 'sm': { size: 16 }, 'md': { size: 20 }, 'lg': { size: 24 }, 'xl': { size: 32 }, '2xl': { size: 64 }, 'full': { size: '100%' }, </s> add '2xs': 6, 'xs': 10, 'sm': 16, 'md': 20, 'lg': 24, 'xl': 32, '2xl': 64, 'full': '100%', </s> remove pt: [''], </s> add pt: ['paddingTop'], </s> remove let dimValues = Object.values(values); </s> add const dimValues = Object.values(values); </s> remove for (let scaleKey in scale) { </s> add for (const scaleKey in scale) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4c4ab7a1e99b47f5848b73f0726553de21999b86
src/components/primitives/Radio/Radio.tsx
} = usePropsResolution('Switch', props, { isHovered, isDisabled, isInvalid, isChecked: checked, });
<mask> onThumbColor: _onThumbColor, <mask> offThumbColor: _offThumbColor, <mask> style: themeStyle, <mask> ...resolvedProps <mask> } = usePropsResolution('Switch', props, { isHovered, isDisabled }); <mask> <mask> const computedStyle: ViewStyle = StyleSheet.flatten([ <mask> themeStyle, <mask> style, <mask> isInvalid ? inValidPropFactors : {}, </s> fix: image, checkbox, radio and switch </s> remove let valArray = Array.isArray(values) </s> add const valArray = Array.isArray(values) </s> remove let ret: any = {}; </s> add const ret: any = {}; </s> remove let { children } = props; let state = useCheckboxGroupState(props); let { groupProps } = useCheckboxGroup( </s> add const { children } = props; const state = useCheckboxGroupState(props); const { groupProps } = useCheckboxGroup( </s> remove let { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; let colorScheme = getColorScheme(props); </s> add const { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; const colorScheme = getColorScheme(props);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4c4ab7a1e99b47f5848b73f0726553de21999b86
src/components/primitives/Switch/index.tsx
pt: ['paddingTop'],
<mask> <mask> const PADDING_MAP: any = { <mask> px: ['paddingRight', 'paddingLeft'], <mask> py: ['paddingTop', 'paddingBottom'], <mask> pt: [''], <mask> pb: ['paddingBottom'], <mask> pr: ['paddingRight'], <mask> pl: ['paddingLeft'], <mask> }; <mask> </s> fix: image, checkbox, radio and switch </s> remove let ret: any = {}; </s> add const ret: any = {}; </s> remove let { children } = props; let state = useCheckboxGroupState(props); let { groupProps } = useCheckboxGroup( </s> add const { children } = props; const state = useCheckboxGroupState(props); const { groupProps } = useCheckboxGroup( </s> remove for (let scaleKey in scale) { </s> add for (const scaleKey in scale) { </s> remove '2xs': { size: 6 }, 'xs': { size: 10 }, 'sm': { size: 16 }, 'md': { size: 20 }, 'lg': { size: 24 }, 'xl': { size: 32 }, '2xl': { size: 64 }, 'full': { size: '100%' }, </s> add '2xs': 6, 'xs': 10, 'sm': 16, 'md': 20, 'lg': 24, 'xl': 32, '2xl': 64, 'full': '100%',
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4c4ab7a1e99b47f5848b73f0726553de21999b86
src/hooks/useThemeProps/usePropsResolution.tsx
'2xs': 6, 'xs': 10, 'sm': 16, 'md': 20, 'lg': 24, 'xl': 32, '2xl': 64, 'full': '100%',
<mask> // Image <mask> const sizes = { <mask> '2xs': { size: 6 }, <mask> 'xs': { size: 10 }, <mask> 'sm': { size: 16 }, <mask> 'md': { size: 20 }, <mask> 'lg': { size: 24 }, <mask> 'xl': { size: 32 }, <mask> '2xl': { size: 64 }, <mask> 'full': { size: '100%' }, <mask> }; <mask> <mask> export const Image = { <mask> baseStyle: { <mask> maxWidth: '100%', </s> fix: image, checkbox, radio and switch </s> remove for (let scaleKey in scale) { </s> add for (const scaleKey in scale) { </s> remove let { children } = props; let state = useCheckboxGroupState(props); let { groupProps } = useCheckboxGroup( </s> add const { children } = props; const state = useCheckboxGroupState(props); const { groupProps } = useCheckboxGroup( </s> remove let { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; let colorScheme = getColorScheme(props); </s> add const { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; const colorScheme = getColorScheme(props);
[ "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4c4ab7a1e99b47f5848b73f0726553de21999b86
src/theme/components/image.ts
borderWidth: 2, borderRadius: 'full', p: '2px', borderColor: mode('muted.300', 'muted.600')(props), bg: mode('muted.50', 'muted.700')(props), // matching background color
<mask> const baseStyle = (props: Record<string, any>) => { <mask> const { colorScheme, theme } = props; <mask> return { <mask> _text: { <mask> ml: 3, <mask> }, <mask> _interactionBox: { </s> fix: image, checkbox, radio and switch </s> remove let { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; let colorScheme = getColorScheme(props); </s> add const { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; const colorScheme = getColorScheme(props); </s> remove let { children } = props; let state = useCheckboxGroupState(props); let { groupProps } = useCheckboxGroup( </s> add const { children } = props; const state = useCheckboxGroupState(props); const { groupProps } = useCheckboxGroup( </s> remove let ret: any = {}; </s> add const ret: any = {}; </s> remove for (let scaleKey in scale) { </s> add for (const scaleKey in scale) {
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4c4ab7a1e99b47f5848b73f0726553de21999b86
src/theme/components/radio.ts
<mask> position: 'absolute', <mask> zIndex: -1, <mask> borderRadius: 'full', <mask> }, <mask> _iconWrapper: { <mask> borderWidth: 2, <mask> borderRadius: 'full', <mask> p: '2px', <mask> borderColor: mode('muted.300', 'muted.600')(props), <mask> bg: mode('muted.50', 'muted.700')(props), // matching background color <mask> }, <mask> _icon: { <mask> color: mode(`${colorScheme}.600`, `${colorScheme}.200`)(props), // matching background color <mask> }, <mask> _hover: { <mask> _interactionBox: { </s> fix: image, checkbox, radio and switch </s> remove _iconWrapper: { borderColor: mode(`${colorScheme}.600`, `${colorScheme}.200`)(props), }, </s> add borderColor: mode(`${colorScheme}.600`, `${colorScheme}.200`)(props), </s> remove bg: 'transaprarent', </s> add bg: 'transparent', </s> remove bg: 'transaprarent', }, _iconWrapper: { opacity: 0.4, </s> add bg: 'transparent',
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4c4ab7a1e99b47f5848b73f0726553de21999b86
src/theme/components/radio.ts
borderColor: mode(`${colorScheme}.600`, `${colorScheme}.200`)(props),
<mask> _checked: { <mask> _interactionBox: { <mask> borderColor: mode(`${colorScheme}.600`, `${colorScheme}.200`)(props), <mask> }, <mask> _iconWrapper: { <mask> borderColor: mode(`${colorScheme}.600`, `${colorScheme}.200`)(props), <mask> }, <mask> }, <mask> _disabled: { <mask> _interactionBox: { <mask> bg: 'transaprarent', <mask> }, </s> fix: image, checkbox, radio and switch </s> remove _iconWrapper: { borderWidth: 2, borderRadius: 'full', p: '2px', borderColor: mode('muted.300', 'muted.600')(props), bg: mode('muted.50', 'muted.700')(props), // matching background color }, </s> add </s> remove bg: 'transaprarent', }, _iconWrapper: { opacity: 0.4, </s> add bg: 'transparent', </s> remove _iconWrapper: { borderColor: mode('error.600', 'error.400')(props), }, </s> add borderColor: mode('error.600', 'error.400')(props), </s> remove bg: 'transaprarent', </s> add bg: 'transparent',
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4c4ab7a1e99b47f5848b73f0726553de21999b86
src/theme/components/radio.ts
opacity: 0.4,
<mask> }, <mask> borderColor: mode(`${colorScheme}.600`, `${colorScheme}.200`)(props), <mask> }, <mask> _disabled: { <mask> _interactionBox: { <mask> bg: 'transparent', <mask> }, <mask> _icon: { <mask> bg: 'transparent', <mask> }, </s> fix: image, checkbox, radio and switch </s> remove _iconWrapper: { borderColor: mode(`${colorScheme}.600`, `${colorScheme}.200`)(props), }, </s> add borderColor: mode(`${colorScheme}.600`, `${colorScheme}.200`)(props), </s> remove bg: 'transaprarent', }, _iconWrapper: { opacity: 0.4, </s> add bg: 'transparent', </s> remove bg: 'transaprarent', </s> add bg: 'transparent', </s> remove _iconWrapper: { borderWidth: 2, borderRadius: 'full', p: '2px', borderColor: mode('muted.300', 'muted.600')(props), bg: mode('muted.50', 'muted.700')(props), // matching background color }, </s> add </s> remove _iconWrapper: { borderColor: mode('error.600', 'error.400')(props), }, </s> add borderColor: mode('error.600', 'error.400')(props),
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4c4ab7a1e99b47f5848b73f0726553de21999b86
src/theme/components/radio.ts
bg: 'transparent',
<mask> }, <mask> }, <mask> _disabled: { <mask> _interactionBox: { <mask> bg: 'transaprarent', <mask> }, <mask> _iconWrapper: { <mask> opacity: 0.4, <mask> }, <mask> _icon: { <mask> bg: 'transaprarent', <mask> }, <mask> }, </s> fix: image, checkbox, radio and switch </s> remove bg: 'transaprarent', </s> add bg: 'transparent', </s> remove _iconWrapper: { borderColor: mode(`${colorScheme}.600`, `${colorScheme}.200`)(props), }, </s> add borderColor: mode(`${colorScheme}.600`, `${colorScheme}.200`)(props), </s> remove _iconWrapper: { borderColor: mode('error.600', 'error.400')(props), }, </s> add borderColor: mode('error.600', 'error.400')(props), </s> remove _iconWrapper: { borderWidth: 2, borderRadius: 'full', p: '2px', borderColor: mode('muted.300', 'muted.600')(props), bg: mode('muted.50', 'muted.700')(props), // matching background color }, </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4c4ab7a1e99b47f5848b73f0726553de21999b86
src/theme/components/radio.ts
bg: 'transparent',
<mask> _iconWrapper: { <mask> opacity: 0.4, <mask> }, <mask> _icon: { <mask> bg: 'transaprarent', <mask> }, <mask> }, <mask> _invalid: { <mask> _iconWrapper: { <mask> borderColor: mode('error.600', 'error.400')(props), </s> fix: image, checkbox, radio and switch </s> remove _iconWrapper: { borderColor: mode('error.600', 'error.400')(props), }, </s> add borderColor: mode('error.600', 'error.400')(props), </s> remove bg: 'transaprarent', }, _iconWrapper: { opacity: 0.4, </s> add bg: 'transparent', </s> remove _iconWrapper: { borderColor: mode(`${colorScheme}.600`, `${colorScheme}.200`)(props), }, </s> add borderColor: mode(`${colorScheme}.600`, `${colorScheme}.200`)(props), </s> remove _iconWrapper: { borderWidth: 2, borderRadius: 'full', p: '2px', borderColor: mode('muted.300', 'muted.600')(props), bg: mode('muted.50', 'muted.700')(props), // matching background color }, </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4c4ab7a1e99b47f5848b73f0726553de21999b86
src/theme/components/radio.ts
borderColor: mode('error.600', 'error.400')(props),
<mask> bg: 'transaprarent', <mask> }, <mask> }, <mask> _invalid: { <mask> _iconWrapper: { <mask> borderColor: mode('error.600', 'error.400')(props), <mask> }, <mask> }, <mask> _pressed: { <mask> _interactionBox: { <mask> bg: transparentize(`${colorScheme}.200`, 0.5)(theme), <mask> }, </s> fix: image, checkbox, radio and switch </s> remove bg: 'transaprarent', </s> add bg: 'transparent', </s> remove _iconWrapper: { borderColor: mode(`${colorScheme}.600`, `${colorScheme}.200`)(props), }, </s> add borderColor: mode(`${colorScheme}.600`, `${colorScheme}.200`)(props), </s> remove bg: 'transaprarent', }, _iconWrapper: { opacity: 0.4, </s> add bg: 'transparent', </s> remove _iconWrapper: { borderWidth: 2, borderRadius: 'full', p: '2px', borderColor: mode('muted.300', 'muted.600')(props), bg: mode('muted.50', 'muted.700')(props), // matching background color }, </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4c4ab7a1e99b47f5848b73f0726553de21999b86
src/theme/components/radio.ts
const { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; const colorScheme = getColorScheme(props);
<mask> import { mode, getColorScheme } from '../tools'; <mask> import { Platform } from 'react-native'; <mask> <mask> const baseStyle = (props: Record<string, any>) => { <mask> let { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; <mask> let colorScheme = getColorScheme(props); <mask> <mask> return { <mask> offTrackColor: <mask> offTrackColor ?? <mask> mode( </s> fix: image, checkbox, radio and switch </s> remove let { children } = props; let state = useCheckboxGroupState(props); let { groupProps } = useCheckboxGroup( </s> add const { children } = props; const state = useCheckboxGroupState(props); const { groupProps } = useCheckboxGroup( </s> remove let ret: any = {}; </s> add const ret: any = {}; </s> remove let valArray = Array.isArray(values) </s> add const valArray = Array.isArray(values)
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4c4ab7a1e99b47f5848b73f0726553de21999b86
src/theme/components/switch.ts
const ret: any = {};
<mask> return result; <mask> } <mask> // Inefficient way for pick, but retains order of props. <mask> function orderedPick(obj: any, values: any) { <mask> let ret: any = {}; <mask> Object.keys(obj).forEach((key: string) => { <mask> if (values.includes(key)) { <mask> ret[key] = obj[key]; <mask> } <mask> }); </s> fix: image, checkbox, radio and switch </s> remove let valArray = Array.isArray(values) </s> add const valArray = Array.isArray(values) </s> remove let { children } = props; let state = useCheckboxGroupState(props); let { groupProps } = useCheckboxGroup( </s> add const { children } = props; const state = useCheckboxGroupState(props); const { groupProps } = useCheckboxGroup( </s> remove let dimValues = Object.values(values); </s> add const dimValues = Object.values(values); </s> remove let { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; let colorScheme = getColorScheme(props); </s> add const { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; const colorScheme = getColorScheme(props);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4c4ab7a1e99b47f5848b73f0726553de21999b86
src/theme/tools/utils.ts
const valArray = Array.isArray(values)
<mask> values: any, <mask> themeBreakpoints: any, <mask> currentBreakpoint: number <mask> ) { <mask> let valArray = Array.isArray(values) <mask> ? values <mask> : Object.keys(themeBreakpoints).map((bPoint: string) => values[bPoint]); <mask> return ( <mask> valArray[currentBreakpoint] ?? <mask> valArray </s> fix: image, checkbox, radio and switch </s> remove let ret: any = {}; </s> add const ret: any = {}; </s> remove let dimValues = Object.values(values); </s> add const dimValues = Object.values(values); </s> remove let { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; let colorScheme = getColorScheme(props); </s> add const { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; const colorScheme = getColorScheme(props); </s> remove } = usePropsResolution('Switch', props, { isHovered, isDisabled }); </s> add } = usePropsResolution('Switch', props, { isHovered, isDisabled, isInvalid, isChecked: checked, }); </s> remove let { children } = props; let state = useCheckboxGroupState(props); let { groupProps } = useCheckboxGroup( </s> add const { children } = props; const state = useCheckboxGroupState(props); const { groupProps } = useCheckboxGroup(
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4c4ab7a1e99b47f5848b73f0726553de21999b86
src/theme/tools/utils.ts
const dimValues = Object.values(values);
<mask> export function getClosestBreakpoint( <mask> values: Record<string, any>, <mask> point: number <mask> ) { <mask> let dimValues = Object.values(values); <mask> let index = -1; <mask> for (let i = 0; i < dimValues.length; i++) { <mask> if (dimValues[i] === point) { <mask> index = i; <mask> break; </s> fix: image, checkbox, radio and switch </s> remove let ret: any = {}; </s> add const ret: any = {}; </s> remove for (let scaleKey in scale) { </s> add for (const scaleKey in scale) { </s> remove let { children } = props; let state = useCheckboxGroupState(props); let { groupProps } = useCheckboxGroup( </s> add const { children } = props; const state = useCheckboxGroupState(props); const { groupProps } = useCheckboxGroup( </s> remove let valArray = Array.isArray(values) </s> add const valArray = Array.isArray(values) </s> remove let { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; let colorScheme = getColorScheme(props); </s> add const { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; const colorScheme = getColorScheme(props);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4c4ab7a1e99b47f5848b73f0726553de21999b86
src/theme/tools/utils.ts
for (const scaleKey in scale) {
<mask> const isWeb = Platform.OS === 'web'; <mask> scales.forEach((key) => { <mask> const scale = get(theme, key, {}); <mask> const newScale = { ...scale }; <mask> for (let scaleKey in scale) { <mask> const val = scale[scaleKey]; <mask> if (typeof val !== 'object') { <mask> const isAbsolute = typeof val === 'number'; <mask> const isPx = !isAbsolute && val.endsWith('px'); <mask> const isRem = !isAbsolute && val.endsWith('rem'); </s> fix: image, checkbox, radio and switch </s> remove let dimValues = Object.values(values); </s> add const dimValues = Object.values(values); </s> remove let { children } = props; let state = useCheckboxGroupState(props); let { groupProps } = useCheckboxGroup( </s> add const { children } = props; const state = useCheckboxGroupState(props); const { groupProps } = useCheckboxGroup( </s> remove let { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; let colorScheme = getColorScheme(props); </s> add const { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; const colorScheme = getColorScheme(props); </s> remove let ret: any = {}; </s> add const ret: any = {};
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4c4ab7a1e99b47f5848b73f0726553de21999b86
src/theme/tools/utils.ts
) && toast.config?.avoidKeyboard
<mask> <Box <mask> bottom={ <mask> ['bottom', 'bottom-left', 'bottom-right'].includes( <mask> position <mask> ) <mask> ? bottomInset + 'px' <mask> : undefined <mask> } <mask> > <mask> {toast.component} </s> fix: making toast keyboradinset optional with avoidakeyboard prop
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4d07be116b2dc11e55a471133e6ca8907d6b9a99
src/components/composites/Toast/Toast.tsx
// @ts-ignore avoidKeyboard = false, //eslint-disable-line
<mask> _description, <mask> accessibilityAnnouncement, <mask> ...rest <mask> } = props; <mask> <mask> let positionToastArray = toastInfo[placement]; <mask> if (!positionToastArray) positionToastArray = []; </s> fix: making toast keyboradinset optional with avoidakeyboard prop </s> remove ) </s> add ) && toast.config?.avoidKeyboard
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4d07be116b2dc11e55a471133e6ca8907d6b9a99
src/components/composites/Toast/Toast.tsx
/** * If true and the keyboard is opened, the Toast will move up equvivalent to the keyboard height. * @default false */ avoidKeyboard?: boolean;
<mask> /** <mask> * Determines the [accessibility announcement tone](https://reactnative.dev/docs/accessibility#accessibilityliveregion-android). <mask> */ <mask> accessibilityLiveRegion?: 'none' | 'polite' | 'assertive'; <mask> } <mask> <mask> export type IToast = { <mask> id: number; <mask> component: any; <mask> config?: IToastProps; </s> fix: making toast keyboradinset optional with avoidakeyboard prop </s> remove ) </s> add ) && toast.config?.avoidKeyboard
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4d07be116b2dc11e55a471133e6ca8907d6b9a99
src/components/composites/Toast/types.ts
size="xl"
<mask> source={{ <mask> uri: 'https://wallpaperaccess.com/full/317501.jpg', <mask> }} <mask> alt="Alternate Text" <mask> size={'xl'} <mask> /> <mask> ); <mask> } </s> fix: image fix, removed ts-ignore and renamed function </s> remove margin: -defaultTheme.space['5'], </s> add marginTop: -defaultTheme.space['5'], marginRight: -defaultTheme.space['5'], marginBottom: -defaultTheme.space['5'], marginLeft: -defaultTheme.space['5'], </s> remove expect(box.props.style.paddingLeft).toBe(defaultTheme.space['8']); expect(box.props.style.paddingRight).toBe(defaultTheme.space['8']); expect(box.props.style.paddingTop).toBe(defaultTheme.space['8']); expect(box.props.style.paddingBottom).toBe(defaultTheme.space['8']); </s> add expect(box.props.style.paddingLeft).toBe(defaultTheme.space['2']); expect(box.props.style.paddingRight).toBe(defaultTheme.space['2']); expect(box.props.style.paddingTop).toBe(defaultTheme.space['2']); expect(box.props.style.paddingBottom).toBe(defaultTheme.space['2']); </s> remove import { useFlattenProps } from './useFlattenProps'; </s> add import { propsFlattener } from './propsFlattener'; </s> remove import { useFlattenProps } from './useFlattenProps'; </s> add import { propsFlattener } from './propsFlattener'; </s> remove let [flattenProps, specificityMap] = useFlattenProps( </s> add let [flattenProps, specificityMap] = propsFlattener(
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4f67f05d088f1aa1090a7adb1c0b4485ff5fece1
example/storybook/stories/components/primitives/Image/Basic.tsx
expect(box.props.style.paddingLeft).toBe(defaultTheme.space['2']); expect(box.props.style.paddingRight).toBe(defaultTheme.space['2']); expect(box.props.style.paddingTop).toBe(defaultTheme.space['2']); expect(box.props.style.paddingBottom).toBe(defaultTheme.space['2']);
<mask> </Box> <mask> </Provider> <mask> ); <mask> const box = getByTestId('test'); <mask> expect(box.props.style.paddingLeft).toBe(defaultTheme.space['8']); <mask> expect(box.props.style.paddingRight).toBe(defaultTheme.space['8']); <mask> expect(box.props.style.paddingTop).toBe(defaultTheme.space['8']); <mask> expect(box.props.style.paddingBottom).toBe(defaultTheme.space['8']); <mask> }); <mask> <mask> it('tests simple resolution with responsive props', () => { <mask> const { getByTestId } = render( <mask> <Provider> </s> fix: image fix, removed ts-ignore and renamed function </s> remove margin: -defaultTheme.space['5'], </s> add marginTop: -defaultTheme.space['5'], marginRight: -defaultTheme.space['5'], marginBottom: -defaultTheme.space['5'], marginLeft: -defaultTheme.space['5'], </s> remove import { useFlattenProps } from './useFlattenProps'; </s> add import { propsFlattener } from './propsFlattener'; </s> remove import { useFlattenProps } from './useFlattenProps'; </s> add import { propsFlattener } from './propsFlattener'; </s> remove [flattenSizeStyle] = useFlattenProps( </s> add [flattenSizeStyle] = propsFlattener(
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4f67f05d088f1aa1090a7adb1c0b4485ff5fece1
src/hooks/useThemeProps/usePropsResolution.test.tsx
marginTop: -defaultTheme.space['5'], marginRight: -defaultTheme.space['5'], marginBottom: -defaultTheme.space['5'], marginLeft: -defaultTheme.space['5'],
<mask> </Provider> <mask> ); <mask> const box = getByTestId('test'); <mask> expect(box.props.style).toEqual({ <mask> margin: -defaultTheme.space['5'], <mask> }); <mask> }); <mask> <mask> it('resolves shadow from theme', () => { <mask> const { getByTestId } = render( </s> fix: image fix, removed ts-ignore and renamed function </s> remove expect(box.props.style.paddingLeft).toBe(defaultTheme.space['8']); expect(box.props.style.paddingRight).toBe(defaultTheme.space['8']); expect(box.props.style.paddingTop).toBe(defaultTheme.space['8']); expect(box.props.style.paddingBottom).toBe(defaultTheme.space['8']); </s> add expect(box.props.style.paddingLeft).toBe(defaultTheme.space['2']); expect(box.props.style.paddingRight).toBe(defaultTheme.space['2']); expect(box.props.style.paddingTop).toBe(defaultTheme.space['2']); expect(box.props.style.paddingBottom).toBe(defaultTheme.space['2']); </s> remove import { useFlattenProps } from './useFlattenProps'; </s> add import { propsFlattener } from './propsFlattener'; </s> remove import { useFlattenProps } from './useFlattenProps'; </s> add import { propsFlattener } from './propsFlattener'; </s> remove [flattenSizeStyle] = useFlattenProps( </s> add [flattenSizeStyle] = propsFlattener(
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4f67f05d088f1aa1090a7adb1c0b4485ff5fece1
src/hooks/useThemeProps/usePropsResolution.test.tsx
import { propsFlattener } from './propsFlattener';
<mask> import { useColorMode } from '../../core/color-mode'; <mask> import { omitUndefined, extractInObject } from '../../theme/tools'; <mask> import { useContrastText } from '../useContrastText'; <mask> import { useBreakpointResolvedProps } from '../useBreakpointResolvedProps'; <mask> import { useFlattenProps } from './useFlattenProps'; <mask> <mask> const specificityOrder = [ <mask> 'p', <mask> 'padding', <mask> 'px', </s> fix: image fix, removed ts-ignore and renamed function </s> remove import { useFlattenProps } from './useFlattenProps'; </s> add import { propsFlattener } from './propsFlattener'; </s> remove margin: -defaultTheme.space['5'], </s> add marginTop: -defaultTheme.space['5'], marginRight: -defaultTheme.space['5'], marginBottom: -defaultTheme.space['5'], marginLeft: -defaultTheme.space['5'], </s> remove expect(box.props.style.paddingLeft).toBe(defaultTheme.space['8']); expect(box.props.style.paddingRight).toBe(defaultTheme.space['8']); expect(box.props.style.paddingTop).toBe(defaultTheme.space['8']); expect(box.props.style.paddingBottom).toBe(defaultTheme.space['8']); </s> add expect(box.props.style.paddingLeft).toBe(defaultTheme.space['2']); expect(box.props.style.paddingRight).toBe(defaultTheme.space['2']); expect(box.props.style.paddingTop).toBe(defaultTheme.space['2']); expect(box.props.style.paddingBottom).toBe(defaultTheme.space['2']); </s> remove [flattenSizeStyle] = useFlattenProps( </s> add [flattenSizeStyle] = propsFlattener(
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4f67f05d088f1aa1090a7adb1c0b4485ff5fece1
src/hooks/useThemeProps/usePropsResolution.tsx
let [flattenProps, specificityMap] = propsFlattener(
<mask> cleanIncomingProps <mask> ); <mask> // STEP 2: flatten them <mask> <mask> let [flattenProps, specificityMap] = useFlattenProps( <mask> { <mask> props: incomingWithDefaultProps, <mask> platform: Platform.OS, <mask> colormode: colorModeProps.colorMode, <mask> state: state || {}, </s> fix: image fix, removed ts-ignore and renamed function </s> remove let [flattenProps, specificityMap] = useFlattenProps( </s> add let [flattenProps, specificityMap] = propsFlattener( </s> remove [flattenVariantStyle, variantSpecificityMap] = useFlattenProps( </s> add [flattenVariantStyle, variantSpecificityMap] = propsFlattener( </s> remove [flattenBaseStyle, baseSpecificityMap] = useFlattenProps( </s> add [flattenBaseStyle, baseSpecificityMap] = propsFlattener( </s> remove [flattenVariantStyle, variantSpecificityMap] = useFlattenProps( </s> add [flattenVariantStyle, variantSpecificityMap] = propsFlattener( </s> remove [flattenBaseStyle, baseSpecificityMap] = useFlattenProps( </s> add [flattenBaseStyle, baseSpecificityMap] = propsFlattener(
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4f67f05d088f1aa1090a7adb1c0b4485ff5fece1
src/hooks/useThemeProps/usePropsResolution.tsx
[flattenBaseStyle, baseSpecificityMap] = propsFlattener(
<mask> ...flattenProps, <mask> ...colorModeProps, <mask> }); <mask> <mask> [flattenBaseStyle, baseSpecificityMap] = useFlattenProps( <mask> { <mask> props: componentBaseStyle, <mask> platform: Platform.OS, <mask> colormode: colorModeProps.colorMode, <mask> state: state || {}, </s> fix: image fix, removed ts-ignore and renamed function </s> remove [flattenBaseStyle, baseSpecificityMap] = useFlattenProps( </s> add [flattenBaseStyle, baseSpecificityMap] = propsFlattener( </s> remove [flattenVariantStyle, variantSpecificityMap] = useFlattenProps( </s> add [flattenVariantStyle, variantSpecificityMap] = propsFlattener( </s> remove [flattenVariantStyle, variantSpecificityMap] = useFlattenProps( </s> add [flattenVariantStyle, variantSpecificityMap] = propsFlattener( </s> remove [flattenSizeStyle] = useFlattenProps( </s> add [flattenSizeStyle] = propsFlattener( </s> remove [flattenSizeStyle] = useFlattenProps( </s> add [flattenSizeStyle] = propsFlattener(
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4f67f05d088f1aa1090a7adb1c0b4485ff5fece1
src/hooks/useThemeProps/usePropsResolution.tsx
[flattenVariantStyle, variantSpecificityMap] = propsFlattener(
<mask> ...flattenProps, <mask> ...colorModeProps, <mask> }); <mask> <mask> [flattenVariantStyle, variantSpecificityMap] = useFlattenProps( <mask> { <mask> props: componentVariantProps, <mask> platform: Platform.OS, <mask> colormode: colorModeProps.colorMode, <mask> state: state || {}, </s> fix: image fix, removed ts-ignore and renamed function </s> remove [flattenVariantStyle, variantSpecificityMap] = useFlattenProps( </s> add [flattenVariantStyle, variantSpecificityMap] = propsFlattener( </s> remove [flattenBaseStyle, baseSpecificityMap] = useFlattenProps( </s> add [flattenBaseStyle, baseSpecificityMap] = propsFlattener( </s> remove [flattenBaseStyle, baseSpecificityMap] = useFlattenProps( </s> add [flattenBaseStyle, baseSpecificityMap] = propsFlattener( </s> remove [flattenSizeStyle] = useFlattenProps( </s> add [flattenSizeStyle] = propsFlattener( </s> remove [flattenSizeStyle] = useFlattenProps( </s> add [flattenSizeStyle] = propsFlattener(
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4f67f05d088f1aa1090a7adb1c0b4485ff5fece1
src/hooks/useThemeProps/usePropsResolution.tsx
// HACK: Doing a temp fix if (component === 'Image') flattenProps.size = componentTheme.sizes[size].size;
<mask> } <mask> // Type - sizes: {lg: {px: 1}}. Refer button theme <mask> else { <mask> flattenProps.size = undefined; <mask> componentSizeProps = componentTheme.sizes[size]; <mask> } <mask> <mask> [flattenSizeStyle] = propsFlattener( <mask> { <mask> props: componentSizeProps, </s> fix: image fix, removed ts-ignore and renamed function </s> remove [flattenSizeStyle] = useFlattenProps( </s> add [flattenSizeStyle] = propsFlattener( </s> remove [flattenSizeStyle] = useFlattenProps( </s> add [flattenSizeStyle] = propsFlattener( </s> remove let [flattenProps, specificityMap] = useFlattenProps( </s> add let [flattenProps, specificityMap] = propsFlattener( </s> remove let [flattenProps, specificityMap] = useFlattenProps( </s> add let [flattenProps, specificityMap] = propsFlattener( </s> remove import { useFlattenProps } from './useFlattenProps'; </s> add import { propsFlattener } from './propsFlattener';
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4f67f05d088f1aa1090a7adb1c0b4485ff5fece1
src/hooks/useThemeProps/usePropsResolution.tsx
[flattenSizeStyle] = propsFlattener(
<mask> flattenProps.size = undefined; <mask> componentSizeProps = componentTheme.sizes[size]; <mask> } <mask> <mask> [flattenSizeStyle] = useFlattenProps( <mask> { <mask> props: componentSizeProps, <mask> platform: Platform.OS, <mask> colormode: colorModeProps.colorMode, <mask> state: state || {}, </s> fix: image fix, removed ts-ignore and renamed function </s> remove [flattenSizeStyle] = useFlattenProps( </s> add [flattenSizeStyle] = propsFlattener( </s> remove [flattenVariantStyle, variantSpecificityMap] = useFlattenProps( </s> add [flattenVariantStyle, variantSpecificityMap] = propsFlattener( </s> remove [flattenBaseStyle, baseSpecificityMap] = useFlattenProps( </s> add [flattenBaseStyle, baseSpecificityMap] = propsFlattener( </s> remove [flattenVariantStyle, variantSpecificityMap] = useFlattenProps( </s> add [flattenVariantStyle, variantSpecificityMap] = propsFlattener(
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4f67f05d088f1aa1090a7adb1c0b4485ff5fece1
src/hooks/useThemeProps/usePropsResolution.tsx
import { propsFlattener } from './propsFlattener';
<mask> import { useColorMode } from '../../core/color-mode'; <mask> import { omitUndefined, extractInObject } from '../../theme/tools'; <mask> import { useContrastText } from '../useContrastText'; <mask> import { useBreakpointResolvedProps } from '../useBreakpointResolvedProps'; <mask> import { useFlattenProps } from './useFlattenProps'; <mask> <mask> const specificityOrder = [ <mask> 'p', <mask> 'padding', <mask> 'px', </s> fix: image fix, removed ts-ignore and renamed function
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4f67f05d088f1aa1090a7adb1c0b4485ff5fece1
src/hooks/useThemeProps/usePropsResolutionTest.tsx
let [flattenProps, specificityMap] = propsFlattener(
<mask> cleanIncomingProps <mask> ); <mask> // STEP 2: flatten them <mask> <mask> let [flattenProps, specificityMap] = useFlattenProps( <mask> { <mask> props: incomingWithDefaultProps, <mask> platform: Platform.OS, <mask> colormode: colorModeProps.colorMode, <mask> state: state || {}, </s> fix: image fix, removed ts-ignore and renamed function
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4f67f05d088f1aa1090a7adb1c0b4485ff5fece1
src/hooks/useThemeProps/usePropsResolutionTest.tsx
[flattenBaseStyle, baseSpecificityMap] = propsFlattener(
<mask> ...flattenProps, <mask> ...colorModeProps, <mask> }); <mask> <mask> [flattenBaseStyle, baseSpecificityMap] = useFlattenProps( <mask> { <mask> props: componentBaseStyle, <mask> platform: Platform.OS, <mask> colormode: colorModeProps.colorMode, <mask> state: state || {}, </s> fix: image fix, removed ts-ignore and renamed function
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4f67f05d088f1aa1090a7adb1c0b4485ff5fece1
src/hooks/useThemeProps/usePropsResolutionTest.tsx
[flattenVariantStyle, variantSpecificityMap] = propsFlattener(
<mask> ...flattenProps, <mask> ...colorModeProps, <mask> }); <mask> <mask> [flattenVariantStyle, variantSpecificityMap] = useFlattenProps( <mask> { <mask> props: componentVariantProps, <mask> platform: Platform.OS, <mask> colormode: colorModeProps.colorMode, <mask> state: state || {}, </s> fix: image fix, removed ts-ignore and renamed function
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4f67f05d088f1aa1090a7adb1c0b4485ff5fece1
src/hooks/useThemeProps/usePropsResolutionTest.tsx
[flattenSizeStyle] = propsFlattener(
<mask> flattenProps.size = undefined; <mask> componentSizeProps = componentTheme.sizes[size]; <mask> } <mask> <mask> [flattenSizeStyle] = useFlattenProps( <mask> { <mask> props: componentSizeProps, <mask> platform: Platform.OS, <mask> colormode: colorModeProps.colorMode, <mask> state: state || {}, </s> fix: image fix, removed ts-ignore and renamed function
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4f67f05d088f1aa1090a7adb1c0b4485ff5fece1
src/hooks/useThemeProps/usePropsResolutionTest.tsx
_text: { color: 'gray.700', fontSize: 'xs', fontWeight: 'bold', textTransform: 'uppercase', },
<mask> }); <mask> expect(result.current).toEqual({ <mask> px: 1, <mask> py: 1, <mask> borderRadius: 'lg', <mask> bg: 'gray.100', </s> Fixes for test cases with the changed API </s> remove textTransform: 'uppercase', fontSize: 'xs', </s> add </s> remove textTransform: 'uppercase', fontSize: 'xs', </s> add </s> remove fontWeight: 'bold', </s> add </s> remove fontWeight: 'bold', </s> add
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4fd2249339a768476a98485c1c69816ca0e34aaa
src/__tests__/hooks/useThemeProps.test.tsx
<mask> }); <mask> expect(result.current).toEqual({ <mask> px: 1, <mask> py: 1, <mask> textTransform: 'uppercase', <mask> fontSize: 'xs', <mask> borderRadius: 'lg', <mask> fontWeight: 'bold', <mask> bg: 'gray.100', <mask> color: 'gray.700', <mask> borderWidth: 1, </s> Fixes for test cases with the changed API </s> remove textTransform: 'uppercase', fontSize: 'xs', </s> add </s> remove fontWeight: 'bold', </s> add </s> remove fontWeight: 'bold', </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4fd2249339a768476a98485c1c69816ca0e34aaa
src/__tests__/hooks/useThemeProps.test.tsx
<mask> py: 1, <mask> textTransform: 'uppercase', <mask> fontSize: 'xs', <mask> borderRadius: 'lg', <mask> fontWeight: 'bold', <mask> bg: 'gray.100', <mask> color: 'gray.700', <mask> borderWidth: 1, <mask> borderColor: 'transparent', <mask> }); </s> Fixes for test cases with the changed API </s> remove fontWeight: 'bold', </s> add </s> remove fontWeight: 'bold', </s> add </s> remove fontWeight: 'bold', </s> add </s> remove textTransform: 'uppercase', fontSize: 'xs', </s> add </s> remove textTransform: 'uppercase', fontSize: 'xs', </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4fd2249339a768476a98485c1c69816ca0e34aaa
src/__tests__/hooks/useThemeProps.test.tsx
<mask> fontSize: 'xs', <mask> borderRadius: 'lg', <mask> fontWeight: 'bold', <mask> bg: 'gray.100', <mask> color: 'gray.700', <mask> borderWidth: 1, <mask> borderColor: 'transparent', <mask> }); <mask> }); <mask> </s> Fixes for test cases with the changed API </s> remove color: 'gray.700', </s> add </s> remove color: 'gray.700', </s> add </s> remove color: 'gray.700', </s> add </s> remove fontWeight: 'bold', </s> add </s> remove fontWeight: 'bold', </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4fd2249339a768476a98485c1c69816ca0e34aaa
src/__tests__/hooks/useThemeProps.test.tsx
_text: { color: 'gray.700', fontSize: 'xs', fontWeight: 'bold', textTransform: 'uppercase', },
<mask> wrapper, <mask> }); <mask> expect(result.current).toEqual({ <mask> px: 1, <mask> py: 3, <mask> borderRadius: 'lg', <mask> bg: 'gray.100', <mask> borderWidth: 1, </s> Fixes for test cases with the changed API </s> remove textTransform: 'uppercase', fontSize: 'xs', </s> add </s> remove textTransform: 'uppercase', fontSize: 'xs', </s> add </s> remove fontWeight: 'bold', </s> add </s> remove fontWeight: 'bold', </s> add
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4fd2249339a768476a98485c1c69816ca0e34aaa
src/__tests__/hooks/useThemeProps.test.tsx
<mask> }); <mask> expect(result.current).toEqual({ <mask> px: 1, <mask> py: 3, <mask> textTransform: 'uppercase', <mask> fontSize: 'xs', <mask> borderRadius: 'lg', <mask> fontWeight: 'bold', <mask> bg: 'gray.100', <mask> color: 'gray.700', <mask> borderWidth: 1, </s> Fixes for test cases with the changed API </s> remove textTransform: 'uppercase', fontSize: 'xs', </s> add </s> remove fontWeight: 'bold', </s> add </s> remove fontWeight: 'bold', </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4fd2249339a768476a98485c1c69816ca0e34aaa
src/__tests__/hooks/useThemeProps.test.tsx
<mask> py: 3, <mask> textTransform: 'uppercase', <mask> fontSize: 'xs', <mask> borderRadius: 'lg', <mask> fontWeight: 'bold', <mask> bg: 'gray.100', <mask> color: 'gray.700', <mask> borderWidth: 1, <mask> borderColor: 'transparent', <mask> }); </s> Fixes for test cases with the changed API </s> remove fontWeight: 'bold', </s> add </s> remove textTransform: 'uppercase', fontSize: 'xs', </s> add </s> remove fontWeight: 'bold', </s> add </s> remove fontWeight: 'bold', </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4fd2249339a768476a98485c1c69816ca0e34aaa
src/__tests__/hooks/useThemeProps.test.tsx
<mask> fontSize: 'xs', <mask> borderRadius: 'lg', <mask> fontWeight: 'bold', <mask> bg: 'gray.100', <mask> color: 'gray.700', <mask> borderWidth: 1, <mask> borderColor: 'transparent', <mask> }); <mask> }); <mask> }); </s> Fixes for test cases with the changed API </s> remove color: 'gray.700', </s> add </s> remove color: 'gray.700', </s> add </s> remove color: 'gray.700', </s> add </s> remove fontWeight: 'bold', </s> add </s> remove fontWeight: 'bold', </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4fd2249339a768476a98485c1c69816ca0e34aaa
src/__tests__/hooks/useThemeProps.test.tsx
import { renderHook } from '@testing-library/react-hooks'; import { NativeBaseProvider } from 'native-base';
<mask> import React from 'react'; <mask> import { calculateProps } from './../../hooks/useThemeProps/utils'; <mask> import { theme } from 'native-base'; <mask> <mask> describe('useCalculateProps', () => { <mask> const wrapper = ({ children }: any) => ( <mask> <NativeBaseProvider>{children}</NativeBaseProvider> <mask> ); <mask> const colorModeProps = { </s> Fixes for test cases with the changed API </s> remove expect(calculateProps(theme, colorModeProps, {}, {}, 750)).toEqual({}); </s> add const { result } = renderHook( () => calculateProps(theme, colorModeProps, {}, {}, 750), { wrapper } ); expect(result.current).toEqual({}); </s> remove expect( calculateProps(theme, colorModeProps, componentTheme, {}, 750) ).toEqual({ </s> add const { result } = renderHook( () => calculateProps(theme, colorModeProps, componentTheme, {}, 750), { wrapper } ); expect(result.current).toEqual({ _text: { color: 'gray.700', fontSize: 'xs', fontWeight: 'bold', textTransform: 'uppercase', }, </s> remove expect( calculateProps(theme, colorModeProps, componentTheme, { py: 3 }, 750) ).toEqual({ </s> add const { result } = renderHook( () => calculateProps(theme, colorModeProps, componentTheme, { py: 3 }, 750), { wrapper } ); expect(result.current).toEqual({ _text: { color: 'gray.700', fontSize: 'xs', fontWeight: 'bold', textTransform: 'uppercase', },
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4fd2249339a768476a98485c1c69816ca0e34aaa
src/__tests__/utils/calculateProps.test.tsx
const wrapper = ({ children }: any) => ( <NativeBaseProvider>{children}</NativeBaseProvider> );
<mask> <mask> describe('useCalculateProps', () => { <mask> const colorModeProps = { <mask> colorMode: 'light', <mask> toggleColorMode: () => {}, <mask> setColorMode: () => {}, </s> Fixes for test cases with the changed API </s> remove expect(calculateProps(theme, colorModeProps, {}, {}, 750)).toEqual({}); </s> add const { result } = renderHook( () => calculateProps(theme, colorModeProps, {}, {}, 750), { wrapper } ); expect(result.current).toEqual({}); </s> remove expect( calculateProps(theme, colorModeProps, componentTheme, {}, 750) ).toEqual({ </s> add const { result } = renderHook( () => calculateProps(theme, colorModeProps, componentTheme, {}, 750), { wrapper } ); expect(result.current).toEqual({ _text: { color: 'gray.700', fontSize: 'xs', fontWeight: 'bold', textTransform: 'uppercase', }, </s> remove expect( calculateProps(theme, colorModeProps, componentTheme, { py: 3 }, 750) ).toEqual({ </s> add const { result } = renderHook( () => calculateProps(theme, colorModeProps, componentTheme, { py: 3 }, 750), { wrapper } ); expect(result.current).toEqual({ _text: { color: 'gray.700', fontSize: 'xs', fontWeight: 'bold', textTransform: 'uppercase', }, </s> remove textTransform: 'uppercase', fontSize: 'xs', </s> add
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4fd2249339a768476a98485c1c69816ca0e34aaa
src/__tests__/utils/calculateProps.test.tsx
const { result } = renderHook( () => calculateProps(theme, colorModeProps, {}, {}, 750), { wrapper } ); expect(result.current).toEqual({});
<mask> toggleColorMode: () => {}, <mask> setColorMode: () => {}, <mask> }; <mask> test('No component theme + no props', () => { <mask> expect(calculateProps(theme, colorModeProps, {}, {}, 750)).toEqual({}); <mask> }); <mask> <mask> test('Only component theme(Badge) + no props', () => { <mask> const componentTheme = (theme as any).components.Badge; <mask> expect( </s> Fixes for test cases with the changed API </s> remove expect( calculateProps(theme, colorModeProps, componentTheme, {}, 750) ).toEqual({ </s> add const { result } = renderHook( () => calculateProps(theme, colorModeProps, componentTheme, {}, 750), { wrapper } ); expect(result.current).toEqual({ _text: { color: 'gray.700', fontSize: 'xs', fontWeight: 'bold', textTransform: 'uppercase', }, </s> remove expect( calculateProps(theme, colorModeProps, componentTheme, { py: 3 }, 750) ).toEqual({ </s> add const { result } = renderHook( () => calculateProps(theme, colorModeProps, componentTheme, { py: 3 }, 750), { wrapper } ); expect(result.current).toEqual({ _text: { color: 'gray.700', fontSize: 'xs', fontWeight: 'bold', textTransform: 'uppercase', }, </s> remove textTransform: 'uppercase', fontSize: 'xs', </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4fd2249339a768476a98485c1c69816ca0e34aaa
src/__tests__/utils/calculateProps.test.tsx
const { result } = renderHook( () => calculateProps(theme, colorModeProps, componentTheme, {}, 750), { wrapper } ); expect(result.current).toEqual({ _text: { color: 'gray.700', fontSize: 'xs', fontWeight: 'bold', textTransform: 'uppercase', },
<mask> }); <mask> <mask> test('Only component theme(Badge) + no props', () => { <mask> const componentTheme = (theme as any).components.Badge; <mask> expect( <mask> calculateProps(theme, colorModeProps, componentTheme, {}, 750) <mask> ).toEqual({ <mask> px: 1, <mask> py: 1, <mask> textTransform: 'uppercase', <mask> fontSize: 'xs', <mask> borderRadius: 'lg', </s> Fixes for test cases with the changed API </s> remove expect(calculateProps(theme, colorModeProps, {}, {}, 750)).toEqual({}); </s> add const { result } = renderHook( () => calculateProps(theme, colorModeProps, {}, {}, 750), { wrapper } ); expect(result.current).toEqual({}); </s> remove expect( calculateProps(theme, colorModeProps, componentTheme, { py: 3 }, 750) ).toEqual({ </s> add const { result } = renderHook( () => calculateProps(theme, colorModeProps, componentTheme, { py: 3 }, 750), { wrapper } ); expect(result.current).toEqual({ _text: { color: 'gray.700', fontSize: 'xs', fontWeight: 'bold', textTransform: 'uppercase', }, </s> remove textTransform: 'uppercase', fontSize: 'xs', </s> add </s> remove textTransform: 'uppercase', fontSize: 'xs', </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4fd2249339a768476a98485c1c69816ca0e34aaa
src/__tests__/utils/calculateProps.test.tsx
<mask> calculateProps(theme, colorModeProps, componentTheme, {}, 750) <mask> ).toEqual({ <mask> px: 1, <mask> py: 1, <mask> textTransform: 'uppercase', <mask> fontSize: 'xs', <mask> borderRadius: 'lg', <mask> fontWeight: 'bold', <mask> bg: 'gray.100', <mask> color: 'gray.700', <mask> borderWidth: 1, </s> Fixes for test cases with the changed API </s> remove textTransform: 'uppercase', fontSize: 'xs', </s> add </s> remove expect( calculateProps(theme, colorModeProps, componentTheme, {}, 750) ).toEqual({ </s> add const { result } = renderHook( () => calculateProps(theme, colorModeProps, componentTheme, {}, 750), { wrapper } ); expect(result.current).toEqual({ _text: { color: 'gray.700', fontSize: 'xs', fontWeight: 'bold', textTransform: 'uppercase', }, </s> remove expect( calculateProps(theme, colorModeProps, componentTheme, { py: 3 }, 750) ).toEqual({ </s> add const { result } = renderHook( () => calculateProps(theme, colorModeProps, componentTheme, { py: 3 }, 750), { wrapper } ); expect(result.current).toEqual({ _text: { color: 'gray.700', fontSize: 'xs', fontWeight: 'bold', textTransform: 'uppercase', }, </s> remove textTransform: 'uppercase', fontSize: 'xs', </s> add </s> remove textTransform: 'uppercase', fontSize: 'xs', </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4fd2249339a768476a98485c1c69816ca0e34aaa
src/__tests__/utils/calculateProps.test.tsx
<mask> py: 1, <mask> textTransform: 'uppercase', <mask> fontSize: 'xs', <mask> borderRadius: 'lg', <mask> fontWeight: 'bold', <mask> bg: 'gray.100', <mask> color: 'gray.700', <mask> borderWidth: 1, <mask> borderColor: 'transparent', <mask> }); </s> Fixes for test cases with the changed API
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4fd2249339a768476a98485c1c69816ca0e34aaa
src/__tests__/utils/calculateProps.test.tsx
<mask> fontSize: 'xs', <mask> borderRadius: 'lg', <mask> fontWeight: 'bold', <mask> bg: 'gray.100', <mask> color: 'gray.700', <mask> borderWidth: 1, <mask> borderColor: 'transparent', <mask> }); <mask> }); <mask> </s> Fixes for test cases with the changed API
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4fd2249339a768476a98485c1c69816ca0e34aaa
src/__tests__/utils/calculateProps.test.tsx
const { result } = renderHook( () => calculateProps(theme, colorModeProps, componentTheme, { py: 3 }, 750), { wrapper } ); expect(result.current).toEqual({ _text: { color: 'gray.700', fontSize: 'xs', fontWeight: 'bold', textTransform: 'uppercase', },
<mask> }); <mask> <mask> test('Component theme(Badge) + some props', () => { <mask> const componentTheme = (theme as any).components.Badge; <mask> expect( <mask> calculateProps(theme, colorModeProps, componentTheme, { py: 3 }, 750) <mask> ).toEqual({ <mask> px: 1, <mask> py: 3, <mask> textTransform: 'uppercase', <mask> fontSize: 'xs', <mask> borderRadius: 'lg', </s> Fixes for test cases with the changed API </s> remove expect( calculateProps(theme, colorModeProps, componentTheme, {}, 750) ).toEqual({ </s> add const { result } = renderHook( () => calculateProps(theme, colorModeProps, componentTheme, {}, 750), { wrapper } ); expect(result.current).toEqual({ _text: { color: 'gray.700', fontSize: 'xs', fontWeight: 'bold', textTransform: 'uppercase', }, </s> remove expect(calculateProps(theme, colorModeProps, {}, {}, 750)).toEqual({}); </s> add const { result } = renderHook( () => calculateProps(theme, colorModeProps, {}, {}, 750), { wrapper } ); expect(result.current).toEqual({}); </s> remove textTransform: 'uppercase', fontSize: 'xs', </s> add </s> remove textTransform: 'uppercase', fontSize: 'xs', </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4fd2249339a768476a98485c1c69816ca0e34aaa
src/__tests__/utils/calculateProps.test.tsx
<mask> calculateProps(theme, colorModeProps, componentTheme, { py: 3 }, 750) <mask> ).toEqual({ <mask> px: 1, <mask> py: 3, <mask> textTransform: 'uppercase', <mask> fontSize: 'xs', <mask> borderRadius: 'lg', <mask> fontWeight: 'bold', <mask> bg: 'gray.100', <mask> color: 'gray.700', <mask> borderWidth: 1, </s> Fixes for test cases with the changed API </s> remove expect( calculateProps(theme, colorModeProps, componentTheme, { py: 3 }, 750) ).toEqual({ </s> add const { result } = renderHook( () => calculateProps(theme, colorModeProps, componentTheme, { py: 3 }, 750), { wrapper } ); expect(result.current).toEqual({ _text: { color: 'gray.700', fontSize: 'xs', fontWeight: 'bold', textTransform: 'uppercase', }, </s> remove textTransform: 'uppercase', fontSize: 'xs', </s> add </s> remove expect( calculateProps(theme, colorModeProps, componentTheme, {}, 750) ).toEqual({ </s> add const { result } = renderHook( () => calculateProps(theme, colorModeProps, componentTheme, {}, 750), { wrapper } ); expect(result.current).toEqual({ _text: { color: 'gray.700', fontSize: 'xs', fontWeight: 'bold', textTransform: 'uppercase', },
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4fd2249339a768476a98485c1c69816ca0e34aaa
src/__tests__/utils/calculateProps.test.tsx
<mask> py: 3, <mask> textTransform: 'uppercase', <mask> fontSize: 'xs', <mask> borderRadius: 'lg', <mask> fontWeight: 'bold', <mask> bg: 'gray.100', <mask> color: 'gray.700', <mask> borderWidth: 1, <mask> borderColor: 'transparent', <mask> }); </s> Fixes for test cases with the changed API
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4fd2249339a768476a98485c1c69816ca0e34aaa
src/__tests__/utils/calculateProps.test.tsx
<mask> fontSize: 'xs', <mask> borderRadius: 'lg', <mask> fontWeight: 'bold', <mask> bg: 'gray.100', <mask> color: 'gray.700', <mask> borderWidth: 1, <mask> borderColor: 'transparent', <mask> }); <mask> }); <mask> }); </s> Fixes for test cases with the changed API
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4fd2249339a768476a98485c1c69816ca0e34aaa
src/__tests__/utils/calculateProps.test.tsx
safeArea={2} safeAreaBottom={2}
<mask> <View <mask> bg="teal.400" <mask> height={200} <mask> width={200} <mask> // right={0} <mask> safeArea <mask> // safeAreaX <mask> // pt={6} <mask> // pr={4} <mask> // p={2} <mask> > <mask> <Text>Test Text</Text> <mask> </View> <mask> </HStack> <mask> ); </s> feat: usesafearea props now accept numbers as well </s> remove newProps[propName].color ?? props[propName]?.color </s> add newProps[propName]?.color ?? props[propName]?.color </s> remove if (!insets.right) { </s> add // DOC: Adding it for manual inset passed by the user let [rightSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaX', 'safeAreaRight', ]); let rightSafeAreaArray = Object.keys(rightSafeAreaProps); const manualInset = rightSafeAreaArray.length ? rightSafeAreaProps[rightSafeAreaArray[rightSafeAreaArray.length - 1]] : undefined; if (!insets.right && (!manualInset || typeof manualInset === 'boolean')) { </s> remove if (!insets.top) { </s> add // DOC: Adding it for manual inset passed by the user let [topSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaY', 'safeAreaTop', ]); let topSafeAreaArray = Object.keys(topSafeAreaProps); const manualInset = topSafeAreaArray.length ? topSafeAreaProps[topSafeAreaArray[topSafeAreaArray.length - 1]] : undefined; if (!insets.top && (!manualInset || typeof manualInset === 'boolean')) { </s> remove return getValueInPixels(paddingProps, propKeys, sizes, insets.left); </s> add return getValueInPixels( paddingProps, propKeys, sizes, insets.left, manualInset ); </s> remove return getValueInPixels(paddingProps, propKeys, sizes, insets.bottom); </s> add return getValueInPixels( paddingProps, propKeys, sizes, insets.bottom, manualInset );
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
example/storybook/stories/hooks/useSafeArea/Basic.tsx
test('Generic inset(boolean)', () => {
<mask> import { calculatePaddingProps } from './../useSafeArea/utils'; <mask> <mask> describe('calculatePaddingProps(useSafeArea)', () => { <mask> test('Empty', () => { <mask> expect( <mask> calculatePaddingProps( <mask> { safeArea: true }, <mask> {}, <mask> { top: 0, left: 0, right: 0, bottom: 0 }, </s> feat: usesafearea props now accept numbers as well </s> remove test('Top inset', () => { </s> add test('Generic inset(number)', () => { expect( calculatePaddingProps( { safeArea: 2 }, {}, { top: 0, left: 0, right: 0, bottom: 0 }, { 2: '2' } ) ).toEqual({ pt: '2px', pb: '2px', pl: '2px', pr: '2px' }); }); test('Top inset(boolean)', () => { </s> remove test('Top inset with padding', () => { </s> add test('Top inset(number)', () => { expect( calculatePaddingProps( { safeAreaTop: 2 }, {}, { top: 0, left: 0, right: 0, bottom: 0 }, { 2: '2' } ) ).toEqual({ pt: '2px' }); }); test('Top inset(boolean) with padding', () => { </s> remove test('Bottom inset', () => { </s> add test('Top inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaTop: 2 }, { pt: 10 }, { top: 10, left: 0, right: 0, bottom: 0 }, { 2: '2', 10: '10' } ) ).toEqual({ pt: '12px' }); }); test('Bottom inset(boolean)', () => { </s> remove test('Bottom inset with padding', () => { </s> add test('Bottom inset(number)', () => { expect( calculatePaddingProps( { safeAreaBottom: 2 }, {}, { top: 10, left: 0, right: 0, bottom: 20 }, { 2: '2' } ) ).toEqual({ pb: '2px' }); }); test('Bottom inset(boolean) with padding', () => {
[ "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/tests/calculatePaddingProps.test.tsx
test('Generic inset(number)', () => { expect( calculatePaddingProps( { safeArea: 2 }, {}, { top: 0, left: 0, right: 0, bottom: 0 }, { 2: '2' } ) ).toEqual({ pt: '2px', pb: '2px', pl: '2px', pr: '2px' }); }); test('Top inset(boolean)', () => {
<mask> {} <mask> ) <mask> ).toEqual({}); <mask> }); <mask> test('Top inset', () => { <mask> expect( <mask> calculatePaddingProps( <mask> { safeAreaTop: true }, <mask> {}, <mask> { top: 10, left: 0, right: 0, bottom: 0 }, </s> feat: usesafearea props now accept numbers as well </s> remove test('Top inset with padding', () => { </s> add test('Top inset(number)', () => { expect( calculatePaddingProps( { safeAreaTop: 2 }, {}, { top: 0, left: 0, right: 0, bottom: 0 }, { 2: '2' } ) ).toEqual({ pt: '2px' }); }); test('Top inset(boolean) with padding', () => { </s> remove test('Bottom inset', () => { </s> add test('Top inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaTop: 2 }, { pt: 10 }, { top: 10, left: 0, right: 0, bottom: 0 }, { 2: '2', 10: '10' } ) ).toEqual({ pt: '12px' }); }); test('Bottom inset(boolean)', () => { </s> remove test('Bottom inset with padding', () => { </s> add test('Bottom inset(number)', () => { expect( calculatePaddingProps( { safeAreaBottom: 2 }, {}, { top: 10, left: 0, right: 0, bottom: 20 }, { 2: '2' } ) ).toEqual({ pb: '2px' }); }); test('Bottom inset(boolean) with padding', () => { </s> remove test('Empty', () => { </s> add test('Generic inset(boolean)', () => { </s> remove test('Left inset', () => { </s> add test('Bottom inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaBottom: 2 }, { py: 10 }, { top: 10, left: 0, right: 0, bottom: 20 }, { 2: '2', 10: '20' } ) ).toEqual({ pb: '22px' }); }); test('Left inset(boolean)', () => {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/tests/calculatePaddingProps.test.tsx
test('Top inset(number)', () => { expect( calculatePaddingProps( { safeAreaTop: 2 }, {}, { top: 0, left: 0, right: 0, bottom: 0 }, { 2: '2' } ) ).toEqual({ pt: '2px' }); }); test('Top inset(boolean) with padding', () => {
<mask> {} <mask> ) <mask> ).toEqual({ pt: '10px' }); <mask> }); <mask> test('Top inset with padding', () => { <mask> expect( <mask> calculatePaddingProps( <mask> { safeAreaTop: true }, <mask> { pt: 10 }, <mask> { top: 10, left: 0, right: 0, bottom: 0 }, </s> feat: usesafearea props now accept numbers as well </s> remove test('Bottom inset', () => { </s> add test('Top inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaTop: 2 }, { pt: 10 }, { top: 10, left: 0, right: 0, bottom: 0 }, { 2: '2', 10: '10' } ) ).toEqual({ pt: '12px' }); }); test('Bottom inset(boolean)', () => { </s> remove test('Top inset', () => { </s> add test('Generic inset(number)', () => { expect( calculatePaddingProps( { safeArea: 2 }, {}, { top: 0, left: 0, right: 0, bottom: 0 }, { 2: '2' } ) ).toEqual({ pt: '2px', pb: '2px', pl: '2px', pr: '2px' }); }); test('Top inset(boolean)', () => { </s> remove test('All inset with padding', () => { </s> add test('All insets(number)', () => { expect( calculatePaddingProps( { safeArea: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pt: '2px', pb: '2px', pl: '2px', pr: '2px' }); }); test('All insets(boolean) with padding', () => { </s> remove test('Bottom inset with padding', () => { </s> add test('Bottom inset(number)', () => { expect( calculatePaddingProps( { safeAreaBottom: 2 }, {}, { top: 10, left: 0, right: 0, bottom: 20 }, { 2: '2' } ) ).toEqual({ pb: '2px' }); }); test('Bottom inset(boolean) with padding', () => { </s> remove test('Y inset with padding', () => { </s> add test('Y inset(number)', () => { expect( calculatePaddingProps( { safeAreaY: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pt: '2px', pb: '2px' }); }); test('Y insets(boolean) with padding', () => {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/tests/calculatePaddingProps.test.tsx
test('Top inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaTop: 2 }, { pt: 10 }, { top: 10, left: 0, right: 0, bottom: 0 }, { 2: '2', 10: '10' } ) ).toEqual({ pt: '12px' }); }); test('Bottom inset(boolean)', () => {
<mask> { 10: '10' } <mask> ) <mask> ).toEqual({ pt: '20px' }); <mask> }); <mask> test('Bottom inset', () => { <mask> expect( <mask> calculatePaddingProps( <mask> { safeAreaBottom: true }, <mask> {}, <mask> { top: 10, left: 0, right: 0, bottom: 20 }, </s> feat: usesafearea props now accept numbers as well </s> remove test('Bottom inset with padding', () => { </s> add test('Bottom inset(number)', () => { expect( calculatePaddingProps( { safeAreaBottom: 2 }, {}, { top: 10, left: 0, right: 0, bottom: 20 }, { 2: '2' } ) ).toEqual({ pb: '2px' }); }); test('Bottom inset(boolean) with padding', () => { </s> remove test('Left inset', () => { </s> add test('Bottom inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaBottom: 2 }, { py: 10 }, { top: 10, left: 0, right: 0, bottom: 20 }, { 2: '2', 10: '20' } ) ).toEqual({ pb: '22px' }); }); test('Left inset(boolean)', () => { </s> remove { 10: '20' } </s> add { 2: '2', 10: '20' } </s> remove test('All insets', () => { </s> add test('Y insets(number) with padding', () => { expect( calculatePaddingProps( { safeAreaY: 2 }, { p: 10 }, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2', 10: '10' } ) ).toEqual({ pt: '12px', pb: '12px' }); }); test('All insets(boolean)', () => { </s> remove test('Top inset', () => { </s> add test('Generic inset(number)', () => { expect( calculatePaddingProps( { safeArea: 2 }, {}, { top: 0, left: 0, right: 0, bottom: 0 }, { 2: '2' } ) ).toEqual({ pt: '2px', pb: '2px', pl: '2px', pr: '2px' }); }); test('Top inset(boolean)', () => {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/tests/calculatePaddingProps.test.tsx
test('Bottom inset(number)', () => { expect( calculatePaddingProps( { safeAreaBottom: 2 }, {}, { top: 10, left: 0, right: 0, bottom: 20 }, { 2: '2' } ) ).toEqual({ pb: '2px' }); }); test('Bottom inset(boolean) with padding', () => {
<mask> {} <mask> ) <mask> ).toEqual({ pb: '20px' }); <mask> }); <mask> test('Bottom inset with padding', () => { <mask> expect( <mask> calculatePaddingProps( <mask> { safeAreaBottom: true }, <mask> { py: 10 }, <mask> { top: 10, left: 0, right: 0, bottom: 20 }, </s> feat: usesafearea props now accept numbers as well </s> remove test('Left inset', () => { </s> add test('Bottom inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaBottom: 2 }, { py: 10 }, { top: 10, left: 0, right: 0, bottom: 20 }, { 2: '2', 10: '20' } ) ).toEqual({ pb: '22px' }); }); test('Left inset(boolean)', () => { </s> remove test('Bottom inset', () => { </s> add test('Top inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaTop: 2 }, { pt: 10 }, { top: 10, left: 0, right: 0, bottom: 0 }, { 2: '2', 10: '10' } ) ).toEqual({ pt: '12px' }); }); test('Bottom inset(boolean)', () => { </s> remove { 10: '20' } </s> add { 2: '2', 10: '20' } </s> remove test('Left inset with padding', () => { </s> add test('Left inset(number)', () => { expect( calculatePaddingProps( { safeAreaLeft: 2 }, {}, { top: 10, left: 20, right: 0, bottom: 20 }, { 2: '2', 10: '20' } ) ).toEqual({ pl: '2px' }); }); test('Left inset(boolean) with padding', () => { </s> remove test('Top inset with padding', () => { </s> add test('Top inset(number)', () => { expect( calculatePaddingProps( { safeAreaTop: 2 }, {}, { top: 0, left: 0, right: 0, bottom: 0 }, { 2: '2' } ) ).toEqual({ pt: '2px' }); }); test('Top inset(boolean) with padding', () => {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/tests/calculatePaddingProps.test.tsx
{ 2: '2', 10: '20' }
<mask> calculatePaddingProps( <mask> { safeAreaBottom: true }, <mask> { py: 10 }, <mask> { top: 10, left: 0, right: 0, bottom: 20 }, <mask> { 10: '20' } <mask> ) <mask> ).toEqual({ pb: '40px' }); <mask> }); <mask> test('Left inset', () => { <mask> expect( </s> feat: usesafearea props now accept numbers as well </s> remove test('Left inset', () => { </s> add test('Bottom inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaBottom: 2 }, { py: 10 }, { top: 10, left: 0, right: 0, bottom: 20 }, { 2: '2', 10: '20' } ) ).toEqual({ pb: '22px' }); }); test('Left inset(boolean)', () => { </s> remove test('Bottom inset with padding', () => { </s> add test('Bottom inset(number)', () => { expect( calculatePaddingProps( { safeAreaBottom: 2 }, {}, { top: 10, left: 0, right: 0, bottom: 20 }, { 2: '2' } ) ).toEqual({ pb: '2px' }); }); test('Bottom inset(boolean) with padding', () => { </s> remove test('Left inset with padding', () => { </s> add test('Left inset(number)', () => { expect( calculatePaddingProps( { safeAreaLeft: 2 }, {}, { top: 10, left: 20, right: 0, bottom: 20 }, { 2: '2', 10: '20' } ) ).toEqual({ pl: '2px' }); }); test('Left inset(boolean) with padding', () => { </s> remove test('Right inset', () => { </s> add test('Left inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaLeft: 2 }, { py: 10, pl: 20 }, { top: 10, left: 20, right: 0, bottom: 20 }, { 2: '2', 20: '20' } ) ).toEqual({ pl: '22px' }); }); test('Right inset(boolean)', () => { </s> remove test('Bottom inset', () => { </s> add test('Top inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaTop: 2 }, { pt: 10 }, { top: 10, left: 0, right: 0, bottom: 0 }, { 2: '2', 10: '10' } ) ).toEqual({ pt: '12px' }); }); test('Bottom inset(boolean)', () => {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/tests/calculatePaddingProps.test.tsx
test('Bottom inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaBottom: 2 }, { py: 10 }, { top: 10, left: 0, right: 0, bottom: 20 }, { 2: '2', 10: '20' } ) ).toEqual({ pb: '22px' }); }); test('Left inset(boolean)', () => {
<mask> { 10: '20' } <mask> ) <mask> ).toEqual({ pb: '40px' }); <mask> }); <mask> test('Left inset', () => { <mask> expect( <mask> calculatePaddingProps( <mask> { safeAreaLeft: true }, <mask> {}, <mask> { top: 10, left: 20, right: 0, bottom: 20 }, </s> feat: usesafearea props now accept numbers as well </s> remove { 10: '20' } </s> add { 2: '2', 10: '20' } </s> remove test('Left inset with padding', () => { </s> add test('Left inset(number)', () => { expect( calculatePaddingProps( { safeAreaLeft: 2 }, {}, { top: 10, left: 20, right: 0, bottom: 20 }, { 2: '2', 10: '20' } ) ).toEqual({ pl: '2px' }); }); test('Left inset(boolean) with padding', () => { </s> remove test('Right inset', () => { </s> add test('Left inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaLeft: 2 }, { py: 10, pl: 20 }, { top: 10, left: 20, right: 0, bottom: 20 }, { 2: '2', 20: '20' } ) ).toEqual({ pl: '22px' }); }); test('Right inset(boolean)', () => { </s> remove test('X inset', () => { </s> add test('Right inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaRight: 2 }, { pr: 20 }, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2', 20: '20' } ) ).toEqual({ pr: '22px' }); }); test('X inset(boolean)', () => { </s> remove test('Y inset', () => { </s> add test('X insets(number) with padding', () => { expect( calculatePaddingProps( { safeAreaX: 2 }, { px: 20 }, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2', 20: '20' } ) ).toEqual({ pl: '22px', pr: '22px' }); }); test('Y inset(boolean)', () => {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/tests/calculatePaddingProps.test.tsx
test('Left inset(number)', () => { expect( calculatePaddingProps( { safeAreaLeft: 2 }, {}, { top: 10, left: 20, right: 0, bottom: 20 }, { 2: '2', 10: '20' } ) ).toEqual({ pl: '2px' }); }); test('Left inset(boolean) with padding', () => {
<mask> {} <mask> ) <mask> ).toEqual({ pl: '20px' }); <mask> }); <mask> test('Left inset with padding', () => { <mask> expect( <mask> calculatePaddingProps( <mask> { safeAreaLeft: true }, <mask> { py: 10, pl: 20 }, <mask> { top: 10, left: 20, right: 0, bottom: 20 }, </s> feat: usesafearea props now accept numbers as well </s> remove test('Right inset', () => { </s> add test('Left inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaLeft: 2 }, { py: 10, pl: 20 }, { top: 10, left: 20, right: 0, bottom: 20 }, { 2: '2', 20: '20' } ) ).toEqual({ pl: '22px' }); }); test('Right inset(boolean)', () => { </s> remove test('X inset with padding', () => { </s> add test('X inset(number)', () => { expect( calculatePaddingProps( { safeAreaX: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pl: '2px', pr: '2px' }); }); test('X insets(boolean) with padding', () => { </s> remove test('Left inset', () => { </s> add test('Bottom inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaBottom: 2 }, { py: 10 }, { top: 10, left: 0, right: 0, bottom: 20 }, { 2: '2', 10: '20' } ) ).toEqual({ pb: '22px' }); }); test('Left inset(boolean)', () => { </s> remove test('All inset with padding', () => { </s> add test('All insets(number)', () => { expect( calculatePaddingProps( { safeArea: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pt: '2px', pb: '2px', pl: '2px', pr: '2px' }); }); test('All insets(boolean) with padding', () => { </s> remove test('Bottom inset with padding', () => { </s> add test('Bottom inset(number)', () => { expect( calculatePaddingProps( { safeAreaBottom: 2 }, {}, { top: 10, left: 0, right: 0, bottom: 20 }, { 2: '2' } ) ).toEqual({ pb: '2px' }); }); test('Bottom inset(boolean) with padding', () => {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/tests/calculatePaddingProps.test.tsx
test('Left inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaLeft: 2 }, { py: 10, pl: 20 }, { top: 10, left: 20, right: 0, bottom: 20 }, { 2: '2', 20: '20' } ) ).toEqual({ pl: '22px' }); }); test('Right inset(boolean)', () => {
<mask> { 20: '20' } <mask> ) <mask> ).toEqual({ pl: '40px' }); <mask> }); <mask> test('Right inset', () => { <mask> expect( <mask> calculatePaddingProps( <mask> { safeAreaRight: true }, <mask> {}, <mask> { top: 10, left: 20, right: 20, bottom: 20 }, </s> feat: usesafearea props now accept numbers as well </s> remove test('X inset', () => { </s> add test('Right inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaRight: 2 }, { pr: 20 }, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2', 20: '20' } ) ).toEqual({ pr: '22px' }); }); test('X inset(boolean)', () => { </s> remove test('Y inset', () => { </s> add test('X insets(number) with padding', () => { expect( calculatePaddingProps( { safeAreaX: 2 }, { px: 20 }, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2', 20: '20' } ) ).toEqual({ pl: '22px', pr: '22px' }); }); test('Y inset(boolean)', () => { </s> remove test('Right inset with padding', () => { </s> add test('Right inset(number)', () => { expect( calculatePaddingProps( { safeAreaRight: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pr: '2px' }); }); test('Right inset(boolean) with padding', () => { </s> remove test('Left inset', () => { </s> add test('Bottom inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaBottom: 2 }, { py: 10 }, { top: 10, left: 0, right: 0, bottom: 20 }, { 2: '2', 10: '20' } ) ).toEqual({ pb: '22px' }); }); test('Left inset(boolean)', () => { </s> remove test('Left inset with padding', () => { </s> add test('Left inset(number)', () => { expect( calculatePaddingProps( { safeAreaLeft: 2 }, {}, { top: 10, left: 20, right: 0, bottom: 20 }, { 2: '2', 10: '20' } ) ).toEqual({ pl: '2px' }); }); test('Left inset(boolean) with padding', () => {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/tests/calculatePaddingProps.test.tsx
test('Right inset(number)', () => { expect( calculatePaddingProps( { safeAreaRight: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pr: '2px' }); }); test('Right inset(boolean) with padding', () => {
<mask> {} <mask> ) <mask> ).toEqual({ pr: '20px' }); <mask> }); <mask> test('Right inset with padding', () => { <mask> expect( <mask> calculatePaddingProps( <mask> { safeAreaRight: true }, <mask> { pr: 20 }, <mask> { top: 10, left: 20, right: 20, bottom: 20 }, </s> feat: usesafearea props now accept numbers as well </s> remove test('X inset', () => { </s> add test('Right inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaRight: 2 }, { pr: 20 }, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2', 20: '20' } ) ).toEqual({ pr: '22px' }); }); test('X inset(boolean)', () => { </s> remove test('X inset with padding', () => { </s> add test('X inset(number)', () => { expect( calculatePaddingProps( { safeAreaX: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pl: '2px', pr: '2px' }); }); test('X insets(boolean) with padding', () => { </s> remove test('All inset with padding', () => { </s> add test('All insets(number)', () => { expect( calculatePaddingProps( { safeArea: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pt: '2px', pb: '2px', pl: '2px', pr: '2px' }); }); test('All insets(boolean) with padding', () => { </s> remove test('Right inset', () => { </s> add test('Left inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaLeft: 2 }, { py: 10, pl: 20 }, { top: 10, left: 20, right: 0, bottom: 20 }, { 2: '2', 20: '20' } ) ).toEqual({ pl: '22px' }); }); test('Right inset(boolean)', () => { </s> remove test('Y inset', () => { </s> add test('X insets(number) with padding', () => { expect( calculatePaddingProps( { safeAreaX: 2 }, { px: 20 }, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2', 20: '20' } ) ).toEqual({ pl: '22px', pr: '22px' }); }); test('Y inset(boolean)', () => {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/tests/calculatePaddingProps.test.tsx
test('Right inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaRight: 2 }, { pr: 20 }, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2', 20: '20' } ) ).toEqual({ pr: '22px' }); }); test('X inset(boolean)', () => {
<mask> { 20: '20' } <mask> ) <mask> ).toEqual({ pr: '40px' }); <mask> }); <mask> test('X inset', () => { <mask> expect( <mask> calculatePaddingProps( <mask> { safeAreaX: true }, <mask> {}, <mask> { top: 10, left: 20, right: 20, bottom: 20 }, </s> feat: usesafearea props now accept numbers as well </s> remove test('Y inset', () => { </s> add test('X insets(number) with padding', () => { expect( calculatePaddingProps( { safeAreaX: 2 }, { px: 20 }, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2', 20: '20' } ) ).toEqual({ pl: '22px', pr: '22px' }); }); test('Y inset(boolean)', () => { </s> remove test('X inset with padding', () => { </s> add test('X inset(number)', () => { expect( calculatePaddingProps( { safeAreaX: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pl: '2px', pr: '2px' }); }); test('X insets(boolean) with padding', () => { </s> remove test('Right inset', () => { </s> add test('Left inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaLeft: 2 }, { py: 10, pl: 20 }, { top: 10, left: 20, right: 0, bottom: 20 }, { 2: '2', 20: '20' } ) ).toEqual({ pl: '22px' }); }); test('Right inset(boolean)', () => { </s> remove test('Left inset', () => { </s> add test('Bottom inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaBottom: 2 }, { py: 10 }, { top: 10, left: 0, right: 0, bottom: 20 }, { 2: '2', 10: '20' } ) ).toEqual({ pb: '22px' }); }); test('Left inset(boolean)', () => { </s> remove test('Right inset with padding', () => { </s> add test('Right inset(number)', () => { expect( calculatePaddingProps( { safeAreaRight: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pr: '2px' }); }); test('Right inset(boolean) with padding', () => {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/tests/calculatePaddingProps.test.tsx
test('X inset(number)', () => { expect( calculatePaddingProps( { safeAreaX: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pl: '2px', pr: '2px' }); }); test('X insets(boolean) with padding', () => {
<mask> {} <mask> ) <mask> ).toEqual({ pl: '20px', pr: '20px' }); <mask> }); <mask> test('X inset with padding', () => { <mask> expect( <mask> calculatePaddingProps( <mask> { safeAreaX: true }, <mask> { px: 20 }, <mask> { top: 10, left: 20, right: 20, bottom: 20 }, </s> feat: usesafearea props now accept numbers as well </s> remove test('Y inset', () => { </s> add test('X insets(number) with padding', () => { expect( calculatePaddingProps( { safeAreaX: 2 }, { px: 20 }, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2', 20: '20' } ) ).toEqual({ pl: '22px', pr: '22px' }); }); test('Y inset(boolean)', () => { </s> remove test('All inset with padding', () => { </s> add test('All insets(number)', () => { expect( calculatePaddingProps( { safeArea: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pt: '2px', pb: '2px', pl: '2px', pr: '2px' }); }); test('All insets(boolean) with padding', () => { </s> remove test('X inset', () => { </s> add test('Right inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaRight: 2 }, { pr: 20 }, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2', 20: '20' } ) ).toEqual({ pr: '22px' }); }); test('X inset(boolean)', () => { </s> remove test('Right inset with padding', () => { </s> add test('Right inset(number)', () => { expect( calculatePaddingProps( { safeAreaRight: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pr: '2px' }); }); test('Right inset(boolean) with padding', () => { </s> remove test('Left inset with padding', () => { </s> add test('Left inset(number)', () => { expect( calculatePaddingProps( { safeAreaLeft: 2 }, {}, { top: 10, left: 20, right: 0, bottom: 20 }, { 2: '2', 10: '20' } ) ).toEqual({ pl: '2px' }); }); test('Left inset(boolean) with padding', () => {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/tests/calculatePaddingProps.test.tsx
test('X insets(number) with padding', () => { expect( calculatePaddingProps( { safeAreaX: 2 }, { px: 20 }, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2', 20: '20' } ) ).toEqual({ pl: '22px', pr: '22px' }); }); test('Y inset(boolean)', () => {
<mask> { 20: '20' } <mask> ) <mask> ).toEqual({ pl: '40px', pr: '40px' }); <mask> }); <mask> test('Y inset', () => { <mask> expect( <mask> calculatePaddingProps( <mask> { safeAreaY: true }, <mask> {}, <mask> { top: 10, left: 20, right: 20, bottom: 20 }, </s> feat: usesafearea props now accept numbers as well </s> remove test('X inset', () => { </s> add test('Right inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaRight: 2 }, { pr: 20 }, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2', 20: '20' } ) ).toEqual({ pr: '22px' }); }); test('X inset(boolean)', () => { </s> remove test('Right inset', () => { </s> add test('Left inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaLeft: 2 }, { py: 10, pl: 20 }, { top: 10, left: 20, right: 0, bottom: 20 }, { 2: '2', 20: '20' } ) ).toEqual({ pl: '22px' }); }); test('Right inset(boolean)', () => { </s> remove test('Y inset with padding', () => { </s> add test('Y inset(number)', () => { expect( calculatePaddingProps( { safeAreaY: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pt: '2px', pb: '2px' }); }); test('Y insets(boolean) with padding', () => { </s> remove test('X inset with padding', () => { </s> add test('X inset(number)', () => { expect( calculatePaddingProps( { safeAreaX: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pl: '2px', pr: '2px' }); }); test('X insets(boolean) with padding', () => { </s> remove test('All insets', () => { </s> add test('Y insets(number) with padding', () => { expect( calculatePaddingProps( { safeAreaY: 2 }, { p: 10 }, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2', 10: '10' } ) ).toEqual({ pt: '12px', pb: '12px' }); }); test('All insets(boolean)', () => {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/tests/calculatePaddingProps.test.tsx
test('Y inset(number)', () => { expect( calculatePaddingProps( { safeAreaY: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pt: '2px', pb: '2px' }); }); test('Y insets(boolean) with padding', () => {
<mask> {} <mask> ) <mask> ).toEqual({ pt: '10px', pb: '20px' }); <mask> }); <mask> test('Y inset with padding', () => { <mask> expect( <mask> calculatePaddingProps( <mask> { safeAreaY: true }, <mask> { p: 10 }, <mask> { top: 10, left: 20, right: 20, bottom: 20 }, </s> feat: usesafearea props now accept numbers as well </s> remove test('All insets', () => { </s> add test('Y insets(number) with padding', () => { expect( calculatePaddingProps( { safeAreaY: 2 }, { p: 10 }, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2', 10: '10' } ) ).toEqual({ pt: '12px', pb: '12px' }); }); test('All insets(boolean)', () => { </s> remove test('All inset with padding', () => { </s> add test('All insets(number)', () => { expect( calculatePaddingProps( { safeArea: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pt: '2px', pb: '2px', pl: '2px', pr: '2px' }); }); test('All insets(boolean) with padding', () => { </s> remove test('Y inset', () => { </s> add test('X insets(number) with padding', () => { expect( calculatePaddingProps( { safeAreaX: 2 }, { px: 20 }, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2', 20: '20' } ) ).toEqual({ pl: '22px', pr: '22px' }); }); test('Y inset(boolean)', () => { </s> remove test('Right inset with padding', () => { </s> add test('Right inset(number)', () => { expect( calculatePaddingProps( { safeAreaRight: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pr: '2px' }); }); test('Right inset(boolean) with padding', () => { </s> remove test('X inset with padding', () => { </s> add test('X inset(number)', () => { expect( calculatePaddingProps( { safeAreaX: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pl: '2px', pr: '2px' }); }); test('X insets(boolean) with padding', () => {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/tests/calculatePaddingProps.test.tsx
test('Y insets(number) with padding', () => { expect( calculatePaddingProps( { safeAreaY: 2 }, { p: 10 }, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2', 10: '10' } ) ).toEqual({ pt: '12px', pb: '12px' }); }); test('All insets(boolean)', () => {
<mask> { 10: '10' } <mask> ) <mask> ).toEqual({ pt: '20px', pb: '30px' }); <mask> }); <mask> test('All insets', () => { <mask> expect( <mask> calculatePaddingProps( <mask> { safeArea: true }, <mask> {}, <mask> { top: 10, left: 20, right: 20, bottom: 20 }, </s> feat: usesafearea props now accept numbers as well </s> remove test('All inset with padding', () => { </s> add test('All insets(number)', () => { expect( calculatePaddingProps( { safeArea: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pt: '2px', pb: '2px', pl: '2px', pr: '2px' }); }); test('All insets(boolean) with padding', () => { </s> remove test('Bottom inset', () => { </s> add test('Top inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaTop: 2 }, { pt: 10 }, { top: 10, left: 0, right: 0, bottom: 0 }, { 2: '2', 10: '10' } ) ).toEqual({ pt: '12px' }); }); test('Bottom inset(boolean)', () => { </s> remove test('Y inset with padding', () => { </s> add test('Y inset(number)', () => { expect( calculatePaddingProps( { safeAreaY: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pt: '2px', pb: '2px' }); }); test('Y insets(boolean) with padding', () => { </s> remove test('Left inset', () => { </s> add test('Bottom inset(number) with padding', () => { expect( calculatePaddingProps( { safeAreaBottom: 2 }, { py: 10 }, { top: 10, left: 0, right: 0, bottom: 20 }, { 2: '2', 10: '20' } ) ).toEqual({ pb: '22px' }); }); test('Left inset(boolean)', () => { </s> remove test('X inset with padding', () => { </s> add test('X inset(number)', () => { expect( calculatePaddingProps( { safeAreaX: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pl: '2px', pr: '2px' }); }); test('X insets(boolean) with padding', () => {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/tests/calculatePaddingProps.test.tsx
test('All insets(number)', () => { expect( calculatePaddingProps( { safeArea: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pt: '2px', pb: '2px', pl: '2px', pr: '2px' }); }); test('All insets(boolean) with padding', () => {
<mask> {} <mask> ) <mask> ).toEqual({ pt: '10px', pb: '20px', pl: '20px', pr: '20px' }); <mask> }); <mask> test('All inset with padding', () => { <mask> expect( <mask> calculatePaddingProps( <mask> { safeArea: true }, <mask> { pt: 10 }, <mask> { top: 10, left: 20, right: 20, bottom: 20 }, </s> feat: usesafearea props now accept numbers as well </s> remove test('All insets', () => { </s> add test('Y insets(number) with padding', () => { expect( calculatePaddingProps( { safeAreaY: 2 }, { p: 10 }, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2', 10: '10' } ) ).toEqual({ pt: '12px', pb: '12px' }); }); test('All insets(boolean)', () => { </s> remove test('Y inset with padding', () => { </s> add test('Y inset(number)', () => { expect( calculatePaddingProps( { safeAreaY: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pt: '2px', pb: '2px' }); }); test('Y insets(boolean) with padding', () => { </s> remove test('X inset with padding', () => { </s> add test('X inset(number)', () => { expect( calculatePaddingProps( { safeAreaX: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pl: '2px', pr: '2px' }); }); test('X insets(boolean) with padding', () => { </s> remove test('Right inset with padding', () => { </s> add test('Right inset(number)', () => { expect( calculatePaddingProps( { safeAreaRight: 2 }, {}, { top: 10, left: 20, right: 20, bottom: 20 }, { 2: '2' } ) ).toEqual({ pr: '2px' }); }); test('Right inset(boolean) with padding', () => { </s> remove test('Left inset with padding', () => { </s> add test('Left inset(number)', () => { expect( calculatePaddingProps( { safeAreaLeft: 2 }, {}, { top: 10, left: 20, right: 0, bottom: 20 }, { 2: '2', 10: '20' } ) ).toEqual({ pl: '2px' }); }); test('Left inset(boolean) with padding', () => {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/tests/calculatePaddingProps.test.tsx
import isNil from 'lodash/isNil';
<mask> import { themeTools } from '../../theme'; <mask> import type { SafeAreaProps } from './../../utils/customProps'; <mask> <mask> export function calculatePaddingProps( <mask> safeAreaProps: SafeAreaProps, <mask> paddingProps: any, <mask> insets: any, </s> feat: usesafearea props now accept numbers as well </s> remove test('Empty', () => { </s> add test('Generic inset(boolean)', () => { </s> remove return getValueInPixels(paddingProps, propKeys, sizes, insets.left); </s> add return getValueInPixels( paddingProps, propKeys, sizes, insets.left, manualInset ); </s> remove return getValueInPixels(paddingProps, propKeys, sizes, insets.bottom); </s> add return getValueInPixels( paddingProps, propKeys, sizes, insets.bottom, manualInset ); </s> remove return getValueInPixels(paddingProps, propKeys, sizes, insets.top); </s> add return getValueInPixels( paddingProps, propKeys, sizes, insets.top, manualInset ); </s> remove ? parseInt(originalValue, 10) + inset + 'px' : inset + 'px'; </s> add ? parseInt(originalValue, 10) + parseInt(appliedInset, 10) + 'px' : parseInt(appliedInset, 10) + 'px';
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/useSafeArea/utils.ts
inset: any, manualInset: number | string
<mask> function getValueInPixels( <mask> paddingProps: any, <mask> propKeys: any, <mask> sizes: any, <mask> inset: any <mask> ) { <mask> const originalValue = propKeys.length <mask> ? sizes[paddingProps[propKeys[propKeys.length - 1]]] <mask> : 0; <mask> return originalValue </s> feat: usesafearea props now accept numbers as well </s> remove const originalValue = propKeys.length </s> add let appliedInset: any = 0; let originalValue = propKeys.length </s> remove ? parseInt(originalValue, 10) + inset + 'px' : inset + 'px'; </s> add ? parseInt(originalValue, 10) + parseInt(appliedInset, 10) + 'px' : parseInt(appliedInset, 10) + 'px'; </s> remove return getValueInPixels(paddingProps, propKeys, sizes, insets.left); </s> add return getValueInPixels( paddingProps, propKeys, sizes, insets.left, manualInset ); </s> remove return getValueInPixels(paddingProps, propKeys, sizes, insets.bottom); </s> add return getValueInPixels( paddingProps, propKeys, sizes, insets.bottom, manualInset );
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/useSafeArea/utils.ts
let appliedInset: any = 0; let originalValue = propKeys.length
<mask> propKeys: any, <mask> sizes: any, <mask> inset: any <mask> ) { <mask> const originalValue = propKeys.length <mask> ? sizes[paddingProps[propKeys[propKeys.length - 1]]] <mask> : 0; <mask> return originalValue <mask> ? parseInt(originalValue, 10) + inset + 'px' <mask> : inset + 'px'; </s> feat: usesafearea props now accept numbers as well </s> remove ? parseInt(originalValue, 10) + inset + 'px' : inset + 'px'; </s> add ? parseInt(originalValue, 10) + parseInt(appliedInset, 10) + 'px' : parseInt(appliedInset, 10) + 'px'; </s> remove inset: any </s> add inset: any, manualInset: number | string </s> remove if (!insets.right) { </s> add // DOC: Adding it for manual inset passed by the user let [rightSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaX', 'safeAreaRight', ]); let rightSafeAreaArray = Object.keys(rightSafeAreaProps); const manualInset = rightSafeAreaArray.length ? rightSafeAreaProps[rightSafeAreaArray[rightSafeAreaArray.length - 1]] : undefined; if (!insets.right && (!manualInset || typeof manualInset === 'boolean')) { </s> remove if (!insets.top) { </s> add // DOC: Adding it for manual inset passed by the user let [topSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaY', 'safeAreaTop', ]); let topSafeAreaArray = Object.keys(topSafeAreaProps); const manualInset = topSafeAreaArray.length ? topSafeAreaProps[topSafeAreaArray[topSafeAreaArray.length - 1]] : undefined; if (!insets.top && (!manualInset || typeof manualInset === 'boolean')) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/useSafeArea/utils.ts
if (!isNil(manualInset) && typeof manualInset !== 'boolean') { appliedInset = typeof manualInset === 'string' && manualInset.includes('px') ? parseInt(manualInset, 10) : sizes[manualInset]; } else { appliedInset = inset; }
<mask> let originalValue = propKeys.length <mask> ? sizes[paddingProps[propKeys[propKeys.length - 1]]] <mask> : 0; <mask> return originalValue <mask> ? parseInt(originalValue, 10) + parseInt(appliedInset, 10) + 'px' <mask> : parseInt(appliedInset, 10) + 'px'; <mask> } <mask> </s> feat: usesafearea props now accept numbers as well </s> remove ? parseInt(originalValue, 10) + inset + 'px' : inset + 'px'; </s> add ? parseInt(originalValue, 10) + parseInt(appliedInset, 10) + 'px' : parseInt(appliedInset, 10) + 'px'; </s> remove const originalValue = propKeys.length </s> add let appliedInset: any = 0; let originalValue = propKeys.length </s> remove inset: any </s> add inset: any, manualInset: number | string </s> remove if (!insets.left) { </s> add let [leftSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaLeft', 'safeAreaX', ]); let leftSafeAreaArray = Object.keys(leftSafeAreaProps); const manualInset = leftSafeAreaArray.length ? leftSafeAreaProps[leftSafeAreaArray[leftSafeAreaArray.length - 1]] : undefined; if (!insets.left && (!manualInset || typeof manualInset === 'boolean')) { </s> remove if (!insets.bottom) { </s> add let [bottomSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaY', 'safeAreaBottom', ]); let bottomSafeAreaArray = Object.keys(bottomSafeAreaProps); const manualInset = bottomSafeAreaArray.length ? bottomSafeAreaProps[bottomSafeAreaArray[bottomSafeAreaArray.length - 1]] : undefined; if (!insets.bottom && (!manualInset || typeof manualInset === 'boolean')) {
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/useSafeArea/utils.ts
? parseInt(originalValue, 10) + parseInt(appliedInset, 10) + 'px' : parseInt(appliedInset, 10) + 'px';
<mask> const originalValue = propKeys.length <mask> ? sizes[paddingProps[propKeys[propKeys.length - 1]]] <mask> : 0; <mask> return originalValue <mask> ? parseInt(originalValue, 10) + inset + 'px' <mask> : inset + 'px'; <mask> } <mask> <mask> export function calculatePaddingTop( <mask> safeAreaProps: SafeAreaProps, <mask> paddingProps: any, </s> feat: usesafearea props now accept numbers as well </s> remove const originalValue = propKeys.length </s> add let appliedInset: any = 0; let originalValue = propKeys.length </s> remove inset: any </s> add inset: any, manualInset: number | string </s> remove return getValueInPixels(paddingProps, propKeys, sizes, insets.left); </s> add return getValueInPixels( paddingProps, propKeys, sizes, insets.left, manualInset ); </s> remove return getValueInPixels(paddingProps, propKeys, sizes, insets.bottom); </s> add return getValueInPixels( paddingProps, propKeys, sizes, insets.bottom, manualInset );
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/useSafeArea/utils.ts
isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaTop) && isNil(safeAreaProps.safeAreaY)
<mask> insets: any, <mask> sizes: any <mask> ) { <mask> if ( <mask> !safeAreaProps.safeArea && <mask> !safeAreaProps.safeAreaTop && <mask> !safeAreaProps.safeAreaY <mask> ) { <mask> return; <mask> } <mask> if (!insets.top) { <mask> return; </s> feat: usesafearea props now accept numbers as well </s> remove !safeAreaProps.safeArea && !safeAreaProps.safeAreaBottom && !safeAreaProps.safeAreaY </s> add isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaBottom) && isNil(safeAreaProps.safeAreaY) </s> remove !safeAreaProps.safeArea && !safeAreaProps.safeAreaRight && !safeAreaProps.safeAreaX </s> add isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaRight) && isNil(safeAreaProps.safeAreaX) </s> remove !safeAreaProps.safeArea && !safeAreaProps.safeAreaLeft && !safeAreaProps.safeAreaX </s> add isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaLeft) && isNil(safeAreaProps.safeAreaX) </s> remove if (!insets.top) { </s> add // DOC: Adding it for manual inset passed by the user let [topSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaY', 'safeAreaTop', ]); let topSafeAreaArray = Object.keys(topSafeAreaProps); const manualInset = topSafeAreaArray.length ? topSafeAreaProps[topSafeAreaArray[topSafeAreaArray.length - 1]] : undefined; if (!insets.top && (!manualInset || typeof manualInset === 'boolean')) { </s> remove if (!insets.bottom) { </s> add let [bottomSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaY', 'safeAreaBottom', ]); let bottomSafeAreaArray = Object.keys(bottomSafeAreaProps); const manualInset = bottomSafeAreaArray.length ? bottomSafeAreaProps[bottomSafeAreaArray[bottomSafeAreaArray.length - 1]] : undefined; if (!insets.bottom && (!manualInset || typeof manualInset === 'boolean')) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/useSafeArea/utils.ts
// DOC: Adding it for manual inset passed by the user let [topSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaY', 'safeAreaTop', ]); let topSafeAreaArray = Object.keys(topSafeAreaProps); const manualInset = topSafeAreaArray.length ? topSafeAreaProps[topSafeAreaArray[topSafeAreaArray.length - 1]] : undefined; if (!insets.top && (!manualInset || typeof manualInset === 'boolean')) {
<mask> !safeAreaProps.safeAreaY <mask> ) { <mask> return; <mask> } <mask> if (!insets.top) { <mask> return; <mask> } <mask> const propKeys = getRelatedPaddingProps(paddingProps, [ <mask> 'p', <mask> 'padding', </s> feat: usesafearea props now accept numbers as well </s> remove if (!insets.bottom) { </s> add let [bottomSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaY', 'safeAreaBottom', ]); let bottomSafeAreaArray = Object.keys(bottomSafeAreaProps); const manualInset = bottomSafeAreaArray.length ? bottomSafeAreaProps[bottomSafeAreaArray[bottomSafeAreaArray.length - 1]] : undefined; if (!insets.bottom && (!manualInset || typeof manualInset === 'boolean')) { </s> remove if (!insets.right) { </s> add // DOC: Adding it for manual inset passed by the user let [rightSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaX', 'safeAreaRight', ]); let rightSafeAreaArray = Object.keys(rightSafeAreaProps); const manualInset = rightSafeAreaArray.length ? rightSafeAreaProps[rightSafeAreaArray[rightSafeAreaArray.length - 1]] : undefined; if (!insets.right && (!manualInset || typeof manualInset === 'boolean')) { </s> remove if (!insets.left) { </s> add let [leftSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaLeft', 'safeAreaX', ]); let leftSafeAreaArray = Object.keys(leftSafeAreaProps); const manualInset = leftSafeAreaArray.length ? leftSafeAreaProps[leftSafeAreaArray[leftSafeAreaArray.length - 1]] : undefined; if (!insets.left && (!manualInset || typeof manualInset === 'boolean')) { </s> remove !safeAreaProps.safeArea && !safeAreaProps.safeAreaTop && !safeAreaProps.safeAreaY </s> add isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaTop) && isNil(safeAreaProps.safeAreaY) </s> remove !safeAreaProps.safeArea && !safeAreaProps.safeAreaBottom && !safeAreaProps.safeAreaY </s> add isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaBottom) && isNil(safeAreaProps.safeAreaY)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/useSafeArea/utils.ts
return getValueInPixels( paddingProps, propKeys, sizes, insets.top, manualInset );
<mask> 'paddingTop', <mask> 'py', <mask> 'paddingY', <mask> ]); <mask> <mask> return getValueInPixels(paddingProps, propKeys, sizes, insets.top); <mask> } <mask> export function calculatePaddingBottom( <mask> safeAreaProps: SafeAreaProps, <mask> paddingProps: any, <mask> insets: any, </s> feat: usesafearea props now accept numbers as well </s> remove return getValueInPixels(paddingProps, propKeys, sizes, insets.bottom); </s> add return getValueInPixels( paddingProps, propKeys, sizes, insets.bottom, manualInset ); </s> remove return getValueInPixels(paddingProps, propKeys, sizes, insets.left); </s> add return getValueInPixels( paddingProps, propKeys, sizes, insets.left, manualInset ); </s> remove return getValueInPixels(paddingProps, propKeys, sizes, insets.right); </s> add return getValueInPixels( paddingProps, propKeys, sizes, insets.right, manualInset ); </s> remove ? parseInt(originalValue, 10) + inset + 'px' : inset + 'px'; </s> add ? parseInt(originalValue, 10) + parseInt(appliedInset, 10) + 'px' : parseInt(appliedInset, 10) + 'px';
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/useSafeArea/utils.ts
isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaBottom) && isNil(safeAreaProps.safeAreaY)
<mask> insets: any, <mask> sizes: any <mask> ) { <mask> if ( <mask> !safeAreaProps.safeArea && <mask> !safeAreaProps.safeAreaBottom && <mask> !safeAreaProps.safeAreaY <mask> ) { <mask> return; <mask> } <mask> if (!insets.bottom) { <mask> return; </s> feat: usesafearea props now accept numbers as well </s> remove !safeAreaProps.safeArea && !safeAreaProps.safeAreaTop && !safeAreaProps.safeAreaY </s> add isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaTop) && isNil(safeAreaProps.safeAreaY) </s> remove !safeAreaProps.safeArea && !safeAreaProps.safeAreaRight && !safeAreaProps.safeAreaX </s> add isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaRight) && isNil(safeAreaProps.safeAreaX) </s> remove !safeAreaProps.safeArea && !safeAreaProps.safeAreaLeft && !safeAreaProps.safeAreaX </s> add isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaLeft) && isNil(safeAreaProps.safeAreaX) </s> remove if (!insets.bottom) { </s> add let [bottomSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaY', 'safeAreaBottom', ]); let bottomSafeAreaArray = Object.keys(bottomSafeAreaProps); const manualInset = bottomSafeAreaArray.length ? bottomSafeAreaProps[bottomSafeAreaArray[bottomSafeAreaArray.length - 1]] : undefined; if (!insets.bottom && (!manualInset || typeof manualInset === 'boolean')) { </s> remove if (!insets.top) { </s> add // DOC: Adding it for manual inset passed by the user let [topSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaY', 'safeAreaTop', ]); let topSafeAreaArray = Object.keys(topSafeAreaProps); const manualInset = topSafeAreaArray.length ? topSafeAreaProps[topSafeAreaArray[topSafeAreaArray.length - 1]] : undefined; if (!insets.top && (!manualInset || typeof manualInset === 'boolean')) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/useSafeArea/utils.ts
let [bottomSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaY', 'safeAreaBottom', ]); let bottomSafeAreaArray = Object.keys(bottomSafeAreaProps); const manualInset = bottomSafeAreaArray.length ? bottomSafeAreaProps[bottomSafeAreaArray[bottomSafeAreaArray.length - 1]] : undefined; if (!insets.bottom && (!manualInset || typeof manualInset === 'boolean')) {
<mask> !safeAreaProps.safeAreaY <mask> ) { <mask> return; <mask> } <mask> if (!insets.bottom) { <mask> return; <mask> } <mask> const propKeys = getRelatedPaddingProps(paddingProps, [ <mask> 'p', <mask> 'padding', </s> feat: usesafearea props now accept numbers as well </s> remove if (!insets.top) { </s> add // DOC: Adding it for manual inset passed by the user let [topSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaY', 'safeAreaTop', ]); let topSafeAreaArray = Object.keys(topSafeAreaProps); const manualInset = topSafeAreaArray.length ? topSafeAreaProps[topSafeAreaArray[topSafeAreaArray.length - 1]] : undefined; if (!insets.top && (!manualInset || typeof manualInset === 'boolean')) { </s> remove if (!insets.right) { </s> add // DOC: Adding it for manual inset passed by the user let [rightSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaX', 'safeAreaRight', ]); let rightSafeAreaArray = Object.keys(rightSafeAreaProps); const manualInset = rightSafeAreaArray.length ? rightSafeAreaProps[rightSafeAreaArray[rightSafeAreaArray.length - 1]] : undefined; if (!insets.right && (!manualInset || typeof manualInset === 'boolean')) { </s> remove if (!insets.left) { </s> add let [leftSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaLeft', 'safeAreaX', ]); let leftSafeAreaArray = Object.keys(leftSafeAreaProps); const manualInset = leftSafeAreaArray.length ? leftSafeAreaProps[leftSafeAreaArray[leftSafeAreaArray.length - 1]] : undefined; if (!insets.left && (!manualInset || typeof manualInset === 'boolean')) { </s> remove !safeAreaProps.safeArea && !safeAreaProps.safeAreaBottom && !safeAreaProps.safeAreaY </s> add isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaBottom) && isNil(safeAreaProps.safeAreaY) </s> remove !safeAreaProps.safeArea && !safeAreaProps.safeAreaTop && !safeAreaProps.safeAreaY </s> add isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaTop) && isNil(safeAreaProps.safeAreaY)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/useSafeArea/utils.ts
return getValueInPixels( paddingProps, propKeys, sizes, insets.bottom, manualInset );
<mask> 'py', <mask> 'paddingY', <mask> ]); <mask> <mask> return getValueInPixels(paddingProps, propKeys, sizes, insets.bottom); <mask> } <mask> export function calculatePaddingLeft( <mask> safeAreaProps: SafeAreaProps, <mask> paddingProps: any, <mask> insets: any, </s> feat: usesafearea props now accept numbers as well </s> remove return getValueInPixels(paddingProps, propKeys, sizes, insets.top); </s> add return getValueInPixels( paddingProps, propKeys, sizes, insets.top, manualInset ); </s> remove return getValueInPixels(paddingProps, propKeys, sizes, insets.left); </s> add return getValueInPixels( paddingProps, propKeys, sizes, insets.left, manualInset ); </s> remove return getValueInPixels(paddingProps, propKeys, sizes, insets.right); </s> add return getValueInPixels( paddingProps, propKeys, sizes, insets.right, manualInset ); </s> remove ? parseInt(originalValue, 10) + inset + 'px' : inset + 'px'; </s> add ? parseInt(originalValue, 10) + parseInt(appliedInset, 10) + 'px' : parseInt(appliedInset, 10) + 'px';
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/useSafeArea/utils.ts
isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaLeft) && isNil(safeAreaProps.safeAreaX)
<mask> insets: any, <mask> sizes: any <mask> ) { <mask> if ( <mask> !safeAreaProps.safeArea && <mask> !safeAreaProps.safeAreaLeft && <mask> !safeAreaProps.safeAreaX <mask> ) { <mask> return; <mask> } <mask> if (!insets.left) { <mask> return; </s> feat: usesafearea props now accept numbers as well </s> remove !safeAreaProps.safeArea && !safeAreaProps.safeAreaRight && !safeAreaProps.safeAreaX </s> add isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaRight) && isNil(safeAreaProps.safeAreaX) </s> remove !safeAreaProps.safeArea && !safeAreaProps.safeAreaTop && !safeAreaProps.safeAreaY </s> add isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaTop) && isNil(safeAreaProps.safeAreaY) </s> remove !safeAreaProps.safeArea && !safeAreaProps.safeAreaBottom && !safeAreaProps.safeAreaY </s> add isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaBottom) && isNil(safeAreaProps.safeAreaY) </s> remove if (!insets.left) { </s> add let [leftSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaLeft', 'safeAreaX', ]); let leftSafeAreaArray = Object.keys(leftSafeAreaProps); const manualInset = leftSafeAreaArray.length ? leftSafeAreaProps[leftSafeAreaArray[leftSafeAreaArray.length - 1]] : undefined; if (!insets.left && (!manualInset || typeof manualInset === 'boolean')) { </s> remove if (!insets.right) { </s> add // DOC: Adding it for manual inset passed by the user let [rightSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaX', 'safeAreaRight', ]); let rightSafeAreaArray = Object.keys(rightSafeAreaProps); const manualInset = rightSafeAreaArray.length ? rightSafeAreaProps[rightSafeAreaArray[rightSafeAreaArray.length - 1]] : undefined; if (!insets.right && (!manualInset || typeof manualInset === 'boolean')) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/useSafeArea/utils.ts
let [leftSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaLeft', 'safeAreaX', ]); let leftSafeAreaArray = Object.keys(leftSafeAreaProps); const manualInset = leftSafeAreaArray.length ? leftSafeAreaProps[leftSafeAreaArray[leftSafeAreaArray.length - 1]] : undefined; if (!insets.left && (!manualInset || typeof manualInset === 'boolean')) {
<mask> !safeAreaProps.safeAreaX <mask> ) { <mask> return; <mask> } <mask> if (!insets.left) { <mask> return; <mask> } <mask> <mask> const propKeys = getRelatedPaddingProps(paddingProps, [ <mask> 'p', </s> feat: usesafearea props now accept numbers as well </s> remove if (!insets.right) { </s> add // DOC: Adding it for manual inset passed by the user let [rightSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaX', 'safeAreaRight', ]); let rightSafeAreaArray = Object.keys(rightSafeAreaProps); const manualInset = rightSafeAreaArray.length ? rightSafeAreaProps[rightSafeAreaArray[rightSafeAreaArray.length - 1]] : undefined; if (!insets.right && (!manualInset || typeof manualInset === 'boolean')) { </s> remove if (!insets.bottom) { </s> add let [bottomSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaY', 'safeAreaBottom', ]); let bottomSafeAreaArray = Object.keys(bottomSafeAreaProps); const manualInset = bottomSafeAreaArray.length ? bottomSafeAreaProps[bottomSafeAreaArray[bottomSafeAreaArray.length - 1]] : undefined; if (!insets.bottom && (!manualInset || typeof manualInset === 'boolean')) { </s> remove if (!insets.top) { </s> add // DOC: Adding it for manual inset passed by the user let [topSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaY', 'safeAreaTop', ]); let topSafeAreaArray = Object.keys(topSafeAreaProps); const manualInset = topSafeAreaArray.length ? topSafeAreaProps[topSafeAreaArray[topSafeAreaArray.length - 1]] : undefined; if (!insets.top && (!manualInset || typeof manualInset === 'boolean')) { </s> remove !safeAreaProps.safeArea && !safeAreaProps.safeAreaLeft && !safeAreaProps.safeAreaX </s> add isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaLeft) && isNil(safeAreaProps.safeAreaX) </s> remove !safeAreaProps.safeArea && !safeAreaProps.safeAreaRight && !safeAreaProps.safeAreaX </s> add isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaRight) && isNil(safeAreaProps.safeAreaX)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/useSafeArea/utils.ts
return getValueInPixels( paddingProps, propKeys, sizes, insets.left, manualInset );
<mask> 'px', <mask> 'paddingX', <mask> ]); <mask> <mask> return getValueInPixels(paddingProps, propKeys, sizes, insets.left); <mask> } <mask> export function calculatePaddingRight( <mask> safeAreaProps: SafeAreaProps, <mask> paddingProps: any, <mask> insets: any, </s> feat: usesafearea props now accept numbers as well </s> remove return getValueInPixels(paddingProps, propKeys, sizes, insets.bottom); </s> add return getValueInPixels( paddingProps, propKeys, sizes, insets.bottom, manualInset ); </s> remove return getValueInPixels(paddingProps, propKeys, sizes, insets.top); </s> add return getValueInPixels( paddingProps, propKeys, sizes, insets.top, manualInset ); </s> remove return getValueInPixels(paddingProps, propKeys, sizes, insets.right); </s> add return getValueInPixels( paddingProps, propKeys, sizes, insets.right, manualInset ); </s> remove ? parseInt(originalValue, 10) + inset + 'px' : inset + 'px'; </s> add ? parseInt(originalValue, 10) + parseInt(appliedInset, 10) + 'px' : parseInt(appliedInset, 10) + 'px';
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/useSafeArea/utils.ts
isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaRight) && isNil(safeAreaProps.safeAreaX)
<mask> insets: any, <mask> sizes: any <mask> ) { <mask> if ( <mask> !safeAreaProps.safeArea && <mask> !safeAreaProps.safeAreaRight && <mask> !safeAreaProps.safeAreaX <mask> ) { <mask> return; <mask> } <mask> if (!insets.right) { <mask> return; </s> feat: usesafearea props now accept numbers as well </s> remove !safeAreaProps.safeArea && !safeAreaProps.safeAreaLeft && !safeAreaProps.safeAreaX </s> add isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaLeft) && isNil(safeAreaProps.safeAreaX) </s> remove !safeAreaProps.safeArea && !safeAreaProps.safeAreaTop && !safeAreaProps.safeAreaY </s> add isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaTop) && isNil(safeAreaProps.safeAreaY) </s> remove !safeAreaProps.safeArea && !safeAreaProps.safeAreaBottom && !safeAreaProps.safeAreaY </s> add isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaBottom) && isNil(safeAreaProps.safeAreaY) </s> remove if (!insets.right) { </s> add // DOC: Adding it for manual inset passed by the user let [rightSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaX', 'safeAreaRight', ]); let rightSafeAreaArray = Object.keys(rightSafeAreaProps); const manualInset = rightSafeAreaArray.length ? rightSafeAreaProps[rightSafeAreaArray[rightSafeAreaArray.length - 1]] : undefined; if (!insets.right && (!manualInset || typeof manualInset === 'boolean')) { </s> remove if (!insets.left) { </s> add let [leftSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaLeft', 'safeAreaX', ]); let leftSafeAreaArray = Object.keys(leftSafeAreaProps); const manualInset = leftSafeAreaArray.length ? leftSafeAreaProps[leftSafeAreaArray[leftSafeAreaArray.length - 1]] : undefined; if (!insets.left && (!manualInset || typeof manualInset === 'boolean')) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/useSafeArea/utils.ts
// DOC: Adding it for manual inset passed by the user let [rightSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaX', 'safeAreaRight', ]); let rightSafeAreaArray = Object.keys(rightSafeAreaProps); const manualInset = rightSafeAreaArray.length ? rightSafeAreaProps[rightSafeAreaArray[rightSafeAreaArray.length - 1]] : undefined; if (!insets.right && (!manualInset || typeof manualInset === 'boolean')) {
<mask> !safeAreaProps.safeAreaX <mask> ) { <mask> return; <mask> } <mask> if (!insets.right) { <mask> return; <mask> } <mask> const propKeys = getRelatedPaddingProps(paddingProps, [ <mask> 'p', <mask> 'padding', </s> feat: usesafearea props now accept numbers as well </s> remove if (!insets.bottom) { </s> add let [bottomSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaY', 'safeAreaBottom', ]); let bottomSafeAreaArray = Object.keys(bottomSafeAreaProps); const manualInset = bottomSafeAreaArray.length ? bottomSafeAreaProps[bottomSafeAreaArray[bottomSafeAreaArray.length - 1]] : undefined; if (!insets.bottom && (!manualInset || typeof manualInset === 'boolean')) { </s> remove if (!insets.left) { </s> add let [leftSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaLeft', 'safeAreaX', ]); let leftSafeAreaArray = Object.keys(leftSafeAreaProps); const manualInset = leftSafeAreaArray.length ? leftSafeAreaProps[leftSafeAreaArray[leftSafeAreaArray.length - 1]] : undefined; if (!insets.left && (!manualInset || typeof manualInset === 'boolean')) { </s> remove if (!insets.top) { </s> add // DOC: Adding it for manual inset passed by the user let [topSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaY', 'safeAreaTop', ]); let topSafeAreaArray = Object.keys(topSafeAreaProps); const manualInset = topSafeAreaArray.length ? topSafeAreaProps[topSafeAreaArray[topSafeAreaArray.length - 1]] : undefined; if (!insets.top && (!manualInset || typeof manualInset === 'boolean')) { </s> remove !safeAreaProps.safeArea && !safeAreaProps.safeAreaRight && !safeAreaProps.safeAreaX </s> add isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaRight) && isNil(safeAreaProps.safeAreaX) </s> remove !safeAreaProps.safeArea && !safeAreaProps.safeAreaLeft && !safeAreaProps.safeAreaX </s> add isNil(safeAreaProps.safeArea) && isNil(safeAreaProps.safeAreaLeft) && isNil(safeAreaProps.safeAreaX)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/useSafeArea/utils.ts
return getValueInPixels( paddingProps, propKeys, sizes, insets.right, manualInset );
<mask> 'px', <mask> 'paddingX', <mask> ]); <mask> <mask> return getValueInPixels(paddingProps, propKeys, sizes, insets.right); <mask> } <mask> <mask> function getRelatedPaddingProps(props: any, relatedKeys: Array<any>) { <mask> return Object.keys(props).filter((key) => relatedKeys.includes(key)); <mask> } </s> feat: usesafearea props now accept numbers as well </s> remove return getValueInPixels(paddingProps, propKeys, sizes, insets.left); </s> add return getValueInPixels( paddingProps, propKeys, sizes, insets.left, manualInset ); </s> remove let [safeAreaProps, sansSafeAreaProps] = themeTools.extractInObject(props, [ </s> add let [ safeAreaProps, sansSafeAreaProps, ] = themeTools.orderedExtractInObject(props, [ </s> remove return getValueInPixels(paddingProps, propKeys, sizes, insets.bottom); </s> add return getValueInPixels( paddingProps, propKeys, sizes, insets.bottom, manualInset ); </s> remove return getValueInPixels(paddingProps, propKeys, sizes, insets.top); </s> add return getValueInPixels( paddingProps, propKeys, sizes, insets.top, manualInset ); </s> remove inset: any </s> add inset: any, manualInset: number | string
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/useSafeArea/utils.ts
let [ safeAreaProps, sansSafeAreaProps, ] = themeTools.orderedExtractInObject(props, [
<mask> function getRelatedPaddingProps(props: any, relatedKeys: Array<any>) { <mask> return Object.keys(props).filter((key) => relatedKeys.includes(key)); <mask> } <mask> export function getSortedProps(props: any) { <mask> let [safeAreaProps, sansSafeAreaProps] = themeTools.extractInObject(props, [ <mask> 'safeArea', <mask> 'safeAreaX', <mask> 'safeAreaY', <mask> 'safeAreaTop', <mask> 'safeAreaBottom', </s> feat: usesafearea props now accept numbers as well </s> remove return getValueInPixels(paddingProps, propKeys, sizes, insets.right); </s> add return getValueInPixels( paddingProps, propKeys, sizes, insets.right, manualInset ); </s> remove if (!insets.bottom) { </s> add let [bottomSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaY', 'safeAreaBottom', ]); let bottomSafeAreaArray = Object.keys(bottomSafeAreaProps); const manualInset = bottomSafeAreaArray.length ? bottomSafeAreaProps[bottomSafeAreaArray[bottomSafeAreaArray.length - 1]] : undefined; if (!insets.bottom && (!manualInset || typeof manualInset === 'boolean')) { </s> remove if (!insets.top) { </s> add // DOC: Adding it for manual inset passed by the user let [topSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaY', 'safeAreaTop', ]); let topSafeAreaArray = Object.keys(topSafeAreaProps); const manualInset = topSafeAreaArray.length ? topSafeAreaProps[topSafeAreaArray[topSafeAreaArray.length - 1]] : undefined; if (!insets.top && (!manualInset || typeof manualInset === 'boolean')) { </s> remove if (!insets.left) { </s> add let [leftSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaLeft', 'safeAreaX', ]); let leftSafeAreaArray = Object.keys(leftSafeAreaProps); const manualInset = leftSafeAreaArray.length ? leftSafeAreaProps[leftSafeAreaArray[leftSafeAreaArray.length - 1]] : undefined; if (!insets.left && (!manualInset || typeof manualInset === 'boolean')) { </s> remove if (!insets.right) { </s> add // DOC: Adding it for manual inset passed by the user let [rightSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaX', 'safeAreaRight', ]); let rightSafeAreaArray = Object.keys(rightSafeAreaProps); const manualInset = rightSafeAreaArray.length ? rightSafeAreaProps[rightSafeAreaArray[rightSafeAreaArray.length - 1]] : undefined; if (!insets.right && (!manualInset || typeof manualInset === 'boolean')) {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/useSafeArea/utils.ts
newProps[propName]?.color ?? props[propName]?.color
<mask> const textColor = bg <mask> ? { <mask> color: useContrastText( <mask> bg, <mask> newProps[propName].color ?? props[propName]?.color <mask> ), <mask> } <mask> : {}; <mask> // Overriding calculated props with user added props <mask> newProps[propName] = { </s> feat: usesafearea props now accept numbers as well </s> remove if (!insets.right) { </s> add // DOC: Adding it for manual inset passed by the user let [rightSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaX', 'safeAreaRight', ]); let rightSafeAreaArray = Object.keys(rightSafeAreaProps); const manualInset = rightSafeAreaArray.length ? rightSafeAreaProps[rightSafeAreaArray[rightSafeAreaArray.length - 1]] : undefined; if (!insets.right && (!manualInset || typeof manualInset === 'boolean')) { </s> remove if (!insets.top) { </s> add // DOC: Adding it for manual inset passed by the user let [topSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaY', 'safeAreaTop', ]); let topSafeAreaArray = Object.keys(topSafeAreaProps); const manualInset = topSafeAreaArray.length ? topSafeAreaProps[topSafeAreaArray[topSafeAreaArray.length - 1]] : undefined; if (!insets.top && (!manualInset || typeof manualInset === 'boolean')) { </s> remove if (!insets.left) { </s> add let [leftSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaLeft', 'safeAreaX', ]); let leftSafeAreaArray = Object.keys(leftSafeAreaProps); const manualInset = leftSafeAreaArray.length ? leftSafeAreaProps[leftSafeAreaArray[leftSafeAreaArray.length - 1]] : undefined; if (!insets.left && (!manualInset || typeof manualInset === 'boolean')) { </s> remove if (!insets.bottom) { </s> add let [bottomSafeAreaProps] = themeTools.orderedExtractInObject(safeAreaProps, [ 'safeArea', 'safeAreaY', 'safeAreaBottom', ]); let bottomSafeAreaArray = Object.keys(bottomSafeAreaProps); const manualInset = bottomSafeAreaArray.length ? bottomSafeAreaProps[bottomSafeAreaArray[bottomSafeAreaArray.length - 1]] : undefined; if (!insets.bottom && (!manualInset || typeof manualInset === 'boolean')) { </s> remove const originalValue = propKeys.length </s> add let appliedInset: any = 0; let originalValue = propKeys.length
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/4ffa8d6615b5c7b5d023c3ff758e090bb0a3795c
src/hooks/useThemeProps/utils.ts