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
<VStack space={4}> <Switch /> <Switch offTrackColor="rose.200" onTrackColor="lime.200" /> <Switch offThumbColor="rose.200" onThumbColor="lime.200" /> </VStack>
<mask> import { Switch } from 'native-base'; <mask> <mask> export default function () { <mask> return ( <mask> <> <mask> <Switch colorScheme="red" /> <mask> <Switch colorScheme="teal" size="lg" /> <mask> </> <mask> ); <mask> } </s> fix: updated switch api and integrated theme </s> remove <> <Switch size="sm" colorScheme="success" /> <Switch size="md" colorScheme="default" /> <Switch size="lg" colorScheme="orange" /> </> </s> add <VStack space={4}> <Switch size="sm" /> <Switch size="md" /> <Switch size="lg" /> </VStack> </s> remove import { Switch } from 'native-base'; </s> add import { Switch, VStack } from 'native-base'; </s> remove import { Switch } from 'native-base'; </s> add import { Switch, VStack } from 'native-base'; </s> remove import get from 'lodash/get'; import { mode, getColorScheme } from '../tools'; </s> add import { mode } from '../tools'; </s> remove colorScheme: 'default', </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/6370e2ab4a624675d6de256eec1ae703f634022d
example/storybook/stories/components/primitives/Switch/SwitchBgColor.tsx
<mask> style, <mask> onToggle, <mask> isDisabled, <mask> isInvalid, <mask> iosBgColor, <mask> isChecked, <mask> defaultIsChecked, <mask> accessibilityLabel, <mask> accessibilityHint, <mask> onColor, </s> fix: updated switch api and integrated theme </s> remove onColor, offColor, </s> add </s> remove const newProps = useThemeProps('Switch', { ...props, checked, onColor, offColor, }); </s> add const onTrackColor = useToken('colors', _onTrackColor); const offTrackColor = useToken('colors', _offTrackColor); const onThumbColor = useToken('colors', _onThumbColor); const offThumbColor = useToken('colors', _offThumbColor); </s> remove colorScheme: 'default', </s> add </s> remove const baseStyle = (props: Record<string, any>) => ({ trackColor: baseStyleTrack(props), thumbColor: baseStyleThumb(props), }); </s> add return { offTrackColor: offTrackColor ?? mode('gray.100', 'gray.900')(props), onTrackColor: onTrackColor ?? mode('green.300', 'green.700')(props), onThumbColor: onThumbColor ?? mode('white', 'black')(props), offThumbColor: offThumbColor ?? mode('white', 'black')(props), }; }; </s> remove <> <Switch size="sm" colorScheme="success" /> <Switch size="md" colorScheme="default" /> <Switch size="lg" colorScheme="orange" /> </> </s> add <VStack space={4}> <Switch size="sm" /> <Switch size="md" /> <Switch size="lg" /> </VStack>
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/6370e2ab4a624675d6de256eec1ae703f634022d
src/components/primitives/Switch/index.tsx
<mask> isChecked, <mask> defaultIsChecked, <mask> accessibilityLabel, <mask> accessibilityHint, <mask> onColor, <mask> offColor, <mask> ...props <mask> }: ISwitchProps, <mask> ref: any <mask> ) => { <mask> const state = useToggleState({ </s> fix: updated switch api and integrated theme </s> remove iosBgColor, </s> add </s> remove </s> add const { onTrackColor: _onTrackColor, offTrackColor: _offTrackColor, onThumbColor: _onThumbColor, offThumbColor: _offThumbColor, ...newProps } = useThemeProps('Switch', props); </s> remove const newProps = useThemeProps('Switch', { ...props, checked, onColor, offColor, }); </s> add const onTrackColor = useToken('colors', _onTrackColor); const offTrackColor = useToken('colors', _offTrackColor); const onThumbColor = useToken('colors', _onThumbColor); const offThumbColor = useToken('colors', _offThumbColor); </s> remove function baseStyleTrack(props: Record<string, any>) { const { colorScheme, theme, offTrackColor } = props; const simplifiedColorScheme = getColorScheme(props); return colorScheme && colorScheme !== 'default' ? { false: offTrackColor ? mode( theme.colors[offTrackColor][400], theme.colors[offTrackColor][100] )(props) : mode(theme.colors.light[100], theme.colors.dark[50])(props), true: mode( theme.colors[simplifiedColorScheme][500], theme.colors[simplifiedColorScheme][200] )(props), } : undefined; } function baseStyleThumb(props: Record<string, any>) { return props.checked ? props.onColor ? get(props.theme.colors, props.onColor) : undefined : props.offColor ? get(props.theme.colors, props.offColor) : undefined; } </s> add const baseStyle = (props: Record<string, any>) => { let { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; </s> remove const baseStyle = (props: Record<string, any>) => ({ trackColor: baseStyleTrack(props), thumbColor: baseStyleThumb(props), }); </s> add return { offTrackColor: offTrackColor ?? mode('gray.100', 'gray.900')(props), onTrackColor: onTrackColor ?? mode('green.300', 'green.700')(props), onThumbColor: onThumbColor ?? mode('white', 'black')(props), offThumbColor: offThumbColor ?? mode('white', 'black')(props), }; };
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/6370e2ab4a624675d6de256eec1ae703f634022d
src/components/primitives/Switch/index.tsx
const { onTrackColor: _onTrackColor, offTrackColor: _offTrackColor, onThumbColor: _onThumbColor, offThumbColor: _offThumbColor, ...newProps } = useThemeProps('Switch', props);
<mask> ) => { <mask> const state = useToggleState({ <mask> defaultSelected: !isNil(defaultIsChecked) ? defaultIsChecked : false, <mask> }); <mask> <mask> const borderColorInvalid = useToken('colors', 'danger.600'); <mask> const checked = !isNil(isChecked) ? isChecked : state.isSelected; <mask> const newProps = useThemeProps('Switch', { <mask> ...props, <mask> checked, </s> fix: updated switch api and integrated theme </s> remove const newProps = useThemeProps('Switch', { ...props, checked, onColor, offColor, }); </s> add const onTrackColor = useToken('colors', _onTrackColor); const offTrackColor = useToken('colors', _offTrackColor); const onThumbColor = useToken('colors', _onThumbColor); const offThumbColor = useToken('colors', _offThumbColor); </s> remove onColor, offColor, </s> add </s> remove function baseStyleTrack(props: Record<string, any>) { const { colorScheme, theme, offTrackColor } = props; const simplifiedColorScheme = getColorScheme(props); return colorScheme && colorScheme !== 'default' ? { false: offTrackColor ? mode( theme.colors[offTrackColor][400], theme.colors[offTrackColor][100] )(props) : mode(theme.colors.light[100], theme.colors.dark[50])(props), true: mode( theme.colors[simplifiedColorScheme][500], theme.colors[simplifiedColorScheme][200] )(props), } : undefined; } function baseStyleThumb(props: Record<string, any>) { return props.checked ? props.onColor ? get(props.theme.colors, props.onColor) : undefined : props.offColor ? get(props.theme.colors, props.offColor) : undefined; } </s> add const baseStyle = (props: Record<string, any>) => { let { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; </s> remove const baseStyle = (props: Record<string, any>) => ({ trackColor: baseStyleTrack(props), thumbColor: baseStyleThumb(props), }); </s> add return { offTrackColor: offTrackColor ?? mode('gray.100', 'gray.900')(props), onTrackColor: onTrackColor ?? mode('green.300', 'green.700')(props), onThumbColor: onThumbColor ?? mode('white', 'black')(props), offThumbColor: offThumbColor ?? mode('white', 'black')(props), }; }; </s> remove import get from 'lodash/get'; import { mode, getColorScheme } from '../tools'; </s> add import { mode } from '../tools';
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/6370e2ab4a624675d6de256eec1ae703f634022d
src/components/primitives/Switch/index.tsx
const onTrackColor = useToken('colors', _onTrackColor); const offTrackColor = useToken('colors', _offTrackColor); const onThumbColor = useToken('colors', _onThumbColor); const offThumbColor = useToken('colors', _offThumbColor);
<mask> }); <mask> <mask> const borderColorInvalid = useToken('colors', 'danger.600'); <mask> const checked = !isNil(isChecked) ? isChecked : state.isSelected; <mask> const newProps = useThemeProps('Switch', { <mask> ...props, <mask> checked, <mask> onColor, <mask> offColor, <mask> }); <mask> const inValidPropFactors = { <mask> borderWidth: 1, <mask> borderRadius: 16, <mask> borderColor: borderColorInvalid, <mask> }; </s> fix: updated switch api and integrated theme </s> remove </s> add const { onTrackColor: _onTrackColor, offTrackColor: _offTrackColor, onThumbColor: _onThumbColor, offThumbColor: _offThumbColor, ...newProps } = useThemeProps('Switch', props); </s> remove onColor, offColor, </s> add </s> remove function baseStyleTrack(props: Record<string, any>) { const { colorScheme, theme, offTrackColor } = props; const simplifiedColorScheme = getColorScheme(props); return colorScheme && colorScheme !== 'default' ? { false: offTrackColor ? mode( theme.colors[offTrackColor][400], theme.colors[offTrackColor][100] )(props) : mode(theme.colors.light[100], theme.colors.dark[50])(props), true: mode( theme.colors[simplifiedColorScheme][500], theme.colors[simplifiedColorScheme][200] )(props), } : undefined; } function baseStyleThumb(props: Record<string, any>) { return props.checked ? props.onColor ? get(props.theme.colors, props.onColor) : undefined : props.offColor ? get(props.theme.colors, props.offColor) : undefined; } </s> add const baseStyle = (props: Record<string, any>) => { let { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; </s> remove const baseStyle = (props: Record<string, any>) => ({ trackColor: baseStyleTrack(props), thumbColor: baseStyleThumb(props), }); </s> add return { offTrackColor: offTrackColor ?? mode('gray.100', 'gray.900')(props), onTrackColor: onTrackColor ?? mode('green.300', 'green.700')(props), onThumbColor: onThumbColor ?? mode('white', 'black')(props), offThumbColor: offThumbColor ?? mode('white', 'black')(props), }; }; </s> remove colorScheme: 'default', </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/6370e2ab4a624675d6de256eec1ae703f634022d
src/components/primitives/Switch/index.tsx
trackColor={{ false: offTrackColor, true: onTrackColor }} thumbColor={checked ? onThumbColor : offThumbColor} ios_backgroundColor={offTrackColor}
<mask> <mask> return ( <mask> <AriaInputWrapper {...inputProps} ref={inputRef}> <mask> <StyledNBSwitch <mask> {...newProps} <mask> disabled={isDisabled} <mask> onValueChange={onToggle ? onToggle : state.toggle} <mask> value={checked} <mask> style={computedStyle} </s> fix: updated switch api and integrated theme </s> remove ios_backgroundColor={iosBgColor} </s> add </s> remove function baseStyleTrack(props: Record<string, any>) { const { colorScheme, theme, offTrackColor } = props; const simplifiedColorScheme = getColorScheme(props); return colorScheme && colorScheme !== 'default' ? { false: offTrackColor ? mode( theme.colors[offTrackColor][400], theme.colors[offTrackColor][100] )(props) : mode(theme.colors.light[100], theme.colors.dark[50])(props), true: mode( theme.colors[simplifiedColorScheme][500], theme.colors[simplifiedColorScheme][200] )(props), } : undefined; } function baseStyleThumb(props: Record<string, any>) { return props.checked ? props.onColor ? get(props.theme.colors, props.onColor) : undefined : props.offColor ? get(props.theme.colors, props.offColor) : undefined; } </s> add const baseStyle = (props: Record<string, any>) => { let { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; </s> remove </s> add const { onTrackColor: _onTrackColor, offTrackColor: _offTrackColor, onThumbColor: _onThumbColor, offThumbColor: _offThumbColor, ...newProps } = useThemeProps('Switch', props); </s> remove import { Switch } from 'native-base'; </s> add import { Switch, VStack } from 'native-base'; </s> remove import { Switch } from 'native-base'; </s> add import { Switch, VStack } from 'native-base';
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/6370e2ab4a624675d6de256eec1ae703f634022d
src/components/primitives/Switch/index.tsx
<mask> <AriaInputWrapper {...inputProps} ref={inputRef}> <mask> <StyledNBSwitch <mask> {...newProps} <mask> disabled={isDisabled} <mask> ios_backgroundColor={iosBgColor} <mask> onValueChange={onToggle ? onToggle : state.toggle} <mask> value={checked} <mask> style={computedStyle} <mask> ref={ref} <mask> opacity={isDisabled ? 0.4 : 1} </s> fix: updated switch api and integrated theme </s> remove function baseStyleTrack(props: Record<string, any>) { const { colorScheme, theme, offTrackColor } = props; const simplifiedColorScheme = getColorScheme(props); return colorScheme && colorScheme !== 'default' ? { false: offTrackColor ? mode( theme.colors[offTrackColor][400], theme.colors[offTrackColor][100] )(props) : mode(theme.colors.light[100], theme.colors.dark[50])(props), true: mode( theme.colors[simplifiedColorScheme][500], theme.colors[simplifiedColorScheme][200] )(props), } : undefined; } function baseStyleThumb(props: Record<string, any>) { return props.checked ? props.onColor ? get(props.theme.colors, props.onColor) : undefined : props.offColor ? get(props.theme.colors, props.offColor) : undefined; } </s> add const baseStyle = (props: Record<string, any>) => { let { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; </s> remove </s> add const { onTrackColor: _onTrackColor, offTrackColor: _offTrackColor, onThumbColor: _onThumbColor, offThumbColor: _offThumbColor, ...newProps } = useThemeProps('Switch', props); </s> remove const baseStyle = (props: Record<string, any>) => ({ trackColor: baseStyleTrack(props), thumbColor: baseStyleThumb(props), }); </s> add return { offTrackColor: offTrackColor ?? mode('gray.100', 'gray.900')(props), onTrackColor: onTrackColor ?? mode('green.300', 'green.700')(props), onThumbColor: onThumbColor ?? mode('white', 'black')(props), offThumbColor: offThumbColor ?? mode('white', 'black')(props), }; }; </s> remove const newProps = useThemeProps('Switch', { ...props, checked, onColor, offColor, }); </s> add const onTrackColor = useToken('colors', _onTrackColor); const offTrackColor = useToken('colors', _offTrackColor); const onThumbColor = useToken('colors', _onThumbColor); const offThumbColor = useToken('colors', _offThumbColor);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/6370e2ab4a624675d6de256eec1ae703f634022d
src/components/primitives/Switch/index.tsx
<mask> IAccessibilityProps & <mask> BorderProps & { <mask> style?: ViewStyle; <mask> size?: 'lg' | 'md' | 'sm'; <mask> onColor?: string; <mask> offColor?: string; <mask> isDisabled?: boolean; <mask> name?: string; <mask> onToggle?: any; <mask> colorScheme?: string; <mask> iosBgColor?: string; </s> fix: updated switch api and integrated theme </s> remove colorScheme?: string; iosBgColor?: string; </s> add </s> remove import get from 'lodash/get'; import { mode, getColorScheme } from '../tools'; </s> add import { mode } from '../tools'; </s> remove import { Switch } from 'native-base'; </s> add import { Switch, VStack } from 'native-base';
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/6370e2ab4a624675d6de256eec1ae703f634022d
src/components/primitives/Switch/types.ts
<mask> offColor?: string; <mask> isDisabled?: boolean; <mask> name?: string; <mask> onToggle?: any; <mask> colorScheme?: string; <mask> iosBgColor?: string; <mask> isChecked?: boolean; <mask> defaultIsChecked?: boolean; <mask> isInvalid?: boolean; <mask> offTrackColor?: string; <mask> }; </s> fix: updated switch api and integrated theme </s> remove onColor?: string; offColor?: string; </s> add </s> remove colorScheme: 'default', </s> add </s> remove const baseStyle = (props: Record<string, any>) => ({ trackColor: baseStyleTrack(props), thumbColor: baseStyleThumb(props), }); </s> add return { offTrackColor: offTrackColor ?? mode('gray.100', 'gray.900')(props), onTrackColor: onTrackColor ?? mode('green.300', 'green.700')(props), onThumbColor: onThumbColor ?? mode('white', 'black')(props), offThumbColor: offThumbColor ?? mode('white', 'black')(props), }; };
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/6370e2ab4a624675d6de256eec1ae703f634022d
src/components/primitives/Switch/types.ts
onTrackColor?: string;
<mask> isChecked?: boolean; <mask> defaultIsChecked?: boolean; <mask> isInvalid?: boolean; <mask> offTrackColor?: string; <mask> onThumbColor?: string; <mask> offThumbColor?: string; <mask> }; </s> fix: updated switch api and integrated theme </s> remove colorScheme?: string; iosBgColor?: string; </s> add </s> remove onColor?: string; offColor?: string; </s> add </s> remove colorScheme: 'default', </s> add </s> remove const baseStyle = (props: Record<string, any>) => ({ trackColor: baseStyleTrack(props), thumbColor: baseStyleThumb(props), }); </s> add return { offTrackColor: offTrackColor ?? mode('gray.100', 'gray.900')(props), onTrackColor: onTrackColor ?? mode('green.300', 'green.700')(props), onThumbColor: onThumbColor ?? mode('white', 'black')(props), offThumbColor: offThumbColor ?? mode('white', 'black')(props), }; };
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/6370e2ab4a624675d6de256eec1ae703f634022d
src/components/primitives/Switch/types.ts
onThumbColor?: string; offThumbColor?: string;
<mask> isInvalid?: boolean; <mask> onTrackColor?: string; <mask> offTrackColor?: string; <mask> }; </s> fix: updated switch api and integrated theme </s> remove colorScheme?: string; iosBgColor?: string; </s> add </s> remove onColor?: string; offColor?: string; </s> add </s> remove colorScheme: 'default', </s> add </s> remove const baseStyle = (props: Record<string, any>) => ({ trackColor: baseStyleTrack(props), thumbColor: baseStyleThumb(props), }); </s> add return { offTrackColor: offTrackColor ?? mode('gray.100', 'gray.900')(props), onTrackColor: onTrackColor ?? mode('green.300', 'green.700')(props), onThumbColor: onThumbColor ?? mode('white', 'black')(props), offThumbColor: offThumbColor ?? mode('white', 'black')(props), }; };
[ "keep", "keep", "add", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/6370e2ab4a624675d6de256eec1ae703f634022d
src/components/primitives/Switch/types.ts
import { mode } from '../tools';
<mask> import get from 'lodash/get'; <mask> import { mode, getColorScheme } from '../tools'; <mask> <mask> function baseStyleTrack(props: Record<string, any>) { <mask> const { colorScheme, theme, offTrackColor } = props; <mask> const simplifiedColorScheme = getColorScheme(props); <mask> return colorScheme && colorScheme !== 'default' </s> fix: updated switch api and integrated theme </s> remove function baseStyleTrack(props: Record<string, any>) { const { colorScheme, theme, offTrackColor } = props; const simplifiedColorScheme = getColorScheme(props); return colorScheme && colorScheme !== 'default' ? { false: offTrackColor ? mode( theme.colors[offTrackColor][400], theme.colors[offTrackColor][100] )(props) : mode(theme.colors.light[100], theme.colors.dark[50])(props), true: mode( theme.colors[simplifiedColorScheme][500], theme.colors[simplifiedColorScheme][200] )(props), } : undefined; } function baseStyleThumb(props: Record<string, any>) { return props.checked ? props.onColor ? get(props.theme.colors, props.onColor) : undefined : props.offColor ? get(props.theme.colors, props.offColor) : undefined; } </s> add const baseStyle = (props: Record<string, any>) => { let { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; </s> remove import { Switch } from 'native-base'; </s> add import { Switch, VStack } from 'native-base'; </s> remove import { Switch } from 'native-base'; </s> add import { Switch, VStack } from 'native-base'; </s> remove const baseStyle = (props: Record<string, any>) => ({ trackColor: baseStyleTrack(props), thumbColor: baseStyleThumb(props), }); </s> add return { offTrackColor: offTrackColor ?? mode('gray.100', 'gray.900')(props), onTrackColor: onTrackColor ?? mode('green.300', 'green.700')(props), onThumbColor: onThumbColor ?? mode('white', 'black')(props), offThumbColor: offThumbColor ?? mode('white', 'black')(props), }; }; </s> remove const newProps = useThemeProps('Switch', { ...props, checked, onColor, offColor, }); </s> add const onTrackColor = useToken('colors', _onTrackColor); const offTrackColor = useToken('colors', _offTrackColor); const onThumbColor = useToken('colors', _onThumbColor); const offThumbColor = useToken('colors', _offThumbColor);
[ "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/6370e2ab4a624675d6de256eec1ae703f634022d
src/theme/components/switch.ts
const baseStyle = (props: Record<string, any>) => { let { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props;
<mask> import get from 'lodash/get'; <mask> import { mode, getColorScheme } from '../tools'; <mask> <mask> function baseStyleTrack(props: Record<string, any>) { <mask> const { colorScheme, theme, offTrackColor } = props; <mask> const simplifiedColorScheme = getColorScheme(props); <mask> return colorScheme && colorScheme !== 'default' <mask> ? { <mask> false: offTrackColor <mask> ? mode( <mask> theme.colors[offTrackColor][400], <mask> theme.colors[offTrackColor][100] <mask> )(props) <mask> : mode(theme.colors.light[100], theme.colors.dark[50])(props), <mask> true: mode( <mask> theme.colors[simplifiedColorScheme][500], <mask> theme.colors[simplifiedColorScheme][200] <mask> )(props), <mask> } <mask> : undefined; <mask> } <mask> function baseStyleThumb(props: Record<string, any>) { <mask> return props.checked <mask> ? props.onColor <mask> ? get(props.theme.colors, props.onColor) <mask> : undefined <mask> : props.offColor <mask> ? get(props.theme.colors, props.offColor) <mask> : undefined; <mask> } <mask> <mask> const baseStyle = (props: Record<string, any>) => ({ <mask> trackColor: baseStyleTrack(props), <mask> thumbColor: baseStyleThumb(props), <mask> }); </s> fix: updated switch api and integrated theme </s> remove import get from 'lodash/get'; import { mode, getColorScheme } from '../tools'; </s> add import { mode } from '../tools'; </s> remove const baseStyle = (props: Record<string, any>) => ({ trackColor: baseStyleTrack(props), thumbColor: baseStyleThumb(props), }); </s> add return { offTrackColor: offTrackColor ?? mode('gray.100', 'gray.900')(props), onTrackColor: onTrackColor ?? mode('green.300', 'green.700')(props), onThumbColor: onThumbColor ?? mode('white', 'black')(props), offThumbColor: offThumbColor ?? mode('white', 'black')(props), }; }; </s> remove </s> add const { onTrackColor: _onTrackColor, offTrackColor: _offTrackColor, onThumbColor: _onThumbColor, offThumbColor: _offThumbColor, ...newProps } = useThemeProps('Switch', props); </s> remove const newProps = useThemeProps('Switch', { ...props, checked, onColor, offColor, }); </s> add const onTrackColor = useToken('colors', _onTrackColor); const offTrackColor = useToken('colors', _offTrackColor); const onThumbColor = useToken('colors', _onThumbColor); const offThumbColor = useToken('colors', _offThumbColor);
[ "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/6370e2ab4a624675d6de256eec1ae703f634022d
src/theme/components/switch.ts
return { offTrackColor: offTrackColor ?? mode('gray.100', 'gray.900')(props), onTrackColor: onTrackColor ?? mode('green.300', 'green.700')(props), onThumbColor: onThumbColor ?? mode('white', 'black')(props), offThumbColor: offThumbColor ?? mode('white', 'black')(props), }; };
<mask> ? get(props.theme.colors, props.offColor) <mask> : undefined; <mask> } <mask> <mask> const baseStyle = (props: Record<string, any>) => ({ <mask> trackColor: baseStyleTrack(props), <mask> thumbColor: baseStyleThumb(props), <mask> }); <mask> <mask> const sizes = { <mask> sm: { <mask> transform: [{ scale: 0.75 }], <mask> }, </s> fix: updated switch api and integrated theme </s> remove function baseStyleTrack(props: Record<string, any>) { const { colorScheme, theme, offTrackColor } = props; const simplifiedColorScheme = getColorScheme(props); return colorScheme && colorScheme !== 'default' ? { false: offTrackColor ? mode( theme.colors[offTrackColor][400], theme.colors[offTrackColor][100] )(props) : mode(theme.colors.light[100], theme.colors.dark[50])(props), true: mode( theme.colors[simplifiedColorScheme][500], theme.colors[simplifiedColorScheme][200] )(props), } : undefined; } function baseStyleThumb(props: Record<string, any>) { return props.checked ? props.onColor ? get(props.theme.colors, props.onColor) : undefined : props.offColor ? get(props.theme.colors, props.offColor) : undefined; } </s> add const baseStyle = (props: Record<string, any>) => { let { onTrackColor, offTrackColor, onThumbColor, offThumbColor } = props; </s> remove </s> add const { onTrackColor: _onTrackColor, offTrackColor: _offTrackColor, onThumbColor: _onThumbColor, offThumbColor: _offThumbColor, ...newProps } = useThemeProps('Switch', props); </s> remove import get from 'lodash/get'; import { mode, getColorScheme } from '../tools'; </s> add import { mode } from '../tools'; </s> remove const newProps = useThemeProps('Switch', { ...props, checked, onColor, offColor, }); </s> add const onTrackColor = useToken('colors', _onTrackColor); const offTrackColor = useToken('colors', _offTrackColor); const onThumbColor = useToken('colors', _onThumbColor); const offThumbColor = useToken('colors', _offThumbColor); </s> remove onColor, offColor, </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/6370e2ab4a624675d6de256eec1ae703f634022d
src/theme/components/switch.ts
<mask> }; <mask> <mask> const defaultProps = { <mask> size: 'md', <mask> colorScheme: 'default', <mask> }; <mask> <mask> export default { <mask> baseStyle, <mask> sizes, </s> fix: updated switch api and integrated theme </s> remove const baseStyle = (props: Record<string, any>) => ({ trackColor: baseStyleTrack(props), thumbColor: baseStyleThumb(props), }); </s> add return { offTrackColor: offTrackColor ?? mode('gray.100', 'gray.900')(props), onTrackColor: onTrackColor ?? mode('green.300', 'green.700')(props), onThumbColor: onThumbColor ?? mode('white', 'black')(props), offThumbColor: offThumbColor ?? mode('white', 'black')(props), }; }; </s> remove const newProps = useThemeProps('Switch', { ...props, checked, onColor, offColor, }); </s> add const onTrackColor = useToken('colors', _onTrackColor); const offTrackColor = useToken('colors', _offTrackColor); const onThumbColor = useToken('colors', _onThumbColor); const offThumbColor = useToken('colors', _offThumbColor); </s> remove import { Switch } from 'native-base'; </s> add import { Switch, VStack } from 'native-base'; </s> remove import { Switch } from 'native-base'; </s> add import { Switch, VStack } from 'native-base'; </s> remove <> <Switch colorScheme="red" /> <Switch colorScheme="teal" size="lg" /> </> </s> add <VStack space={4}> <Switch /> <Switch offTrackColor="rose.200" onTrackColor="lime.200" /> <Switch offThumbColor="rose.200" onThumbColor="lime.200" /> </VStack>
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/6370e2ab4a624675d6de256eec1ae703f634022d
src/theme/components/switch.ts
const focusStyle = {
<mask> let updatedBorderColor = borderColorFromProps; <mask> if (isHovered) updatedBorderColor = hoverBorderColor; <mask> else if (isFocused) updatedBorderColor = focusBorderColor; <mask> else if (isInvalid) updatedBorderColor = errorBorderColor; <mask> const hoverStyle = { <mask> shadow: 3, <mask> shadowColor: 'blue', <mask> }; <mask> <mask> return ( </s> fix: focus and hover color swap </s> remove shadowColor: 'blue', </s> add shadowColor: '#2563EB', </s> remove hoverBorderColor: mode('default.600', 'default.400')(props), focusBorderColor: 'default.500', </s> add hoverBorderColor: 'default.500', focusBorderColor: mode('default.600', 'default.400')(props), </s> remove {...(isDisabled ? newProps._isDisabledProps : {})} </s> add {...(isDisabled && newProps._isDisabledProps)} </s> remove {...(isHovered ? hoverStyle : {})} </s> add {...(isFocused && Platform.OS === 'web' && focusStyle)}
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/638502a1591b4dd9ccff33b4da8bc73cc7081288
src/components/primitives/Input/index.tsx
shadowColor: '#2563EB',
<mask> else if (isFocused) updatedBorderColor = focusBorderColor; <mask> else if (isInvalid) updatedBorderColor = errorBorderColor; <mask> const hoverStyle = { <mask> shadow: 3, <mask> shadowColor: 'blue', <mask> }; <mask> <mask> return ( <mask> <Box <mask> borderColor={updatedBorderColor} </s> fix: focus and hover color swap </s> remove const hoverStyle = { </s> add const focusStyle = { </s> remove {...(isDisabled ? newProps._isDisabledProps : {})} </s> add {...(isDisabled && newProps._isDisabledProps)} </s> remove hoverBorderColor: mode('default.600', 'default.400')(props), focusBorderColor: 'default.500', </s> add hoverBorderColor: 'default.500', focusBorderColor: mode('default.600', 'default.400')(props), </s> remove {...(isHovered ? hoverStyle : {})} </s> add {...(isFocused && Platform.OS === 'web' && focusStyle)}
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/638502a1591b4dd9ccff33b4da8bc73cc7081288
src/components/primitives/Input/index.tsx
{...(isDisabled && newProps._isDisabledProps)}
<mask> borderColor={updatedBorderColor} <mask> borderWidth={borderWidth} <mask> borderBottomWidth={borderBottomWidth} <mask> {...rem} <mask> {...(isDisabled ? newProps._isDisabledProps : {})} <mask> {...computedProps} <mask> {...(isHovered ? hoverStyle : {})} <mask> style={style} <mask> > <mask> {InputLeftElement ? ( </s> fix: focus and hover color swap </s> remove {...(isHovered ? hoverStyle : {})} </s> add {...(isFocused && Platform.OS === 'web' && focusStyle)} </s> remove hoverBorderColor: mode('default.600', 'default.400')(props), focusBorderColor: 'default.500', </s> add hoverBorderColor: 'default.500', focusBorderColor: mode('default.600', 'default.400')(props), </s> remove shadowColor: 'blue', </s> add shadowColor: '#2563EB', </s> remove const hoverStyle = { </s> add const focusStyle = {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/638502a1591b4dd9ccff33b4da8bc73cc7081288
src/components/primitives/Input/index.tsx
{...(isFocused && Platform.OS === 'web' && focusStyle)}
<mask> borderBottomWidth={borderBottomWidth} <mask> {...rem} <mask> {...(isDisabled ? newProps._isDisabledProps : {})} <mask> {...computedProps} <mask> {...(isHovered ? hoverStyle : {})} <mask> style={style} <mask> > <mask> {InputLeftElement ? ( <mask> <Flex justify="center" align="center" left={0}> <mask> {InputLeftElement} </s> fix: focus and hover color swap </s> remove {...(isDisabled ? newProps._isDisabledProps : {})} </s> add {...(isDisabled && newProps._isDisabledProps)} </s> remove hoverBorderColor: mode('default.600', 'default.400')(props), focusBorderColor: 'default.500', </s> add hoverBorderColor: 'default.500', focusBorderColor: mode('default.600', 'default.400')(props), </s> remove shadowColor: 'blue', </s> add shadowColor: '#2563EB', </s> remove const hoverStyle = { </s> add const focusStyle = {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/638502a1591b4dd9ccff33b4da8bc73cc7081288
src/components/primitives/Input/index.tsx
hoverBorderColor: 'default.500', focusBorderColor: mode('default.600', 'default.400')(props),
<mask> }, <mask> borderColor: isInvalid <mask> ? mode('danger.600', 'danger.200')(props) <mask> : mode('gray.600', 'gray.400')(props), <mask> hoverBorderColor: mode('default.600', 'default.400')(props), <mask> focusBorderColor: 'default.500', <mask> errorBorderColor: mode('danger.600', 'danger.200')(props), <mask> }; <mask> }; <mask> <mask> function roundedStyle() { </s> fix: focus and hover color swap </s> remove {...(isDisabled ? newProps._isDisabledProps : {})} </s> add {...(isDisabled && newProps._isDisabledProps)} </s> remove const hoverStyle = { </s> add const focusStyle = { </s> remove shadowColor: 'blue', </s> add shadowColor: '#2563EB', </s> remove {...(isHovered ? hoverStyle : {})} </s> add {...(isFocused && Platform.OS === 'web' && focusStyle)}
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/638502a1591b4dd9ccff33b4da8bc73cc7081288
src/theme/components/input.ts
<mask> }} <mask> > <mask> This is a Box <mask> </Box> <mask> <Box <mask> bg="primary.400:alpha.70" <mask> _text={{ fontSize: 'md', fontWeight: 'bold', color: 'white' }} <mask> > <mask> This is a Box <mask> </Box> <mask> </> <mask> ); <mask> }; </s> feat: add feature flag for new styled system impl (#3864) </s> remove // // NOTE: Direct value identified. // if (typeof propValues === 'string' || typeof propValues === 'number') { // translatedProps[property] = propValues; // // NOTE: Nested object (excluding _props) (To be specific, only for key exist in themePropertyMap) // } else if (!isNil(propValues)) { // // TODO: This setion new needs to handle stuff differently // for (let nestedProp in propValues) { // translatedProps[nestedProp] = get( // theme, // `${themePropertyMap[nestedProp]}.${propValues[nestedProp]}`, // propValues[nestedProp] // ); // } // delete translatedProps[property]; // // Manually handeling shadow props (example of Mapped tokens) // } else if (property === 'shadow') { // const resolveValueWithBreakpointValue = resolveValueWithBreakpoint( // props.shadow, // currentBreakpoint, // property // ); // let shadowProps = theme[themePropertyMap[property]](colorModeProps)[ // resolveValueWithBreakpointValue // ]; // translatedProps.style = merge({}, shadowProps, props.style); // delete translatedProps[property]; // } else { // translatedProps[property] = resolveValueWithBreakpoint( // props[property], // currentBreakpoint, // property // ); // } // } else { // // STEP 1.d Resolving Direct Values // translatedProps[property] = resolveValueWithBreakpoint( // props[property], // currentBreakpoint, // property // ); // } // } </s> add // NOTE: Direct value identified. if (typeof propValues === 'string' || typeof propValues === 'number') { translatedProps[property] = propValues; // NOTE: Nested object (excluding _props) (To be specific, only for key exist in themePropertyMap) } else if (!isNil(propValues)) { // TODO: This setion new needs to handle stuff differently for (let nestedProp in propValues) { translatedProps[nestedProp] = get( theme, `${themePropertyMap[nestedProp]}.${propValues[nestedProp]}`, propValues[nestedProp] ); } delete translatedProps[property]; // Manually handeling shadow props (example of Mapped tokens) } else if (property === 'shadow') { const resolveValueWithBreakpointValue = resolveValueWithBreakpoint( props.shadow, currentBreakpoint, property ); let shadowProps = theme[themePropertyMap[property]](colorModeProps)[ resolveValueWithBreakpointValue ]; translatedProps.style = merge({}, shadowProps, props.style); delete translatedProps[property]; } else { translatedProps[property] = resolveValueWithBreakpoint( props[property], currentBreakpoint, property ); } } else { // STEP 1.d Resolving Direct Values translatedProps[property] = resolveValueWithBreakpoint( props[property], currentBreakpoint, property ); } } </s> remove return ( <Comp {...restProps} style={style} ref={ref}> {children} </Comp> ); } ); </s> add return ( <Comp {...restProps} style={style} ref={ref}> {children} </Comp> ); } ); } else { //@ts-ignore return styled(Comp)(...resolversForBox); } </s> remove const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); </s> add const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); </s> remove // return translatedProps; // }; </s> add return translatedProps; };
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
example/storybook/stories/components/primitives/Box/basic.tsx
import isNil from 'lodash.isnil';
<mask> import get from 'lodash.get'; <mask> import omit from 'lodash.omit'; <mask> // import isNil from 'lodash.isnil'; <mask> import merge from 'lodash.merge'; <mask> import { useWindowDimensions } from 'react-native'; <mask> import { useNativeBase } from '../useNativeBase'; <mask> import { usePlatformProps } from '../usePlatformProps'; <mask> import { useColorModeProps } from '../useColorModeProps'; </s> feat: add feature flag for new styled system impl (#3864) </s> remove // extractPropertyFromFunction, </s> add extractPropertyFromFunction, </s> remove // import { themePropertyMap } from './../../theme/base'; </s> add import { themePropertyMap } from './../../theme/base'; </s> remove // omitUndefined, // extractInObject, </s> add omitUndefined, extractInObject, </s> remove import { useTheme } from 'styled-components/native'; </s> add import styled, { useTheme } from 'styled-components/native';
[ "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/hooks/useThemeProps/usePropsResolution.tsx
extractPropertyFromFunction,
<mask> import { useColorModeProps } from '../useColorModeProps'; <mask> import { useColorMode } from '../../core/color-mode'; <mask> import { <mask> resolveValueWithBreakpoint, <mask> // extractPropertyFromFunction, <mask> } from './utils'; <mask> import { <mask> getClosestBreakpoint, <mask> // omitUndefined, <mask> // extractInObject, </s> feat: add feature flag for new styled system impl (#3864) </s> remove // omitUndefined, // extractInObject, </s> add omitUndefined, extractInObject, </s> remove // import { themePropertyMap } from './../../theme/base'; </s> add import { themePropertyMap } from './../../theme/base'; </s> remove // import isNil from 'lodash.isnil'; </s> add import isNil from 'lodash.isnil'; </s> remove import { useTheme } from 'styled-components/native'; </s> add import styled, { useTheme } from 'styled-components/native';
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/hooks/useThemeProps/usePropsResolution.tsx
omitUndefined, extractInObject,
<mask> // extractPropertyFromFunction, <mask> } from './utils'; <mask> import { <mask> getClosestBreakpoint, <mask> // omitUndefined, <mask> // extractInObject, <mask> } from './../../theme/tools'; <mask> // import { themePropertyMap } from './../../theme/base'; <mask> import { useContrastText } from '../useContrastText'; <mask> import React from 'react'; <mask> </s> feat: add feature flag for new styled system impl (#3864) </s> remove // import { themePropertyMap } from './../../theme/base'; </s> add import { themePropertyMap } from './../../theme/base'; </s> remove // extractPropertyFromFunction, </s> add extractPropertyFromFunction, </s> remove // import isNil from 'lodash.isnil'; </s> add import isNil from 'lodash.isnil'; </s> remove import { useTheme } from 'styled-components/native'; </s> add import styled, { useTheme } from 'styled-components/native';
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/hooks/useThemeProps/usePropsResolution.tsx
import { themePropertyMap } from './../../theme/base';
<mask> getClosestBreakpoint, <mask> // omitUndefined, <mask> // extractInObject, <mask> } from './../../theme/tools'; <mask> // import { themePropertyMap } from './../../theme/base'; <mask> import { useContrastText } from '../useContrastText'; <mask> import React from 'react'; <mask> <mask> /** <mask> * @summary Resolves, simplify and merge components specific theme. </s> feat: add feature flag for new styled system impl (#3864) </s> remove // omitUndefined, // extractInObject, </s> add omitUndefined, extractInObject, </s> remove // extractPropertyFromFunction, </s> add extractPropertyFromFunction, </s> remove // import isNil from 'lodash.isnil'; </s> add import isNil from 'lodash.isnil'; </s> remove import { useTheme } from 'styled-components/native'; </s> add import styled, { useTheme } from 'styled-components/native';
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/hooks/useThemeProps/usePropsResolution.tsx
import { shouldEnableNewStyledSystemImplementation } from '../../utils/styled';
<mask> import { useContrastText } from '../useContrastText'; <mask> import React from 'react'; <mask> <mask> /** <mask> * @summary Resolves, simplify and merge components specific theme. <mask> * @description The function extract and execute component specifc theme (i.e., `defaultProps`, `baseStyle` and `variants`) and returns a merged and simplified object. <mask> * @arg {string} theme - Theme object of NativeBase (without component theme). </s> feat: add feature flag for new styled system impl (#3864) </s> remove // import { themePropertyMap } from './../../theme/base'; </s> add import { themePropertyMap } from './../../theme/base'; </s> remove // return translatedProps; // }; </s> add return translatedProps; }; </s> remove export function usePropsResolution(component: string, incomingProps: any) { </s> add export function usePropsResolution( component: string, incomingProps: any, config?: any ) { const [ignoredProps, cleanIncomingProps] = extractInObject( incomingProps, ['children', 'onPress', 'icon', 'onOpen', 'onClose'].concat( config?.ignoreProps || [] ) ); </s> remove // omitUndefined, // extractInObject, </s> add omitUndefined, extractInObject, </s> remove // import isNil from 'lodash.isnil'; </s> add import isNil from 'lodash.isnil';
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/hooks/useThemeProps/usePropsResolution.tsx
const propTranslator = ({ props, theme, colorModeProps, componentTheme, currentBreakpoint, }: { props: any; theme: any; colorModeProps: object; componentTheme: object; currentBreakpoint: number; }) => { let translatedProps: any = {}; for (const property in props) { // STEP 1 - Responsive prop check and resolve if (property.startsWith('_')) { // STEP 1.a - Resolving _ porps const nestedTranslatedProps = propTranslator({ props: props[property], theme, colorModeProps, componentTheme, currentBreakpoint, }); translatedProps[property] = nestedTranslatedProps; } else if (themePropertyMap[property]) { // STEP 1.b Resolving themed props const propValues = extractPropertyFromFunction( property, props, theme, componentTheme );
<mask> * @arg {object} windowWidth - Current width of the window / screen. <mask> * @returns {object} Translated props object. <mask> */ <mask> // Todo - move responsive calculation in styled system <mask> // const propTranslator = ({ <mask> // props, <mask> // theme, <mask> // colorModeProps, <mask> // componentTheme, <mask> // currentBreakpoint, <mask> // }: { <mask> // props: any; <mask> // theme: any; <mask> // colorModeProps: object; <mask> // componentTheme: object; <mask> // currentBreakpoint: number; <mask> // }) => { <mask> // let translatedProps: any = {}; <mask> // for (const property in props) { <mask> // // STEP 1 - Responsive prop check and resolve <mask> // if (property.startsWith('_')) { <mask> // // STEP 1.a - Resolving _ porps <mask> // const nestedTranslatedProps = propTranslator({ <mask> // props: props[property], <mask> // theme, <mask> // colorModeProps, <mask> // componentTheme, <mask> // currentBreakpoint, <mask> // }); <mask> // translatedProps[property] = nestedTranslatedProps; <mask> // } else if (themePropertyMap[property]) { <mask> // // STEP 1.b Resolving themed props <mask> // const propValues = extractPropertyFromFunction( <mask> // property, <mask> // props, <mask> // theme, <mask> // componentTheme <mask> // ); <mask> <mask> // // NOTE: Direct value identified. <mask> // if (typeof propValues === 'string' || typeof propValues === 'number') { <mask> // translatedProps[property] = propValues; <mask> // // NOTE: Nested object (excluding _props) (To be specific, only for key exist in themePropertyMap) </s> feat: add feature flag for new styled system impl (#3864) </s> remove // // NOTE: Direct value identified. // if (typeof propValues === 'string' || typeof propValues === 'number') { // translatedProps[property] = propValues; // // NOTE: Nested object (excluding _props) (To be specific, only for key exist in themePropertyMap) // } else if (!isNil(propValues)) { // // TODO: This setion new needs to handle stuff differently // for (let nestedProp in propValues) { // translatedProps[nestedProp] = get( // theme, // `${themePropertyMap[nestedProp]}.${propValues[nestedProp]}`, // propValues[nestedProp] // ); // } // delete translatedProps[property]; // // Manually handeling shadow props (example of Mapped tokens) // } else if (property === 'shadow') { // const resolveValueWithBreakpointValue = resolveValueWithBreakpoint( // props.shadow, // currentBreakpoint, // property // ); // let shadowProps = theme[themePropertyMap[property]](colorModeProps)[ // resolveValueWithBreakpointValue // ]; // translatedProps.style = merge({}, shadowProps, props.style); // delete translatedProps[property]; // } else { // translatedProps[property] = resolveValueWithBreakpoint( // props[property], // currentBreakpoint, // property // ); // } // } else { // // STEP 1.d Resolving Direct Values // translatedProps[property] = resolveValueWithBreakpoint( // props[property], // currentBreakpoint, // property // ); // } // } </s> add // NOTE: Direct value identified. if (typeof propValues === 'string' || typeof propValues === 'number') { translatedProps[property] = propValues; // NOTE: Nested object (excluding _props) (To be specific, only for key exist in themePropertyMap) } else if (!isNil(propValues)) { // TODO: This setion new needs to handle stuff differently for (let nestedProp in propValues) { translatedProps[nestedProp] = get( theme, `${themePropertyMap[nestedProp]}.${propValues[nestedProp]}`, propValues[nestedProp] ); } delete translatedProps[property]; // Manually handeling shadow props (example of Mapped tokens) } else if (property === 'shadow') { const resolveValueWithBreakpointValue = resolveValueWithBreakpoint( props.shadow, currentBreakpoint, property ); let shadowProps = theme[themePropertyMap[property]](colorModeProps)[ resolveValueWithBreakpointValue ]; translatedProps.style = merge({}, shadowProps, props.style); delete translatedProps[property]; } else { translatedProps[property] = resolveValueWithBreakpoint( props[property], currentBreakpoint, property ); } } else { // STEP 1.d Resolving Direct Values translatedProps[property] = resolveValueWithBreakpoint( props[property], currentBreakpoint, property ); } } </s> remove // return translatedProps; // }; </s> add return translatedProps; }; </s> remove export function usePropsResolution(component: string, incomingProps: any) { </s> add export function usePropsResolution( component: string, incomingProps: any, config?: any ) { const [ignoredProps, cleanIncomingProps] = extractInObject( incomingProps, ['children', 'onPress', 'icon', 'onOpen', 'onClose'].concat( config?.ignoreProps || [] ) );
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/hooks/useThemeProps/usePropsResolution.tsx
// NOTE: Direct value identified. if (typeof propValues === 'string' || typeof propValues === 'number') { translatedProps[property] = propValues; // NOTE: Nested object (excluding _props) (To be specific, only for key exist in themePropertyMap) } else if (!isNil(propValues)) { // TODO: This setion new needs to handle stuff differently for (let nestedProp in propValues) { translatedProps[nestedProp] = get( theme, `${themePropertyMap[nestedProp]}.${propValues[nestedProp]}`, propValues[nestedProp] ); } delete translatedProps[property]; // Manually handeling shadow props (example of Mapped tokens) } else if (property === 'shadow') { const resolveValueWithBreakpointValue = resolveValueWithBreakpoint( props.shadow, currentBreakpoint, property ); let shadowProps = theme[themePropertyMap[property]](colorModeProps)[ resolveValueWithBreakpointValue ]; translatedProps.style = merge({}, shadowProps, props.style); delete translatedProps[property]; } else { translatedProps[property] = resolveValueWithBreakpoint( props[property], currentBreakpoint, property ); } } else { // STEP 1.d Resolving Direct Values translatedProps[property] = resolveValueWithBreakpoint( props[property], currentBreakpoint, property ); } }
<mask> // theme, <mask> // componentTheme <mask> // ); <mask> <mask> // // NOTE: Direct value identified. <mask> // if (typeof propValues === 'string' || typeof propValues === 'number') { <mask> // translatedProps[property] = propValues; <mask> // // NOTE: Nested object (excluding _props) (To be specific, only for key exist in themePropertyMap) <mask> // } else if (!isNil(propValues)) { <mask> // // TODO: This setion new needs to handle stuff differently <mask> // for (let nestedProp in propValues) { <mask> // translatedProps[nestedProp] = get( <mask> // theme, <mask> // `${themePropertyMap[nestedProp]}.${propValues[nestedProp]}`, <mask> // propValues[nestedProp] <mask> // ); <mask> // } <mask> // delete translatedProps[property]; <mask> // // Manually handeling shadow props (example of Mapped tokens) <mask> // } else if (property === 'shadow') { <mask> // const resolveValueWithBreakpointValue = resolveValueWithBreakpoint( <mask> // props.shadow, <mask> // currentBreakpoint, <mask> // property <mask> // ); <mask> // let shadowProps = theme[themePropertyMap[property]](colorModeProps)[ <mask> // resolveValueWithBreakpointValue <mask> // ]; <mask> // translatedProps.style = merge({}, shadowProps, props.style); <mask> // delete translatedProps[property]; <mask> // } else { <mask> // translatedProps[property] = resolveValueWithBreakpoint( <mask> // props[property], <mask> // currentBreakpoint, <mask> // property <mask> // ); <mask> // } <mask> // } else { <mask> // // STEP 1.d Resolving Direct Values <mask> // translatedProps[property] = resolveValueWithBreakpoint( <mask> // props[property], <mask> // currentBreakpoint, <mask> // property <mask> // ); <mask> // } <mask> // } <mask> <mask> // return translatedProps; <mask> // }; <mask> <mask> /** </s> feat: add feature flag for new styled system impl (#3864) </s> remove // const propTranslator = ({ // props, // theme, // colorModeProps, // componentTheme, // currentBreakpoint, // }: { // props: any; // theme: any; // colorModeProps: object; // componentTheme: object; // currentBreakpoint: number; // }) => { // let translatedProps: any = {}; // for (const property in props) { // // STEP 1 - Responsive prop check and resolve // if (property.startsWith('_')) { // // STEP 1.a - Resolving _ porps // const nestedTranslatedProps = propTranslator({ // props: props[property], // theme, // colorModeProps, // componentTheme, // currentBreakpoint, // }); // translatedProps[property] = nestedTranslatedProps; // } else if (themePropertyMap[property]) { // // STEP 1.b Resolving themed props // const propValues = extractPropertyFromFunction( // property, // props, // theme, // componentTheme // ); </s> add const propTranslator = ({ props, theme, colorModeProps, componentTheme, currentBreakpoint, }: { props: any; theme: any; colorModeProps: object; componentTheme: object; currentBreakpoint: number; }) => { let translatedProps: any = {}; for (const property in props) { // STEP 1 - Responsive prop check and resolve if (property.startsWith('_')) { // STEP 1.a - Resolving _ porps const nestedTranslatedProps = propTranslator({ props: props[property], theme, colorModeProps, componentTheme, currentBreakpoint, }); translatedProps[property] = nestedTranslatedProps; } else if (themePropertyMap[property]) { // STEP 1.b Resolving themed props const propValues = extractPropertyFromFunction( property, props, theme, componentTheme ); </s> remove // return translatedProps; // }; </s> add return translatedProps; }; </s> remove // omitUndefined, // extractInObject, </s> add omitUndefined, extractInObject, </s> remove // extractPropertyFromFunction, </s> add extractPropertyFromFunction,
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/hooks/useThemeProps/usePropsResolution.tsx
return translatedProps; };
<mask> // ); <mask> // } <mask> // } <mask> <mask> // return translatedProps; <mask> // }; <mask> <mask> /** <mask> * @summary Combines provided porps with component's theme props and resloves them. <mask> * @description NOTE: Avoid passing JSX and functions. <mask> * @arg {string} component - Name of the component. </s> feat: add feature flag for new styled system impl (#3864) </s> remove export function usePropsResolution(component: string, incomingProps: any) { </s> add export function usePropsResolution( component: string, incomingProps: any, config?: any ) { const [ignoredProps, cleanIncomingProps] = extractInObject( incomingProps, ['children', 'onPress', 'icon', 'onOpen', 'onClose'].concat( config?.ignoreProps || [] ) ); </s> remove // import { themePropertyMap } from './../../theme/base'; </s> add import { themePropertyMap } from './../../theme/base'; </s> remove // const propTranslator = ({ // props, // theme, // colorModeProps, // componentTheme, // currentBreakpoint, // }: { // props: any; // theme: any; // colorModeProps: object; // componentTheme: object; // currentBreakpoint: number; // }) => { // let translatedProps: any = {}; // for (const property in props) { // // STEP 1 - Responsive prop check and resolve // if (property.startsWith('_')) { // // STEP 1.a - Resolving _ porps // const nestedTranslatedProps = propTranslator({ // props: props[property], // theme, // colorModeProps, // componentTheme, // currentBreakpoint, // }); // translatedProps[property] = nestedTranslatedProps; // } else if (themePropertyMap[property]) { // // STEP 1.b Resolving themed props // const propValues = extractPropertyFromFunction( // property, // props, // theme, // componentTheme // ); </s> add const propTranslator = ({ props, theme, colorModeProps, componentTheme, currentBreakpoint, }: { props: any; theme: any; colorModeProps: object; componentTheme: object; currentBreakpoint: number; }) => { let translatedProps: any = {}; for (const property in props) { // STEP 1 - Responsive prop check and resolve if (property.startsWith('_')) { // STEP 1.a - Resolving _ porps const nestedTranslatedProps = propTranslator({ props: props[property], theme, colorModeProps, componentTheme, currentBreakpoint, }); translatedProps[property] = nestedTranslatedProps; } else if (themePropertyMap[property]) { // STEP 1.b Resolving themed props const propValues = extractPropertyFromFunction( property, props, theme, componentTheme ); </s> remove // // NOTE: Direct value identified. // if (typeof propValues === 'string' || typeof propValues === 'number') { // translatedProps[property] = propValues; // // NOTE: Nested object (excluding _props) (To be specific, only for key exist in themePropertyMap) // } else if (!isNil(propValues)) { // // TODO: This setion new needs to handle stuff differently // for (let nestedProp in propValues) { // translatedProps[nestedProp] = get( // theme, // `${themePropertyMap[nestedProp]}.${propValues[nestedProp]}`, // propValues[nestedProp] // ); // } // delete translatedProps[property]; // // Manually handeling shadow props (example of Mapped tokens) // } else if (property === 'shadow') { // const resolveValueWithBreakpointValue = resolveValueWithBreakpoint( // props.shadow, // currentBreakpoint, // property // ); // let shadowProps = theme[themePropertyMap[property]](colorModeProps)[ // resolveValueWithBreakpointValue // ]; // translatedProps.style = merge({}, shadowProps, props.style); // delete translatedProps[property]; // } else { // translatedProps[property] = resolveValueWithBreakpoint( // props[property], // currentBreakpoint, // property // ); // } // } else { // // STEP 1.d Resolving Direct Values // translatedProps[property] = resolveValueWithBreakpoint( // props[property], // currentBreakpoint, // property // ); // } // } </s> add // NOTE: Direct value identified. if (typeof propValues === 'string' || typeof propValues === 'number') { translatedProps[property] = propValues; // NOTE: Nested object (excluding _props) (To be specific, only for key exist in themePropertyMap) } else if (!isNil(propValues)) { // TODO: This setion new needs to handle stuff differently for (let nestedProp in propValues) { translatedProps[nestedProp] = get( theme, `${themePropertyMap[nestedProp]}.${propValues[nestedProp]}`, propValues[nestedProp] ); } delete translatedProps[property]; // Manually handeling shadow props (example of Mapped tokens) } else if (property === 'shadow') { const resolveValueWithBreakpointValue = resolveValueWithBreakpoint( props.shadow, currentBreakpoint, property ); let shadowProps = theme[themePropertyMap[property]](colorModeProps)[ resolveValueWithBreakpointValue ]; translatedProps.style = merge({}, shadowProps, props.style); delete translatedProps[property]; } else { translatedProps[property] = resolveValueWithBreakpoint( props[property], currentBreakpoint, property ); } } else { // STEP 1.d Resolving Direct Values translatedProps[property] = resolveValueWithBreakpoint( props[property], currentBreakpoint, property ); } }
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/hooks/useThemeProps/usePropsResolution.tsx
export function usePropsResolution( component: string, incomingProps: any, config?: any ) { const [ignoredProps, cleanIncomingProps] = extractInObject( incomingProps, ['children', 'onPress', 'icon', 'onOpen', 'onClose'].concat( config?.ignoreProps || [] ) );
<mask> * @arg {string} component - Name of the component. <mask> * @arg {object} incomingProps - Props passed by the user. <mask> * @returns {object} Resolved props. <mask> */ <mask> export function usePropsResolution(component: string, incomingProps: any) { <mask> const { theme } = useNativeBase(); <mask> const colorModeProps = useColorMode(); <mask> <mask> const componentTheme = get(theme, `components.${component}`, {}); <mask> const notComponentTheme = omit(theme, ['components']); </s> feat: add feature flag for new styled system impl (#3864) </s> remove // return translatedProps; // }; </s> add return translatedProps; }; </s> remove // const propTranslator = ({ // props, // theme, // colorModeProps, // componentTheme, // currentBreakpoint, // }: { // props: any; // theme: any; // colorModeProps: object; // componentTheme: object; // currentBreakpoint: number; // }) => { // let translatedProps: any = {}; // for (const property in props) { // // STEP 1 - Responsive prop check and resolve // if (property.startsWith('_')) { // // STEP 1.a - Resolving _ porps // const nestedTranslatedProps = propTranslator({ // props: props[property], // theme, // colorModeProps, // componentTheme, // currentBreakpoint, // }); // translatedProps[property] = nestedTranslatedProps; // } else if (themePropertyMap[property]) { // // STEP 1.b Resolving themed props // const propValues = extractPropertyFromFunction( // property, // props, // theme, // componentTheme // ); </s> add const propTranslator = ({ props, theme, colorModeProps, componentTheme, currentBreakpoint, }: { props: any; theme: any; colorModeProps: object; componentTheme: object; currentBreakpoint: number; }) => { let translatedProps: any = {}; for (const property in props) { // STEP 1 - Responsive prop check and resolve if (property.startsWith('_')) { // STEP 1.a - Resolving _ porps const nestedTranslatedProps = propTranslator({ props: props[property], theme, colorModeProps, componentTheme, currentBreakpoint, }); translatedProps[property] = nestedTranslatedProps; } else if (themePropertyMap[property]) { // STEP 1.b Resolving themed props const propValues = extractPropertyFromFunction( property, props, theme, componentTheme ); </s> remove // @ts-ignore </s> add export let shouldEnableNewStyledSystemImplementation = false; </s> remove return React.forwardRef( ({ style: propStyle, children, debug, ...props }: any, ref: any) => { const theme = useTheme(); const windowWidth = useWindowDimensions().width; </s> add if (shouldEnableNewStyledSystemImplementation) { return React.forwardRef( ({ style: propStyle, children, debug, ...props }: any, ref: any) => { const theme = useTheme(); const windowWidth = useWindowDimensions().width;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/hooks/useThemeProps/usePropsResolution.tsx
cleanIncomingProps,
<mask> // TODO: using usePlatformProps here to simplify the component theme. So that on on component level it shouldn't have to maintain the Specificity. <mask> const componentThemeObject = useSimplifyComponentTheme( <mask> notComponentTheme, <mask> componentTheme, <mask> incomingProps, <mask> colorModeProps, <mask> currentBreakpoint <mask> ); <mask> <mask> if ( </s> feat: add feature flag for new styled system impl (#3864) </s> remove export function usePropsResolution(component: string, incomingProps: any) { </s> add export function usePropsResolution( component: string, incomingProps: any, config?: any ) { const [ignoredProps, cleanIncomingProps] = extractInObject( incomingProps, ['children', 'onPress', 'icon', 'onOpen', 'onClose'].concat( config?.ignoreProps || [] ) ); </s> remove // return translatedProps; // }; </s> add return translatedProps; }; </s> remove // const propTranslator = ({ // props, // theme, // colorModeProps, // componentTheme, // currentBreakpoint, // }: { // props: any; // theme: any; // colorModeProps: object; // componentTheme: object; // currentBreakpoint: number; // }) => { // let translatedProps: any = {}; // for (const property in props) { // // STEP 1 - Responsive prop check and resolve // if (property.startsWith('_')) { // // STEP 1.a - Resolving _ porps // const nestedTranslatedProps = propTranslator({ // props: props[property], // theme, // colorModeProps, // componentTheme, // currentBreakpoint, // }); // translatedProps[property] = nestedTranslatedProps; // } else if (themePropertyMap[property]) { // // STEP 1.b Resolving themed props // const propValues = extractPropertyFromFunction( // property, // props, // theme, // componentTheme // ); </s> add const propTranslator = ({ props, theme, colorModeProps, componentTheme, currentBreakpoint, }: { props: any; theme: any; colorModeProps: object; componentTheme: object; currentBreakpoint: number; }) => { let translatedProps: any = {}; for (const property in props) { // STEP 1 - Responsive prop check and resolve if (property.startsWith('_')) { // STEP 1.a - Resolving _ porps const nestedTranslatedProps = propTranslator({ props: props[property], theme, colorModeProps, componentTheme, currentBreakpoint, }); translatedProps[property] = nestedTranslatedProps; } else if (themePropertyMap[property]) { // STEP 1.b Resolving themed props const propValues = extractPropertyFromFunction( property, props, theme, componentTheme );
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/hooks/useThemeProps/usePropsResolution.tsx
const componentThemeIntegratedProps = merge( {}, useColorModeProps(usePlatformProps(componentThemeObject)), useColorModeProps(usePlatformProps(cleanIncomingProps)) ); // const platformSpecificProps = usePlatformProps(componentThemeIntegratedProps);
<mask> cleanIncomingProps, <mask> colorModeProps, <mask> currentBreakpoint <mask> ); <mask> <mask> // NOTE: sperating removing props while should be translated <mask> let ignore: any = []; <mask> if ( </s> feat: add feature flag for new styled system impl (#3864) </s> remove incomingProps, </s> add cleanIncomingProps, </s> remove // const propTranslator = ({ // props, // theme, // colorModeProps, // componentTheme, // currentBreakpoint, // }: { // props: any; // theme: any; // colorModeProps: object; // componentTheme: object; // currentBreakpoint: number; // }) => { // let translatedProps: any = {}; // for (const property in props) { // // STEP 1 - Responsive prop check and resolve // if (property.startsWith('_')) { // // STEP 1.a - Resolving _ porps // const nestedTranslatedProps = propTranslator({ // props: props[property], // theme, // colorModeProps, // componentTheme, // currentBreakpoint, // }); // translatedProps[property] = nestedTranslatedProps; // } else if (themePropertyMap[property]) { // // STEP 1.b Resolving themed props // const propValues = extractPropertyFromFunction( // property, // props, // theme, // componentTheme // ); </s> add const propTranslator = ({ props, theme, colorModeProps, componentTheme, currentBreakpoint, }: { props: any; theme: any; colorModeProps: object; componentTheme: object; currentBreakpoint: number; }) => { let translatedProps: any = {}; for (const property in props) { // STEP 1 - Responsive prop check and resolve if (property.startsWith('_')) { // STEP 1.a - Resolving _ porps const nestedTranslatedProps = propTranslator({ props: props[property], theme, colorModeProps, componentTheme, currentBreakpoint, }); translatedProps[property] = nestedTranslatedProps; } else if (themePropertyMap[property]) { // STEP 1.b Resolving themed props const propValues = extractPropertyFromFunction( property, props, theme, componentTheme ); </s> remove // // NOTE: Direct value identified. // if (typeof propValues === 'string' || typeof propValues === 'number') { // translatedProps[property] = propValues; // // NOTE: Nested object (excluding _props) (To be specific, only for key exist in themePropertyMap) // } else if (!isNil(propValues)) { // // TODO: This setion new needs to handle stuff differently // for (let nestedProp in propValues) { // translatedProps[nestedProp] = get( // theme, // `${themePropertyMap[nestedProp]}.${propValues[nestedProp]}`, // propValues[nestedProp] // ); // } // delete translatedProps[property]; // // Manually handeling shadow props (example of Mapped tokens) // } else if (property === 'shadow') { // const resolveValueWithBreakpointValue = resolveValueWithBreakpoint( // props.shadow, // currentBreakpoint, // property // ); // let shadowProps = theme[themePropertyMap[property]](colorModeProps)[ // resolveValueWithBreakpointValue // ]; // translatedProps.style = merge({}, shadowProps, props.style); // delete translatedProps[property]; // } else { // translatedProps[property] = resolveValueWithBreakpoint( // props[property], // currentBreakpoint, // property // ); // } // } else { // // STEP 1.d Resolving Direct Values // translatedProps[property] = resolveValueWithBreakpoint( // props[property], // currentBreakpoint, // property // ); // } // } </s> add // NOTE: Direct value identified. if (typeof propValues === 'string' || typeof propValues === 'number') { translatedProps[property] = propValues; // NOTE: Nested object (excluding _props) (To be specific, only for key exist in themePropertyMap) } else if (!isNil(propValues)) { // TODO: This setion new needs to handle stuff differently for (let nestedProp in propValues) { translatedProps[nestedProp] = get( theme, `${themePropertyMap[nestedProp]}.${propValues[nestedProp]}`, propValues[nestedProp] ); } delete translatedProps[property]; // Manually handeling shadow props (example of Mapped tokens) } else if (property === 'shadow') { const resolveValueWithBreakpointValue = resolveValueWithBreakpoint( props.shadow, currentBreakpoint, property ); let shadowProps = theme[themePropertyMap[property]](colorModeProps)[ resolveValueWithBreakpointValue ]; translatedProps.style = merge({}, shadowProps, props.style); delete translatedProps[property]; } else { translatedProps[property] = resolveValueWithBreakpoint( props[property], currentBreakpoint, property ); } } else { // STEP 1.d Resolving Direct Values translatedProps[property] = resolveValueWithBreakpoint( props[property], currentBreakpoint, property ); } } </s> remove componentThemeObject.bg?.linearGradient || componentThemeObject.background?.linearGradient || componentThemeObject.bgColor?.linearGradient || componentThemeObject.backgroundColor?.linearGradient </s> add componentThemeIntegratedProps.bg?.linearGradient || componentThemeIntegratedProps.background?.linearGradient || componentThemeIntegratedProps.bgColor?.linearGradient || componentThemeIntegratedProps.backgroundColor?.linearGradient
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/hooks/useThemeProps/usePropsResolution.tsx
// NOTE: sperating removing props while should be translated let ignore: any = [];
<mask> useColorModeProps(usePlatformProps(cleanIncomingProps)) <mask> ); <mask> // const platformSpecificProps = usePlatformProps(componentThemeIntegratedProps); <mask> <mask> if ( <mask> componentThemeIntegratedProps.bg?.linearGradient || <mask> componentThemeIntegratedProps.background?.linearGradient || <mask> componentThemeIntegratedProps.bgColor?.linearGradient || </s> feat: add feature flag for new styled system impl (#3864) </s> remove componentThemeObject.bg?.linearGradient || componentThemeObject.background?.linearGradient || componentThemeObject.bgColor?.linearGradient || componentThemeObject.backgroundColor?.linearGradient </s> add componentThemeIntegratedProps.bg?.linearGradient || componentThemeIntegratedProps.background?.linearGradient || componentThemeIntegratedProps.bgColor?.linearGradient || componentThemeIntegratedProps.backgroundColor?.linearGradient </s> remove if (componentThemeObject.background?.linearGradient) { </s> add if (componentThemeIntegratedProps.background?.linearGradient) { </s> remove export function usePropsResolution(component: string, incomingProps: any) { </s> add export function usePropsResolution( component: string, incomingProps: any, config?: any ) { const [ignoredProps, cleanIncomingProps] = extractInObject( incomingProps, ['children', 'onPress', 'icon', 'onOpen', 'onClose'].concat( config?.ignoreProps || [] ) ); </s> remove // // NOTE: Direct value identified. // if (typeof propValues === 'string' || typeof propValues === 'number') { // translatedProps[property] = propValues; // // NOTE: Nested object (excluding _props) (To be specific, only for key exist in themePropertyMap) // } else if (!isNil(propValues)) { // // TODO: This setion new needs to handle stuff differently // for (let nestedProp in propValues) { // translatedProps[nestedProp] = get( // theme, // `${themePropertyMap[nestedProp]}.${propValues[nestedProp]}`, // propValues[nestedProp] // ); // } // delete translatedProps[property]; // // Manually handeling shadow props (example of Mapped tokens) // } else if (property === 'shadow') { // const resolveValueWithBreakpointValue = resolveValueWithBreakpoint( // props.shadow, // currentBreakpoint, // property // ); // let shadowProps = theme[themePropertyMap[property]](colorModeProps)[ // resolveValueWithBreakpointValue // ]; // translatedProps.style = merge({}, shadowProps, props.style); // delete translatedProps[property]; // } else { // translatedProps[property] = resolveValueWithBreakpoint( // props[property], // currentBreakpoint, // property // ); // } // } else { // // STEP 1.d Resolving Direct Values // translatedProps[property] = resolveValueWithBreakpoint( // props[property], // currentBreakpoint, // property // ); // } // } </s> add // NOTE: Direct value identified. if (typeof propValues === 'string' || typeof propValues === 'number') { translatedProps[property] = propValues; // NOTE: Nested object (excluding _props) (To be specific, only for key exist in themePropertyMap) } else if (!isNil(propValues)) { // TODO: This setion new needs to handle stuff differently for (let nestedProp in propValues) { translatedProps[nestedProp] = get( theme, `${themePropertyMap[nestedProp]}.${propValues[nestedProp]}`, propValues[nestedProp] ); } delete translatedProps[property]; // Manually handeling shadow props (example of Mapped tokens) } else if (property === 'shadow') { const resolveValueWithBreakpointValue = resolveValueWithBreakpoint( props.shadow, currentBreakpoint, property ); let shadowProps = theme[themePropertyMap[property]](colorModeProps)[ resolveValueWithBreakpointValue ]; translatedProps.style = merge({}, shadowProps, props.style); delete translatedProps[property]; } else { translatedProps[property] = resolveValueWithBreakpoint( props[property], currentBreakpoint, property ); } } else { // STEP 1.d Resolving Direct Values translatedProps[property] = resolveValueWithBreakpoint( props[property], currentBreakpoint, property ); } }
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/hooks/useThemeProps/usePropsResolution.tsx
componentThemeIntegratedProps.bg?.linearGradient || componentThemeIntegratedProps.background?.linearGradient || componentThemeIntegratedProps.bgColor?.linearGradient || componentThemeIntegratedProps.backgroundColor?.linearGradient
<mask> currentBreakpoint <mask> ); <mask> <mask> if ( <mask> componentThemeObject.bg?.linearGradient || <mask> componentThemeObject.background?.linearGradient || <mask> componentThemeObject.bgColor?.linearGradient || <mask> componentThemeObject.backgroundColor?.linearGradient <mask> ) { <mask> let bgProp = 'bg'; <mask> if (componentThemeObject.background?.linearGradient) { <mask> bgProp = 'background'; <mask> } else if (componentThemeObject.bgColor?.linearGradient) { </s> feat: add feature flag for new styled system impl (#3864) </s> remove if (componentThemeObject.background?.linearGradient) { </s> add if (componentThemeIntegratedProps.background?.linearGradient) { </s> remove } else if (componentThemeObject.bgColor?.linearGradient) { </s> add } else if (componentThemeIntegratedProps.bgColor?.linearGradient) { </s> remove } else if (componentThemeObject.backgroundColor?.linearGradient) { </s> add } else if (componentThemeIntegratedProps.backgroundColor?.linearGradient) { </s> remove componentThemeObject[bgProp].linearGradient.colors = componentThemeObject[ </s> add componentThemeIntegratedProps[ bgProp ].linearGradient.colors = componentThemeIntegratedProps[
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/hooks/useThemeProps/usePropsResolution.tsx
if (componentThemeIntegratedProps.background?.linearGradient) {
<mask> componentThemeObject.bgColor?.linearGradient || <mask> componentThemeObject.backgroundColor?.linearGradient <mask> ) { <mask> let bgProp = 'bg'; <mask> if (componentThemeObject.background?.linearGradient) { <mask> bgProp = 'background'; <mask> } else if (componentThemeObject.bgColor?.linearGradient) { <mask> bgProp = 'bgColor'; <mask> } else if (componentThemeObject.backgroundColor?.linearGradient) { <mask> bgProp = 'backgroundColor'; </s> feat: add feature flag for new styled system impl (#3864) </s> remove } else if (componentThemeObject.bgColor?.linearGradient) { </s> add } else if (componentThemeIntegratedProps.bgColor?.linearGradient) { </s> remove componentThemeObject.bg?.linearGradient || componentThemeObject.background?.linearGradient || componentThemeObject.bgColor?.linearGradient || componentThemeObject.backgroundColor?.linearGradient </s> add componentThemeIntegratedProps.bg?.linearGradient || componentThemeIntegratedProps.background?.linearGradient || componentThemeIntegratedProps.bgColor?.linearGradient || componentThemeIntegratedProps.backgroundColor?.linearGradient </s> remove } else if (componentThemeObject.backgroundColor?.linearGradient) { </s> add } else if (componentThemeIntegratedProps.backgroundColor?.linearGradient) { </s> remove componentThemeObject[bgProp].linearGradient.colors = componentThemeObject[ </s> add componentThemeIntegratedProps[ bgProp ].linearGradient.colors = componentThemeIntegratedProps[ </s> remove // // NOTE: Direct value identified. // if (typeof propValues === 'string' || typeof propValues === 'number') { // translatedProps[property] = propValues; // // NOTE: Nested object (excluding _props) (To be specific, only for key exist in themePropertyMap) // } else if (!isNil(propValues)) { // // TODO: This setion new needs to handle stuff differently // for (let nestedProp in propValues) { // translatedProps[nestedProp] = get( // theme, // `${themePropertyMap[nestedProp]}.${propValues[nestedProp]}`, // propValues[nestedProp] // ); // } // delete translatedProps[property]; // // Manually handeling shadow props (example of Mapped tokens) // } else if (property === 'shadow') { // const resolveValueWithBreakpointValue = resolveValueWithBreakpoint( // props.shadow, // currentBreakpoint, // property // ); // let shadowProps = theme[themePropertyMap[property]](colorModeProps)[ // resolveValueWithBreakpointValue // ]; // translatedProps.style = merge({}, shadowProps, props.style); // delete translatedProps[property]; // } else { // translatedProps[property] = resolveValueWithBreakpoint( // props[property], // currentBreakpoint, // property // ); // } // } else { // // STEP 1.d Resolving Direct Values // translatedProps[property] = resolveValueWithBreakpoint( // props[property], // currentBreakpoint, // property // ); // } // } </s> add // NOTE: Direct value identified. if (typeof propValues === 'string' || typeof propValues === 'number') { translatedProps[property] = propValues; // NOTE: Nested object (excluding _props) (To be specific, only for key exist in themePropertyMap) } else if (!isNil(propValues)) { // TODO: This setion new needs to handle stuff differently for (let nestedProp in propValues) { translatedProps[nestedProp] = get( theme, `${themePropertyMap[nestedProp]}.${propValues[nestedProp]}`, propValues[nestedProp] ); } delete translatedProps[property]; // Manually handeling shadow props (example of Mapped tokens) } else if (property === 'shadow') { const resolveValueWithBreakpointValue = resolveValueWithBreakpoint( props.shadow, currentBreakpoint, property ); let shadowProps = theme[themePropertyMap[property]](colorModeProps)[ resolveValueWithBreakpointValue ]; translatedProps.style = merge({}, shadowProps, props.style); delete translatedProps[property]; } else { translatedProps[property] = resolveValueWithBreakpoint( props[property], currentBreakpoint, property ); } } else { // STEP 1.d Resolving Direct Values translatedProps[property] = resolveValueWithBreakpoint( props[property], currentBreakpoint, property ); } }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/hooks/useThemeProps/usePropsResolution.tsx
} else if (componentThemeIntegratedProps.bgColor?.linearGradient) {
<mask> ) { <mask> let bgProp = 'bg'; <mask> if (componentThemeObject.background?.linearGradient) { <mask> bgProp = 'background'; <mask> } else if (componentThemeObject.bgColor?.linearGradient) { <mask> bgProp = 'bgColor'; <mask> } else if (componentThemeObject.backgroundColor?.linearGradient) { <mask> bgProp = 'backgroundColor'; <mask> } <mask> componentThemeObject[bgProp].linearGradient.colors = componentThemeObject[ </s> feat: add feature flag for new styled system impl (#3864) </s> remove if (componentThemeObject.background?.linearGradient) { </s> add if (componentThemeIntegratedProps.background?.linearGradient) { </s> remove } else if (componentThemeObject.backgroundColor?.linearGradient) { </s> add } else if (componentThemeIntegratedProps.backgroundColor?.linearGradient) { </s> remove componentThemeObject[bgProp].linearGradient.colors = componentThemeObject[ </s> add componentThemeIntegratedProps[ bgProp ].linearGradient.colors = componentThemeIntegratedProps[ </s> remove componentThemeObject.bg?.linearGradient || componentThemeObject.background?.linearGradient || componentThemeObject.bgColor?.linearGradient || componentThemeObject.backgroundColor?.linearGradient </s> add componentThemeIntegratedProps.bg?.linearGradient || componentThemeIntegratedProps.background?.linearGradient || componentThemeIntegratedProps.bgColor?.linearGradient || componentThemeIntegratedProps.backgroundColor?.linearGradient </s> remove const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); </s> add const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/hooks/useThemeProps/usePropsResolution.tsx
} else if (componentThemeIntegratedProps.backgroundColor?.linearGradient) {
<mask> if (componentThemeObject.background?.linearGradient) { <mask> bgProp = 'background'; <mask> } else if (componentThemeObject.bgColor?.linearGradient) { <mask> bgProp = 'bgColor'; <mask> } else if (componentThemeObject.backgroundColor?.linearGradient) { <mask> bgProp = 'backgroundColor'; <mask> } <mask> componentThemeObject[bgProp].linearGradient.colors = componentThemeObject[ <mask> bgProp <mask> ].linearGradient.colors.map((color: string) => { </s> feat: add feature flag for new styled system impl (#3864) </s> remove } else if (componentThemeObject.bgColor?.linearGradient) { </s> add } else if (componentThemeIntegratedProps.bgColor?.linearGradient) { </s> remove componentThemeObject[bgProp].linearGradient.colors = componentThemeObject[ </s> add componentThemeIntegratedProps[ bgProp ].linearGradient.colors = componentThemeIntegratedProps[ </s> remove if (componentThemeObject.background?.linearGradient) { </s> add if (componentThemeIntegratedProps.background?.linearGradient) { </s> remove componentThemeObject.bg?.linearGradient || componentThemeObject.background?.linearGradient || componentThemeObject.bgColor?.linearGradient || componentThemeObject.backgroundColor?.linearGradient </s> add componentThemeIntegratedProps.bg?.linearGradient || componentThemeIntegratedProps.background?.linearGradient || componentThemeIntegratedProps.bgColor?.linearGradient || componentThemeIntegratedProps.backgroundColor?.linearGradient </s> remove const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); </s> add const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/hooks/useThemeProps/usePropsResolution.tsx
componentThemeIntegratedProps[ bgProp ].linearGradient.colors = componentThemeIntegratedProps[
<mask> bgProp = 'bgColor'; <mask> } else if (componentThemeObject.backgroundColor?.linearGradient) { <mask> bgProp = 'backgroundColor'; <mask> } <mask> componentThemeObject[bgProp].linearGradient.colors = componentThemeObject[ <mask> bgProp <mask> ].linearGradient.colors.map((color: string) => { <mask> return get(theme.colors, color, color); <mask> }); <mask> } </s> feat: add feature flag for new styled system impl (#3864) </s> remove } else if (componentThemeObject.backgroundColor?.linearGradient) { </s> add } else if (componentThemeIntegratedProps.backgroundColor?.linearGradient) { </s> remove } else if (componentThemeObject.bgColor?.linearGradient) { </s> add } else if (componentThemeIntegratedProps.bgColor?.linearGradient) { </s> remove if (componentThemeObject.background?.linearGradient) { </s> add if (componentThemeIntegratedProps.background?.linearGradient) { </s> remove componentThemeObject.bg?.linearGradient || componentThemeObject.background?.linearGradient || componentThemeObject.bgColor?.linearGradient || componentThemeObject.backgroundColor?.linearGradient </s> add componentThemeIntegratedProps.bg?.linearGradient || componentThemeIntegratedProps.background?.linearGradient || componentThemeIntegratedProps.bgColor?.linearGradient || componentThemeIntegratedProps.backgroundColor?.linearGradient </s> remove const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); </s> add const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/hooks/useThemeProps/usePropsResolution.tsx
translatedProps.bg ?? translatedProps.backgroundColor ?? translatedProps.bgColor;
<mask> }); <mask> } <mask> <mask> let bgColor = <mask> componentThemeObject.bg ?? <mask> componentThemeObject.backgroundColor ?? <mask> componentThemeObject.bgColor; <mask> <mask> const contrastTextColor = useContrastText( <mask> bgColor, <mask> componentThemeObject?._text?.color <mask> ); </s> feat: add feature flag for new styled system impl (#3864) </s> remove componentThemeObject?._text?.color </s> add translatedProps?._text?.color </s> remove componentThemeObject._text = contrastTextColor </s> add translatedProps._text = contrastTextColor </s> remove ...componentThemeObject._text, </s> add ...translatedProps._text, </s> remove componentThemeObject[bgProp].linearGradient.colors = componentThemeObject[ </s> add componentThemeIntegratedProps[ bgProp ].linearGradient.colors = componentThemeIntegratedProps[ </s> remove : componentThemeObject._text; </s> add : translatedProps._text; const resolvedProps = omitUndefined({ ...translatedProps, ...ignoredProps, ...gradientProps, });
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/hooks/useThemeProps/usePropsResolution.tsx
translatedProps?._text?.color
<mask> componentThemeObject.bgColor; <mask> <mask> const contrastTextColor = useContrastText( <mask> bgColor, <mask> componentThemeObject?._text?.color <mask> ); <mask> <mask> componentThemeObject._text = contrastTextColor <mask> ? { <mask> color: contrastTextColor, </s> feat: add feature flag for new styled system impl (#3864) </s> remove componentThemeObject._text = contrastTextColor </s> add translatedProps._text = contrastTextColor </s> remove componentThemeObject.bg ?? componentThemeObject.backgroundColor ?? componentThemeObject.bgColor; </s> add translatedProps.bg ?? translatedProps.backgroundColor ?? translatedProps.bgColor; </s> remove ...componentThemeObject._text, </s> add ...translatedProps._text, </s> remove : componentThemeObject._text; </s> add : translatedProps._text; const resolvedProps = omitUndefined({ ...translatedProps, ...ignoredProps, ...gradientProps, }); </s> remove const currentBreakpoint = React.useMemo( //@ts-ignore () => getClosestBreakpoint(theme.breakpoints, windowWidth), //@ts-ignore [windowWidth, theme.breakpoints] ); </s> add const currentBreakpoint = React.useMemo( //@ts-ignore () => getClosestBreakpoint(theme.breakpoints, windowWidth), //@ts-ignore [windowWidth, theme.breakpoints] );
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/hooks/useThemeProps/usePropsResolution.tsx
translatedProps._text = contrastTextColor
<mask> bgColor, <mask> componentThemeObject?._text?.color <mask> ); <mask> <mask> componentThemeObject._text = contrastTextColor <mask> ? { <mask> color: contrastTextColor, <mask> ...componentThemeObject._text, <mask> } <mask> : componentThemeObject._text; </s> feat: add feature flag for new styled system impl (#3864) </s> remove ...componentThemeObject._text, </s> add ...translatedProps._text, </s> remove componentThemeObject?._text?.color </s> add translatedProps?._text?.color </s> remove : componentThemeObject._text; </s> add : translatedProps._text; const resolvedProps = omitUndefined({ ...translatedProps, ...ignoredProps, ...gradientProps, }); </s> remove componentThemeObject.bg ?? componentThemeObject.backgroundColor ?? componentThemeObject.bgColor; </s> add translatedProps.bg ?? translatedProps.backgroundColor ?? translatedProps.bgColor; </s> remove return componentThemeObject; </s> add return resolvedProps;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/hooks/useThemeProps/usePropsResolution.tsx
...translatedProps._text,
<mask> <mask> componentThemeObject._text = contrastTextColor <mask> ? { <mask> color: contrastTextColor, <mask> ...componentThemeObject._text, <mask> } <mask> : componentThemeObject._text; <mask> <mask> return componentThemeObject; <mask> } </s> feat: add feature flag for new styled system impl (#3864) </s> remove componentThemeObject._text = contrastTextColor </s> add translatedProps._text = contrastTextColor </s> remove : componentThemeObject._text; </s> add : translatedProps._text; const resolvedProps = omitUndefined({ ...translatedProps, ...ignoredProps, ...gradientProps, }); </s> remove componentThemeObject?._text?.color </s> add translatedProps?._text?.color </s> remove return componentThemeObject; </s> add return resolvedProps; </s> remove const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); </s> add const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/hooks/useThemeProps/usePropsResolution.tsx
: translatedProps._text; const resolvedProps = omitUndefined({ ...translatedProps, ...ignoredProps, ...gradientProps, });
<mask> ? { <mask> color: contrastTextColor, <mask> ...componentThemeObject._text, <mask> } <mask> : componentThemeObject._text; <mask> <mask> return componentThemeObject; <mask> } </s> feat: add feature flag for new styled system impl (#3864) </s> remove ...componentThemeObject._text, </s> add ...translatedProps._text, </s> remove componentThemeObject._text = contrastTextColor </s> add translatedProps._text = contrastTextColor </s> remove return componentThemeObject; </s> add return resolvedProps; </s> remove componentThemeObject?._text?.color </s> add translatedProps?._text?.color </s> remove const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); </s> add const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/hooks/useThemeProps/usePropsResolution.tsx
return resolvedProps;
<mask> ...componentThemeObject._text, <mask> } <mask> : componentThemeObject._text; <mask> <mask> return componentThemeObject; <mask> } </s> feat: add feature flag for new styled system impl (#3864) </s> remove ...componentThemeObject._text, </s> add ...translatedProps._text, </s> remove : componentThemeObject._text; </s> add : translatedProps._text; const resolvedProps = omitUndefined({ ...translatedProps, ...ignoredProps, ...gradientProps, }); </s> remove componentThemeObject._text = contrastTextColor </s> add translatedProps._text = contrastTextColor </s> remove return ( <Comp {...restProps} style={style} ref={ref}> {children} </Comp> ); } ); </s> add return ( <Comp {...restProps} style={style} ref={ref}> {children} </Comp> ); } ); } else { //@ts-ignore return styled(Comp)(...resolversForBox); } </s> remove const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); </s> add const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]);
[ "keep", "keep", "keep", "keep", "replace", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/hooks/useThemeProps/usePropsResolution.tsx
import styled, { useTheme } from 'styled-components/native';
<mask> import { getStyleAndFilteredProps } from '../theme/styled-system'; <mask> import { useTheme } from 'styled-components/native'; <mask> import { <mask> border, <mask> color, <mask> flexbox, <mask> layout, </s> feat: add feature flag for new styled system impl (#3864) </s> remove // import isNil from 'lodash.isnil'; </s> add import isNil from 'lodash.isnil'; </s> remove // extractPropertyFromFunction, </s> add extractPropertyFromFunction, </s> remove // omitUndefined, // extractInObject, </s> add omitUndefined, extractInObject, </s> remove // import { themePropertyMap } from './../../theme/base'; </s> add import { themePropertyMap } from './../../theme/base';
[ "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/utils/styled.tsx
export let shouldEnableNewStyledSystemImplementation = false;
<mask> customTypography, <mask> customLayout, <mask> ]; <mask> <mask> // @ts-ignore <mask> export const makeStyledComponent = (Comp: any) => { <mask> return React.forwardRef( <mask> ({ style: propStyle, children, debug, ...props }: any, ref: any) => { <mask> const theme = useTheme(); <mask> const windowWidth = useWindowDimensions().width; </s> feat: add feature flag for new styled system impl (#3864) </s> remove return React.forwardRef( ({ style: propStyle, children, debug, ...props }: any, ref: any) => { const theme = useTheme(); const windowWidth = useWindowDimensions().width; </s> add if (shouldEnableNewStyledSystemImplementation) { return React.forwardRef( ({ style: propStyle, children, debug, ...props }: any, ref: any) => { const theme = useTheme(); const windowWidth = useWindowDimensions().width; </s> remove const currentBreakpoint = React.useMemo( //@ts-ignore () => getClosestBreakpoint(theme.breakpoints, windowWidth), //@ts-ignore [windowWidth, theme.breakpoints] ); </s> add const currentBreakpoint = React.useMemo( //@ts-ignore () => getClosestBreakpoint(theme.breakpoints, windowWidth), //@ts-ignore [windowWidth, theme.breakpoints] ); </s> remove const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); </s> add const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); </s> remove export function usePropsResolution(component: string, incomingProps: any) { </s> add export function usePropsResolution( component: string, incomingProps: any, config?: any ) { const [ignoredProps, cleanIncomingProps] = extractInObject( incomingProps, ['children', 'onPress', 'icon', 'onOpen', 'onClose'].concat( config?.ignoreProps || [] ) ); </s> remove // const propTranslator = ({ // props, // theme, // colorModeProps, // componentTheme, // currentBreakpoint, // }: { // props: any; // theme: any; // colorModeProps: object; // componentTheme: object; // currentBreakpoint: number; // }) => { // let translatedProps: any = {}; // for (const property in props) { // // STEP 1 - Responsive prop check and resolve // if (property.startsWith('_')) { // // STEP 1.a - Resolving _ porps // const nestedTranslatedProps = propTranslator({ // props: props[property], // theme, // colorModeProps, // componentTheme, // currentBreakpoint, // }); // translatedProps[property] = nestedTranslatedProps; // } else if (themePropertyMap[property]) { // // STEP 1.b Resolving themed props // const propValues = extractPropertyFromFunction( // property, // props, // theme, // componentTheme // ); </s> add const propTranslator = ({ props, theme, colorModeProps, componentTheme, currentBreakpoint, }: { props: any; theme: any; colorModeProps: object; componentTheme: object; currentBreakpoint: number; }) => { let translatedProps: any = {}; for (const property in props) { // STEP 1 - Responsive prop check and resolve if (property.startsWith('_')) { // STEP 1.a - Resolving _ porps const nestedTranslatedProps = propTranslator({ props: props[property], theme, colorModeProps, componentTheme, currentBreakpoint, }); translatedProps[property] = nestedTranslatedProps; } else if (themePropertyMap[property]) { // STEP 1.b Resolving themed props const propValues = extractPropertyFromFunction( property, props, theme, componentTheme );
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/utils/styled.tsx
if (shouldEnableNewStyledSystemImplementation) { return React.forwardRef( ({ style: propStyle, children, debug, ...props }: any, ref: any) => { const theme = useTheme(); const windowWidth = useWindowDimensions().width;
<mask> ]; <mask> <mask> // @ts-ignore <mask> export const makeStyledComponent = (Comp: any) => { <mask> return React.forwardRef( <mask> ({ style: propStyle, children, debug, ...props }: any, ref: any) => { <mask> const theme = useTheme(); <mask> const windowWidth = useWindowDimensions().width; <mask> <mask> const currentBreakpoint = React.useMemo( <mask> //@ts-ignore <mask> () => getClosestBreakpoint(theme.breakpoints, windowWidth), <mask> //@ts-ignore </s> feat: add feature flag for new styled system impl (#3864) </s> remove // @ts-ignore </s> add export let shouldEnableNewStyledSystemImplementation = false; </s> remove const currentBreakpoint = React.useMemo( //@ts-ignore () => getClosestBreakpoint(theme.breakpoints, windowWidth), //@ts-ignore [windowWidth, theme.breakpoints] ); </s> add const currentBreakpoint = React.useMemo( //@ts-ignore () => getClosestBreakpoint(theme.breakpoints, windowWidth), //@ts-ignore [windowWidth, theme.breakpoints] ); </s> remove const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); </s> add const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); </s> remove export function usePropsResolution(component: string, incomingProps: any) { </s> add export function usePropsResolution( component: string, incomingProps: any, config?: any ) { const [ignoredProps, cleanIncomingProps] = extractInObject( incomingProps, ['children', 'onPress', 'icon', 'onOpen', 'onClose'].concat( config?.ignoreProps || [] ) ); </s> remove // const propTranslator = ({ // props, // theme, // colorModeProps, // componentTheme, // currentBreakpoint, // }: { // props: any; // theme: any; // colorModeProps: object; // componentTheme: object; // currentBreakpoint: number; // }) => { // let translatedProps: any = {}; // for (const property in props) { // // STEP 1 - Responsive prop check and resolve // if (property.startsWith('_')) { // // STEP 1.a - Resolving _ porps // const nestedTranslatedProps = propTranslator({ // props: props[property], // theme, // colorModeProps, // componentTheme, // currentBreakpoint, // }); // translatedProps[property] = nestedTranslatedProps; // } else if (themePropertyMap[property]) { // // STEP 1.b Resolving themed props // const propValues = extractPropertyFromFunction( // property, // props, // theme, // componentTheme // ); </s> add const propTranslator = ({ props, theme, colorModeProps, componentTheme, currentBreakpoint, }: { props: any; theme: any; colorModeProps: object; componentTheme: object; currentBreakpoint: number; }) => { let translatedProps: any = {}; for (const property in props) { // STEP 1 - Responsive prop check and resolve if (property.startsWith('_')) { // STEP 1.a - Resolving _ porps const nestedTranslatedProps = propTranslator({ props: props[property], theme, colorModeProps, componentTheme, currentBreakpoint, }); translatedProps[property] = nestedTranslatedProps; } else if (themePropertyMap[property]) { // STEP 1.b Resolving themed props const propValues = extractPropertyFromFunction( property, props, theme, componentTheme );
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/utils/styled.tsx
const currentBreakpoint = React.useMemo( //@ts-ignore () => getClosestBreakpoint(theme.breakpoints, windowWidth), //@ts-ignore [windowWidth, theme.breakpoints] );
<mask> ({ style: propStyle, children, debug, ...props }: any, ref: any) => { <mask> const theme = useTheme(); <mask> const windowWidth = useWindowDimensions().width; <mask> <mask> const currentBreakpoint = React.useMemo( <mask> //@ts-ignore <mask> () => getClosestBreakpoint(theme.breakpoints, windowWidth), <mask> //@ts-ignore <mask> [windowWidth, theme.breakpoints] <mask> ); <mask> <mask> const { style, restProps } = React.useMemo(() => { <mask> const { styleSheet, restProps } = getStyleAndFilteredProps({ <mask> ...props, <mask> theme, </s> feat: add feature flag for new styled system impl (#3864) </s> remove return React.forwardRef( ({ style: propStyle, children, debug, ...props }: any, ref: any) => { const theme = useTheme(); const windowWidth = useWindowDimensions().width; </s> add if (shouldEnableNewStyledSystemImplementation) { return React.forwardRef( ({ style: propStyle, children, debug, ...props }: any, ref: any) => { const theme = useTheme(); const windowWidth = useWindowDimensions().width; </s> remove const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); </s> add const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); </s> remove // @ts-ignore </s> add export let shouldEnableNewStyledSystemImplementation = false; </s> remove return ( <Comp {...restProps} style={style} ref={ref}> {children} </Comp> ); } ); </s> add return ( <Comp {...restProps} style={style} ref={ref}> {children} </Comp> ); } ); } else { //@ts-ignore return styled(Comp)(...resolversForBox); } </s> remove // const propTranslator = ({ // props, // theme, // colorModeProps, // componentTheme, // currentBreakpoint, // }: { // props: any; // theme: any; // colorModeProps: object; // componentTheme: object; // currentBreakpoint: number; // }) => { // let translatedProps: any = {}; // for (const property in props) { // // STEP 1 - Responsive prop check and resolve // if (property.startsWith('_')) { // // STEP 1.a - Resolving _ porps // const nestedTranslatedProps = propTranslator({ // props: props[property], // theme, // colorModeProps, // componentTheme, // currentBreakpoint, // }); // translatedProps[property] = nestedTranslatedProps; // } else if (themePropertyMap[property]) { // // STEP 1.b Resolving themed props // const propValues = extractPropertyFromFunction( // property, // props, // theme, // componentTheme // ); </s> add const propTranslator = ({ props, theme, colorModeProps, componentTheme, currentBreakpoint, }: { props: any; theme: any; colorModeProps: object; componentTheme: object; currentBreakpoint: number; }) => { let translatedProps: any = {}; for (const property in props) { // STEP 1 - Responsive prop check and resolve if (property.startsWith('_')) { // STEP 1.a - Resolving _ porps const nestedTranslatedProps = propTranslator({ props: props[property], theme, colorModeProps, componentTheme, currentBreakpoint, }); translatedProps[property] = nestedTranslatedProps; } else if (themePropertyMap[property]) { // STEP 1.b Resolving themed props const propValues = extractPropertyFromFunction( property, props, theme, componentTheme );
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/utils/styled.tsx
const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]);
<mask> //@ts-ignore <mask> [windowWidth, theme.breakpoints] <mask> ); <mask> <mask> const { style, restProps } = React.useMemo(() => { <mask> const { styleSheet, restProps } = getStyleAndFilteredProps({ <mask> ...props, <mask> theme, <mask> debug, <mask> currentBreakpoint, <mask> }); <mask> if (propStyle) { <mask> return { style: [styleSheet.box, propStyle], restProps }; <mask> } else { <mask> return { style: styleSheet.box, restProps }; <mask> } <mask> }, [props, theme, propStyle, currentBreakpoint, debug]); <mask> <mask> return ( <mask> <Comp {...restProps} style={style} ref={ref}> <mask> {children} <mask> </Comp> </s> feat: add feature flag for new styled system impl (#3864) </s> remove return ( <Comp {...restProps} style={style} ref={ref}> {children} </Comp> ); } ); </s> add return ( <Comp {...restProps} style={style} ref={ref}> {children} </Comp> ); } ); } else { //@ts-ignore return styled(Comp)(...resolversForBox); } </s> remove const currentBreakpoint = React.useMemo( //@ts-ignore () => getClosestBreakpoint(theme.breakpoints, windowWidth), //@ts-ignore [windowWidth, theme.breakpoints] ); </s> add const currentBreakpoint = React.useMemo( //@ts-ignore () => getClosestBreakpoint(theme.breakpoints, windowWidth), //@ts-ignore [windowWidth, theme.breakpoints] ); </s> remove return React.forwardRef( ({ style: propStyle, children, debug, ...props }: any, ref: any) => { const theme = useTheme(); const windowWidth = useWindowDimensions().width; </s> add if (shouldEnableNewStyledSystemImplementation) { return React.forwardRef( ({ style: propStyle, children, debug, ...props }: any, ref: any) => { const theme = useTheme(); const windowWidth = useWindowDimensions().width; </s> remove // // NOTE: Direct value identified. // if (typeof propValues === 'string' || typeof propValues === 'number') { // translatedProps[property] = propValues; // // NOTE: Nested object (excluding _props) (To be specific, only for key exist in themePropertyMap) // } else if (!isNil(propValues)) { // // TODO: This setion new needs to handle stuff differently // for (let nestedProp in propValues) { // translatedProps[nestedProp] = get( // theme, // `${themePropertyMap[nestedProp]}.${propValues[nestedProp]}`, // propValues[nestedProp] // ); // } // delete translatedProps[property]; // // Manually handeling shadow props (example of Mapped tokens) // } else if (property === 'shadow') { // const resolveValueWithBreakpointValue = resolveValueWithBreakpoint( // props.shadow, // currentBreakpoint, // property // ); // let shadowProps = theme[themePropertyMap[property]](colorModeProps)[ // resolveValueWithBreakpointValue // ]; // translatedProps.style = merge({}, shadowProps, props.style); // delete translatedProps[property]; // } else { // translatedProps[property] = resolveValueWithBreakpoint( // props[property], // currentBreakpoint, // property // ); // } // } else { // // STEP 1.d Resolving Direct Values // translatedProps[property] = resolveValueWithBreakpoint( // props[property], // currentBreakpoint, // property // ); // } // } </s> add // NOTE: Direct value identified. if (typeof propValues === 'string' || typeof propValues === 'number') { translatedProps[property] = propValues; // NOTE: Nested object (excluding _props) (To be specific, only for key exist in themePropertyMap) } else if (!isNil(propValues)) { // TODO: This setion new needs to handle stuff differently for (let nestedProp in propValues) { translatedProps[nestedProp] = get( theme, `${themePropertyMap[nestedProp]}.${propValues[nestedProp]}`, propValues[nestedProp] ); } delete translatedProps[property]; // Manually handeling shadow props (example of Mapped tokens) } else if (property === 'shadow') { const resolveValueWithBreakpointValue = resolveValueWithBreakpoint( props.shadow, currentBreakpoint, property ); let shadowProps = theme[themePropertyMap[property]](colorModeProps)[ resolveValueWithBreakpointValue ]; translatedProps.style = merge({}, shadowProps, props.style); delete translatedProps[property]; } else { translatedProps[property] = resolveValueWithBreakpoint( props[property], currentBreakpoint, property ); } } else { // STEP 1.d Resolving Direct Values translatedProps[property] = resolveValueWithBreakpoint( props[property], currentBreakpoint, property ); } } </s> remove componentThemeObject[bgProp].linearGradient.colors = componentThemeObject[ </s> add componentThemeIntegratedProps[ bgProp ].linearGradient.colors = componentThemeIntegratedProps[
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/utils/styled.tsx
return ( <Comp {...restProps} style={style} ref={ref}> {children} </Comp> ); } ); } else { //@ts-ignore return styled(Comp)(...resolversForBox); }
<mask> return { style: styleSheet.box, restProps }; <mask> } <mask> }, [props, theme, propStyle, currentBreakpoint, debug]); <mask> <mask> return ( <mask> <Comp {...restProps} style={style} ref={ref}> <mask> {children} <mask> </Comp> <mask> ); <mask> } <mask> ); <mask> }; </s> feat: add feature flag for new styled system impl (#3864) </s> remove const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); </s> add const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); </s> remove const currentBreakpoint = React.useMemo( //@ts-ignore () => getClosestBreakpoint(theme.breakpoints, windowWidth), //@ts-ignore [windowWidth, theme.breakpoints] ); </s> add const currentBreakpoint = React.useMemo( //@ts-ignore () => getClosestBreakpoint(theme.breakpoints, windowWidth), //@ts-ignore [windowWidth, theme.breakpoints] ); </s> remove // return translatedProps; // }; </s> add return translatedProps; }; </s> remove // // NOTE: Direct value identified. // if (typeof propValues === 'string' || typeof propValues === 'number') { // translatedProps[property] = propValues; // // NOTE: Nested object (excluding _props) (To be specific, only for key exist in themePropertyMap) // } else if (!isNil(propValues)) { // // TODO: This setion new needs to handle stuff differently // for (let nestedProp in propValues) { // translatedProps[nestedProp] = get( // theme, // `${themePropertyMap[nestedProp]}.${propValues[nestedProp]}`, // propValues[nestedProp] // ); // } // delete translatedProps[property]; // // Manually handeling shadow props (example of Mapped tokens) // } else if (property === 'shadow') { // const resolveValueWithBreakpointValue = resolveValueWithBreakpoint( // props.shadow, // currentBreakpoint, // property // ); // let shadowProps = theme[themePropertyMap[property]](colorModeProps)[ // resolveValueWithBreakpointValue // ]; // translatedProps.style = merge({}, shadowProps, props.style); // delete translatedProps[property]; // } else { // translatedProps[property] = resolveValueWithBreakpoint( // props[property], // currentBreakpoint, // property // ); // } // } else { // // STEP 1.d Resolving Direct Values // translatedProps[property] = resolveValueWithBreakpoint( // props[property], // currentBreakpoint, // property // ); // } // } </s> add // NOTE: Direct value identified. if (typeof propValues === 'string' || typeof propValues === 'number') { translatedProps[property] = propValues; // NOTE: Nested object (excluding _props) (To be specific, only for key exist in themePropertyMap) } else if (!isNil(propValues)) { // TODO: This setion new needs to handle stuff differently for (let nestedProp in propValues) { translatedProps[nestedProp] = get( theme, `${themePropertyMap[nestedProp]}.${propValues[nestedProp]}`, propValues[nestedProp] ); } delete translatedProps[property]; // Manually handeling shadow props (example of Mapped tokens) } else if (property === 'shadow') { const resolveValueWithBreakpointValue = resolveValueWithBreakpoint( props.shadow, currentBreakpoint, property ); let shadowProps = theme[themePropertyMap[property]](colorModeProps)[ resolveValueWithBreakpointValue ]; translatedProps.style = merge({}, shadowProps, props.style); delete translatedProps[property]; } else { translatedProps[property] = resolveValueWithBreakpoint( props[property], currentBreakpoint, property ); } } else { // STEP 1.d Resolving Direct Values translatedProps[property] = resolveValueWithBreakpoint( props[property], currentBreakpoint, property ); } } </s> remove return React.forwardRef( ({ style: propStyle, children, debug, ...props }: any, ref: any) => { const theme = useTheme(); const windowWidth = useWindowDimensions().width; </s> add if (shouldEnableNewStyledSystemImplementation) { return React.forwardRef( ({ style: propStyle, children, debug, ...props }: any, ref: any) => { const theme = useTheme(); const windowWidth = useWindowDimensions().width;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64b74727f82d86bbc915f9ebb1c5e3e01baafe86
src/utils/styled.tsx
static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
<mask> import computeProps from '../../Utils/computeProps'; <mask> <mask> <mask> export default class BadgeNB extends NativeBaseComponent { <mask> <mask> prepareRootProps() { <mask> <mask> var type = { <mask> color: this.getTheme().badgeColor, <mask> fontSize: this.getTheme().fontSizeBase, </s> allow user to change theme for any component </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/Badge.js
static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
<mask> import Icon from 'react-native-vector-icons/Ionicons'; <mask> <mask> <mask> export default class Button extends NativeBaseComponent { <mask> <mask> getInitialStyle() { <mask> return { <mask> button: { <mask> padding: 10, <mask> justifyContent: 'space-around', </s> allow user to change theme for any component </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove getInitialStyle() { </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } getInitialStyle() { </s> remove justifyContent: (!Array.isArray(this.props.children)) ? 'space-between' : 'center', </s> add justifyContent: (!Array.isArray(this.props.children)) ? 'center' : 'space-between', </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/Button.js
static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
<mask> import _ from 'lodash'; <mask> import computeProps from '../../Utils/computeProps'; <mask> <mask> export default class CardNB extends NativeBaseComponent { <mask> <mask> getInitialStyle() { <mask> return { <mask> card: { <mask> borderWidth: 1, <mask> borderRadius: 8 </s> allow user to change theme for any component </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove getInitialStyle() { </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } getInitialStyle() {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/Card.js
static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
<mask> import computeProps from '../../Utils/computeProps'; <mask> import Checkbox from 'react-native-checkbox'; <mask> <mask> export default class CheckBox extends NativeBaseComponent { <mask> <mask> getInitialStyle() { <mask> return { <mask> checkboxLabel: { <mask> color: 'teal' <mask> } </s> allow user to change theme for any component </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/CheckBox.js
static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
<mask> import Footer from './Footer'; <mask> import NativeBaseComponent from '../Base/NativeBaseComponent'; <mask> <mask> export default class Container extends NativeBaseComponent { <mask> <mask> renderHeader() { <mask> console.log(this.context.theme); <mask> return _.find(this.props.children, function(item) { </s> allow user to change theme for any component </s> remove </s> add console.log(this.context.theme); </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/Container.js
console.log(this.context.theme);
<mask> <mask> export default class Container extends NativeBaseComponent { <mask> <mask> renderHeader() { <mask> <mask> return _.find(this.props.children, function(item) { <mask> if(item && item.type == Header) { <mask> return true; <mask> } <mask> }); </s> allow user to change theme for any component </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/Container.js
static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
<mask> <mask> export default class Content extends NativeBaseComponent { <mask> prepareRootProps() { <mask> <mask> var type = { <mask> backgroundColor: 'transparent', <mask> flex: 1, </s> allow user to change theme for any component </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/Content.js
static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
<mask> <mask> export default class Footer extends NativeBaseComponent { <mask> getInitialStyle() { <mask> return { <mask> navbar: { <mask> backgroundColor: this.getTheme().toolbarDefaultBg, </s> allow user to change theme for any component </s> remove justifyContent: (!Array.isArray(this.props.children)) ? 'space-between' : 'center', </s> add justifyContent: (!Array.isArray(this.props.children)) ? 'center' : 'space-between', </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/Footer.js
static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
<mask> import computeProps from '../../Utils/computeProps'; <mask> <mask> <mask> export default class H1NB extends NativeBaseComponent { <mask> <mask> prepareRootProps() { <mask> <mask> var type = { <mask> color: this.getTheme().textColor, <mask> fontSize: this.getTheme().fontSizeH1 </s> allow user to change theme for any component </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/H1.js
static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
<mask> import computeProps from '../../Utils/computeProps'; <mask> <mask> <mask> export default class H2NB extends NativeBaseComponent { <mask> <mask> prepareRootProps() { <mask> <mask> var type = { <mask> color: this.getTheme().textColor, <mask> fontSize: this.getTheme().fontSizeH2 </s> allow user to change theme for any component </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/H2.js
static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
<mask> import computeProps from '../../Utils/computeProps'; <mask> <mask> <mask> export default class H3NB extends NativeBaseComponent { <mask> <mask> prepareRootProps() { <mask> <mask> var type = { <mask> color: this.getTheme().textColor, <mask> fontSize: this.getTheme().fontSizeH3 </s> allow user to change theme for any component </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/H3.js
static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
<mask> import computeProps from '../../Utils/computeProps'; <mask> <mask> export default class Header extends NativeBaseComponent { <mask> getInitialStyle() { <mask> return { <mask> navbar: { <mask> backgroundColor: this.getTheme().toolbarDefaultBg, </s> allow user to change theme for any component </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove justifyContent: (!Array.isArray(this.props.children)) ? 'space-between' : 'center', </s> add justifyContent: (!Array.isArray(this.props.children)) ? 'center' : 'space-between', </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/Header.js
justifyContent: (!Array.isArray(this.props.children)) ? 'center' : 'space-between',
<mask> getInitialStyle() { <mask> return { <mask> navbar: { <mask> backgroundColor: this.getTheme().toolbarDefaultBg, <mask> justifyContent: (!Array.isArray(this.props.children)) ? 'space-between' : 'center', <mask> flexDirection: 'row', <mask> alignItems: 'center', <mask> padding: 15, <mask> paddingTop: 25, <mask> shadowColor: '#000', </s> allow user to change theme for any component </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove getInitialStyle() { </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } getInitialStyle() {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/Header.js
static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
<mask> import computeProps from '../../Utils/computeProps'; <mask> import Icon from 'react-native-vector-icons/Ionicons'; <mask> <mask> export default class IconNB extends NativeBaseComponent { <mask> <mask> getInitialStyle() { <mask> return { <mask> icon: { <mask> fontSize: 27, <mask> color: 'white' </s> allow user to change theme for any component </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/Icon.js
static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
<mask> import bootstrap from '../Styles/bootstrap'; <mask> import computeProps from '../../Utils/computeProps'; <mask> <mask> export default class Input extends NativeBaseComponent { <mask> <mask> getInitialStyle() { <mask> return { <mask> input: { <mask> height: this.getTheme().inputHeightBase, <mask> color: this.getTheme().inputColorPlaceholder, </s> allow user to change theme for any component </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/Input.js
static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
<mask> import Input from './Input'; <mask> <mask> <mask> export default class InputGroup extends NativeBaseComponent { <mask> <mask> getInitialStyle() { <mask> return { <mask> textInput: { <mask> height: this.getTheme().inputHeightBase, <mask> backgroundColor: 'transparent', </s> allow user to change theme for any component </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/InputGroup.js
static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
<mask> import _ from 'lodash'; <mask> import computeProps from '../../Utils/computeProps'; <mask> <mask> export default class ListNB extends NativeBaseComponent { <mask> <mask> getInitialStyle() { <mask> return { <mask> list: { <mask> <mask> }, </s> allow user to change theme for any component </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/List.js
static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } getInitialStyle() {
<mask> import Button from './Button'; <mask> import Thumbnail from './Thumbnail'; <mask> <mask> export default class ListItemNB extends NativeBaseComponent { <mask> <mask> getInitialStyle() { <mask> return { <mask> listItem: { <mask> borderBottomWidth: this.getTheme().borderWidth, <mask> padding: this.getTheme().listItemPadding, <mask> borderRadius: 1, </s> allow user to change theme for any component </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/ListItem.js
static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
<mask> import _ from 'lodash'; <mask> import computeProps from '../../Utils/computeProps'; <mask> <mask> export default class PickerNB extends NativeBaseComponent { <mask> <mask> getInitialStyle() { <mask> return { <mask> picker: { <mask> backgroundColor: '#bbb' <mask> }, </s> allow user to change theme for any component </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/Picker.js
static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
<mask> import _ from 'lodash'; <mask> import computeProps from '../../Utils/computeProps'; <mask> <mask> export default class SwitchNB extends NativeBaseComponent { <mask> <mask> getInitialStyle() { <mask> return { <mask> switch: { <mask> <mask> } </s> allow user to change theme for any component </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/Switch.js
static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
<mask> import computeProps from '../../Utils/computeProps'; <mask> <mask> <mask> export default class TextNB extends NativeBaseComponent { <mask> <mask> prepareRootProps() { <mask> <mask> var type = { <mask> color: this.getTheme().textColor, <mask> fontSize: this.getTheme().fontSizeBase </s> allow user to change theme for any component </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/Text.js
static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
<mask> import _ from 'lodash'; <mask> import computeProps from '../../Utils/computeProps'; <mask> <mask> export default class ThumbnailNB extends NativeBaseComponent { <mask> <mask> getInitialStyle() { <mask> return { <mask> thumbnail: { <mask> borderRadius: 15, <mask> width: 30, </s> allow user to change theme for any component </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove getInitialStyle() { </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } getInitialStyle() {
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/Thumbnail.js
static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
<mask> <mask> <mask> <mask> export default class Title extends NativeBaseComponent { <mask> render() { <mask> return( <mask> <View><Text style={{color: '#fff', fontSize: this.getTheme().fontSizeH3, fontWeight: "500", alignSelf: 'center'}}>{this.props.children}</Text></View> <mask> ); <mask> } <mask> } </s> allow user to change theme for any component </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; } </s> remove </s> add static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/Title.js
static childContextTypes = { theme: React.PropTypes.object } getChildContext() { return {theme: this.props.theme ? this.props.theme : this.getTheme()}; }
<mask> <mask> export default class ViewNB extends NativeBaseComponent { <mask> render() { <mask> return( <mask> <View style={{padding: (this.props.padder) ? this.getTheme().contentPadding : 0}} {...this.props}></View> <mask> ); </s> allow user to change theme for any component
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/64cd2800039fd213bd6ce9f61c49dd12bc2746c1
Components/Widgets/View.js
modalVisible: false,
<mask> }); <mask> if (config.duration > 0) { <mask> setTimeout(() => { <mask> this.setState({ <mask> modalVisible: false <mask> }); <mask> }, config.duration); <mask> } <mask> } <mask> componentDidMount() { </s> added style props for toast and its childrens(fix for #840) </s> remove <Text>{this.state.text}</Text> {(this.state.buttonText) && <Button onPress={() => { this.setState({ modalVisible: false }); }}> <Text>{this.state.buttonText}</Text> </s> add <Text style={this.state.textStyle}>{this.state.text}</Text> {(this.state.buttonText) && <Button style={this.state.buttonStyle} onPress={() => { this.setState({ modalVisible: false, }); }}> <Text style={this.state.buttonTextStyle}>{this.state.buttonText}</Text> </s> remove borderRadius: (platform==='ios') ? 5 : 0, </s> add borderRadius: (platform === 'ios') ? 5 : 0,
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/65078ac649c6c7e1f8d0b4b2f98c4c86e75edc3a
src/basic/ToastContainer.js
style={this.state.style}
<mask> justifyContent: (this.state.position === 'top') ? 'flex-start' : (this.state.position === 'bottom') ? 'flex-end' : (this.state.position === 'center') ? 'center' : 'flex-start' <mask> }}> <mask> <Toast <mask> danger={(this.state.type == 'danger') ? true : false} <mask> success={(this.state.type == 'success') ? true : false} <mask> warning={(this.state.type == 'warning') ? true : false}> <mask> <Text style={this.state.textStyle}>{this.state.text}</Text> </s> added style props for toast and its childrens(fix for #840) </s> remove borderRadius: (platform==='ios') ? 5 : 0, </s> add borderRadius: (platform === 'ios') ? 5 : 0, </s> remove <Text>{this.state.text}</Text> {(this.state.buttonText) && <Button onPress={() => { this.setState({ modalVisible: false }); }}> <Text>{this.state.buttonText}</Text> </s> add <Text style={this.state.textStyle}>{this.state.text}</Text> {(this.state.buttonText) && <Button style={this.state.buttonStyle} onPress={() => { this.setState({ modalVisible: false, }); }}> <Text style={this.state.buttonTextStyle}>{this.state.buttonText}</Text> </s> remove modalVisible: false </s> add modalVisible: false,
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/65078ac649c6c7e1f8d0b4b2f98c4c86e75edc3a
src/basic/ToastContainer.js
<Text style={this.state.textStyle}>{this.state.text}</Text> {(this.state.buttonText) && <Button style={this.state.buttonStyle} onPress={() => { this.setState({ modalVisible: false, }); }}> <Text style={this.state.buttonTextStyle}>{this.state.buttonText}</Text>
<mask> <Toast <mask> danger={(this.state.type == 'danger') ? true : false} <mask> success={(this.state.type == 'success') ? true : false} <mask> warning={(this.state.type == 'warning') ? true : false}> <mask> <Text>{this.state.text}</Text> <mask> {(this.state.buttonText) && <Button onPress={() => { <mask> this.setState({ <mask> modalVisible: false <mask> }); <mask> }}> <mask> <Text>{this.state.buttonText}</Text> <mask> </Button>} <mask> <mask> </Toast> <mask> </View> <mask> </Modal> </s> added style props for toast and its childrens(fix for #840) </s> remove borderRadius: (platform==='ios') ? 5 : 0, </s> add borderRadius: (platform === 'ios') ? 5 : 0, </s> remove modalVisible: false </s> add modalVisible: false,
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/65078ac649c6c7e1f8d0b4b2f98c4c86e75edc3a
src/basic/ToastContainer.js
borderRadius: (platform === 'ios') ? 5 : 0,
<mask> '.success': { <mask> backgroundColor: variables.brandSuccess <mask> }, <mask> backgroundColor: 'rgba(0,0,0,0.8)', <mask> borderRadius: (platform==='ios') ? 5 : 0, <mask> flexDirection: 'row', <mask> justifyContent: 'space-between', <mask> alignItems: 'center', <mask> padding: 10, <mask> minHeight: 50, </s> added style props for toast and its childrens(fix for #840) </s> remove <Text>{this.state.text}</Text> {(this.state.buttonText) && <Button onPress={() => { this.setState({ modalVisible: false }); }}> <Text>{this.state.buttonText}</Text> </s> add <Text style={this.state.textStyle}>{this.state.text}</Text> {(this.state.buttonText) && <Button style={this.state.buttonStyle} onPress={() => { this.setState({ modalVisible: false, }); }}> <Text style={this.state.buttonTextStyle}>{this.state.buttonText}</Text> </s> remove modalVisible: false </s> add modalVisible: false,
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/65078ac649c6c7e1f8d0b4b2f98c4c86e75edc3a
src/theme/components/Toast.js
<Box h={100} w={100} mt={4} bg={state ? 'orange.300' : 'blue.300'} />
<mask> <> <mask> <Link onPress={toggleState} mt={4}> <mask> Click here to toggle the color of box. <mask> </Link> <mask> <Box h="100" w="100" mt={4} bg={state ? 'orange.300' : 'blue.300'} /> <mask> </> <mask> ); <mask> }; </s> Styled system removal bug fixes (#3878) * feat: alpha opacity in colors and remove styled system * spinner size fixes * fix: spinner size and scrollview error * fix: conflicts </s> remove {...resolvedProps} // TODO: Fix color resolution issue in styled component. </s> add {...restProps} </s> remove const getColor = (rawValue: any, scale: any, theme: any) => { </s> add export const getColor = (rawValue: any, scale: any, theme: any) => { </s> remove ); </s> add return ( <Comp {...restProps} style={style} ref={ref}> {props.children} </Comp> ); }); </s> remove <StyledSpinner </s> add <ActivityIndicator
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/67ac3166a353d1610697be4ac5502969ce183b74
example/storybook/stories/components/primitives/Link/CustomOnPress.tsx
_contentContainerStyle || {}
<mask> contentContainerStyle, <mask> ...resolvedProps <mask> } = usePropsResolution('ScrollView', props); <mask> const resolved_ContentContainerStyle = useStyledSystemPropsResolver( <mask> _contentContainerStyle <mask> ); <mask> <mask> return ( <mask> <StyledScrollView <mask> {...resolvedProps} </s> Styled system removal bug fixes (#3878) * feat: alpha opacity in colors and remove styled system * spinner size fixes * fix: spinner size and scrollview error * fix: conflicts </s> remove <StyledSpinner </s> add <ActivityIndicator </s> remove import { makeStyledComponent } from '../../../utils/styled'; const StyledSpinner = makeStyledComponent(ActivityIndicator); const Spinner = (props: ISpinnerProps, ref: any) => { const { color, ...resolvedProps } = usePropsResolution('Spinner', props); const resolvedColor = useToken('colors', color); </s> add import { useStyledSystemPropsResolver, useTheme } from '../../../hooks'; </s> remove return React.forwardRef( ({ style: propStyle, children, debug, ...props }: any, ref: any) => { const theme = useTheme(); const currentBreakpoint = useNativeBaseConfig('makeStyledComponent') .currentBreakpoint; const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); return ( <Comp {...restProps} style={style} ref={ref}> {children} </Comp> ); </s> add return React.forwardRef(({ debug, ...props }: any, ref: any) => { const [style, restProps] = useStyledSystemPropsResolver(props); if (debug) { console.log('style:: => ', style, ' restProps:: => ', restProps); </s> remove for (const property in styleObject) { if ( typeof styleObject[property] === 'string' && styleObject[property].includes('px') ) { styleObject[property] = parseInt(styleObject[property]); </s> add const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps };
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/67ac3166a353d1610697be4ac5502969ce183b74
src/components/basic/ScrollView/ScrollView.tsx
import { getColor } from '../../../theme';
<mask> import React, { memo, forwardRef } from 'react'; <mask> import { ActivityIndicator } from 'react-native'; <mask> import { usePropsResolution } from '../../../hooks/useThemeProps'; <mask> import { useToken } from '../../../hooks'; <mask> import type { ISpinnerProps } from './types'; <mask> import { makeStyledComponent } from '../../../utils/styled'; <mask> <mask> const StyledSpinner = makeStyledComponent(ActivityIndicator); <mask> const Spinner = (props: ISpinnerProps, ref: any) => { </s> Styled system removal bug fixes (#3878) * feat: alpha opacity in colors and remove styled system * spinner size fixes * fix: spinner size and scrollview error * fix: conflicts </s> remove import { makeStyledComponent } from '../../../utils/styled'; const StyledSpinner = makeStyledComponent(ActivityIndicator); const Spinner = (props: ISpinnerProps, ref: any) => { const { color, ...resolvedProps } = usePropsResolution('Spinner', props); const resolvedColor = useToken('colors', color); </s> add import { useStyledSystemPropsResolver, useTheme } from '../../../hooks'; </s> remove import { resolversForBox } from '../utils/styled'; </s> add import React from 'react'; import { useNativeBaseConfig } from '../core/NativeBaseContext'; </s> remove import { useNativeBaseConfig } from '../core/NativeBaseContext'; </s> add import { useStyledSystemPropsResolver } from '../hooks/';
[ "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/67ac3166a353d1610697be4ac5502969ce183b74
src/components/primitives/Spinner/index.tsx
import { useStyledSystemPropsResolver, useTheme } from '../../../hooks';
<mask> import { ActivityIndicator } from 'react-native'; <mask> import { usePropsResolution } from '../../../hooks/useThemeProps'; <mask> import { useToken } from '../../../hooks'; <mask> import type { ISpinnerProps } from './types'; <mask> import { makeStyledComponent } from '../../../utils/styled'; <mask> <mask> const StyledSpinner = makeStyledComponent(ActivityIndicator); <mask> const Spinner = (props: ISpinnerProps, ref: any) => { <mask> const { color, ...resolvedProps } = usePropsResolution('Spinner', props); <mask> const resolvedColor = useToken('colors', color); <mask> <mask> return ( <mask> <StyledSpinner <mask> accessible <mask> accessibilityLabel="loading" </s> Styled system removal bug fixes (#3878) * feat: alpha opacity in colors and remove styled system * spinner size fixes * fix: spinner size and scrollview error * fix: conflicts </s> remove import { useToken } from '../../../hooks'; </s> add import { getColor } from '../../../theme'; </s> remove <StyledSpinner </s> add <ActivityIndicator </s> remove import { resolversForBox } from '../utils/styled'; </s> add import React from 'react'; import { useNativeBaseConfig } from '../core/NativeBaseContext'; </s> remove export const useStyledSystemPropsResolver = (props: any) => { </s> add export const useStyledSystemPropsResolver = ({ style: propStyle, debug, ...props }: any) => {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/67ac3166a353d1610697be4ac5502969ce183b74
src/components/primitives/Spinner/index.tsx
const Spinner = ({ ...props }: ISpinnerProps, ref: any) => { const { color, size, ...resolvedProps } = usePropsResolution( 'Spinner', props ); const resolvedColor = getColor(color, useTheme().colors, useTheme()); const [style, restProps] = useStyledSystemPropsResolver(resolvedProps);
<mask> import { getColor } from '../../../theme'; <mask> import type { ISpinnerProps } from './types'; <mask> import { useStyledSystemPropsResolver, useTheme } from '../../../hooks'; <mask> <mask> return ( <mask> <ActivityIndicator <mask> accessible <mask> accessibilityLabel="loading" <mask> {...restProps} </s> Styled system removal bug fixes (#3878) * feat: alpha opacity in colors and remove styled system * spinner size fixes * fix: spinner size and scrollview error * fix: conflicts </s> remove import { makeStyledComponent } from '../../../utils/styled'; const StyledSpinner = makeStyledComponent(ActivityIndicator); const Spinner = (props: ISpinnerProps, ref: any) => { const { color, ...resolvedProps } = usePropsResolution('Spinner', props); const resolvedColor = useToken('colors', color); </s> add import { useStyledSystemPropsResolver, useTheme } from '../../../hooks'; </s> remove import { useToken } from '../../../hooks'; </s> add import { getColor } from '../../../theme'; </s> remove import { getStyleAndFilteredProps } from '../theme/styled-system'; import styled, { useTheme } from 'styled-components/native'; </s> add import styled from 'styled-components/native'; </s> remove import { resolversForBox } from '../utils/styled'; </s> add import React from 'react'; import { useNativeBaseConfig } from '../core/NativeBaseContext';
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/67ac3166a353d1610697be4ac5502969ce183b74
src/components/primitives/Spinner/index.tsx
<ActivityIndicator
<mask> const { color, ...resolvedProps } = usePropsResolution('Spinner', props); <mask> const resolvedColor = useToken('colors', color); <mask> <mask> return ( <mask> <StyledSpinner <mask> accessible <mask> accessibilityLabel="loading" <mask> {...resolvedProps} <mask> // TODO: Fix color resolution issue in styled component. <mask> color={resolvedColor} </s> Styled system removal bug fixes (#3878) * feat: alpha opacity in colors and remove styled system * spinner size fixes * fix: spinner size and scrollview error * fix: conflicts </s> remove {...resolvedProps} // TODO: Fix color resolution issue in styled component. </s> add {...restProps} </s> remove import { makeStyledComponent } from '../../../utils/styled'; const StyledSpinner = makeStyledComponent(ActivityIndicator); const Spinner = (props: ISpinnerProps, ref: any) => { const { color, ...resolvedProps } = usePropsResolution('Spinner', props); const resolvedColor = useToken('colors', color); </s> add import { useStyledSystemPropsResolver, useTheme } from '../../../hooks'; </s> remove _contentContainerStyle </s> add _contentContainerStyle || {} </s> remove sizeResolved = true; </s> add // Type - sizes: { size: 4 }. Refer Images if (!componentSizeProps.size) { sizeResolved = true; }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/67ac3166a353d1610697be4ac5502969ce183b74
src/components/primitives/Spinner/index.tsx
{...restProps}
<mask> return ( <mask> <StyledSpinner <mask> accessible <mask> accessibilityLabel="loading" <mask> {...resolvedProps} <mask> // TODO: Fix color resolution issue in styled component. <mask> color={resolvedColor} <mask> ref={ref} <mask> /> <mask> ); <mask> }; </s> Styled system removal bug fixes (#3878) * feat: alpha opacity in colors and remove styled system * spinner size fixes * fix: spinner size and scrollview error * fix: conflicts </s> remove <StyledSpinner </s> add <ActivityIndicator </s> remove <Box h="100" w="100" mt={4} bg={state ? 'orange.300' : 'blue.300'} /> </s> add <Box h={100} w={100} mt={4} bg={state ? 'orange.300' : 'blue.300'} /> </s> remove sizeResolved = true; </s> add // Type - sizes: { size: 4 }. Refer Images if (!componentSizeProps.size) { sizeResolved = true; } </s> remove import { makeStyledComponent } from '../../../utils/styled'; const StyledSpinner = makeStyledComponent(ActivityIndicator); const Spinner = (props: ISpinnerProps, ref: any) => { const { color, ...resolvedProps } = usePropsResolution('Spinner', props); const resolvedColor = useToken('colors', color); </s> add import { useStyledSystemPropsResolver, useTheme } from '../../../hooks';
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/67ac3166a353d1610697be4ac5502969ce183b74
src/components/primitives/Spinner/index.tsx
size={size} style={style}
<mask> {...restProps} <mask> color={resolvedColor} <mask> ref={ref} <mask> /> <mask> ); <mask> }; <mask> <mask> export default memo(forwardRef(Spinner)); <mask> export type { ISpinnerProps }; </s> Styled system removal bug fixes (#3878) * feat: alpha opacity in colors and remove styled system * spinner size fixes * fix: spinner size and scrollview error * fix: conflicts </s> remove {...resolvedProps} // TODO: Fix color resolution issue in styled component. </s> add {...restProps} </s> remove ); </s> add return ( <Comp {...restProps} style={style} ref={ref}> {props.children} </Comp> ); }); </s> remove <Box h="100" w="100" mt={4} bg={state ? 'orange.300' : 'blue.300'} /> </s> add <Box h={100} w={100} mt={4} bg={state ? 'orange.300' : 'blue.300'} />
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/67ac3166a353d1610697be4ac5502969ce183b74
src/components/primitives/Spinner/index.tsx
import React from 'react'; import { useNativeBaseConfig } from '../core/NativeBaseContext';
<mask> import { useTheme } from './useTheme'; <mask> import { resolversForBox } from '../utils/styled'; <mask> <mask> export const useStyledSystemPropsResolver = (props: any) => { <mask> const theme = useTheme(); <mask> const propsWithTheme = { ...props, theme }; <mask> let styleObject: any = {}; </s> Styled system removal bug fixes (#3878) * feat: alpha opacity in colors and remove styled system * spinner size fixes * fix: spinner size and scrollview error * fix: conflicts </s> remove export const useStyledSystemPropsResolver = (props: any) => { </s> add export const useStyledSystemPropsResolver = ({ style: propStyle, debug, ...props }: any) => { </s> remove const propsWithTheme = { ...props, theme }; let styleObject: any = {}; resolversForBox.forEach((resolver: any) => { styleObject = { ...styleObject, ...resolver(propsWithTheme) }; }); </s> add const currentBreakpoint = useNativeBaseConfig('makeStyledComponent') .currentBreakpoint; </s> remove import { makeStyledComponent } from '../../../utils/styled'; const StyledSpinner = makeStyledComponent(ActivityIndicator); const Spinner = (props: ISpinnerProps, ref: any) => { const { color, ...resolvedProps } = usePropsResolution('Spinner', props); const resolvedColor = useToken('colors', color); </s> add import { useStyledSystemPropsResolver, useTheme } from '../../../hooks'; </s> remove return React.forwardRef( ({ style: propStyle, children, debug, ...props }: any, ref: any) => { const theme = useTheme(); const currentBreakpoint = useNativeBaseConfig('makeStyledComponent') .currentBreakpoint; const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); return ( <Comp {...restProps} style={style} ref={ref}> {children} </Comp> ); </s> add return React.forwardRef(({ debug, ...props }: any, ref: any) => { const [style, restProps] = useStyledSystemPropsResolver(props); if (debug) { console.log('style:: => ', style, ' restProps:: => ', restProps); </s> remove import { useNativeBaseConfig } from '../core/NativeBaseContext'; </s> add import { useStyledSystemPropsResolver } from '../hooks/';
[ "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/67ac3166a353d1610697be4ac5502969ce183b74
src/hooks/useStyledSystemPropsResolver.ts
export const useStyledSystemPropsResolver = ({ style: propStyle, debug, ...props }: any) => {
<mask> import { useTheme } from './useTheme'; <mask> import { resolversForBox } from '../utils/styled'; <mask> <mask> export const useStyledSystemPropsResolver = (props: any) => { <mask> const theme = useTheme(); <mask> const propsWithTheme = { ...props, theme }; <mask> let styleObject: any = {}; <mask> resolversForBox.forEach((resolver: any) => { <mask> styleObject = { ...styleObject, ...resolver(propsWithTheme) }; </s> Styled system removal bug fixes (#3878) * feat: alpha opacity in colors and remove styled system * spinner size fixes * fix: spinner size and scrollview error * fix: conflicts </s> remove import { resolversForBox } from '../utils/styled'; </s> add import React from 'react'; import { useNativeBaseConfig } from '../core/NativeBaseContext'; </s> remove const propsWithTheme = { ...props, theme }; let styleObject: any = {}; resolversForBox.forEach((resolver: any) => { styleObject = { ...styleObject, ...resolver(propsWithTheme) }; }); </s> add const currentBreakpoint = useNativeBaseConfig('makeStyledComponent') .currentBreakpoint; </s> remove for (const property in styleObject) { if ( typeof styleObject[property] === 'string' && styleObject[property].includes('px') ) { styleObject[property] = parseInt(styleObject[property]); </s> add const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; </s> remove import { makeStyledComponent } from '../../../utils/styled'; const StyledSpinner = makeStyledComponent(ActivityIndicator); const Spinner = (props: ISpinnerProps, ref: any) => { const { color, ...resolvedProps } = usePropsResolution('Spinner', props); const resolvedColor = useToken('colors', color); </s> add import { useStyledSystemPropsResolver, useTheme } from '../../../hooks'; </s> remove return React.forwardRef( ({ style: propStyle, children, debug, ...props }: any, ref: any) => { const theme = useTheme(); const currentBreakpoint = useNativeBaseConfig('makeStyledComponent') .currentBreakpoint; const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); return ( <Comp {...restProps} style={style} ref={ref}> {children} </Comp> ); </s> add return React.forwardRef(({ debug, ...props }: any, ref: any) => { const [style, restProps] = useStyledSystemPropsResolver(props); if (debug) { console.log('style:: => ', style, ' restProps:: => ', restProps);
[ "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/67ac3166a353d1610697be4ac5502969ce183b74
src/hooks/useStyledSystemPropsResolver.ts
const currentBreakpoint = useNativeBaseConfig('makeStyledComponent') .currentBreakpoint;
<mask> import { resolversForBox } from '../utils/styled'; <mask> <mask> export const useStyledSystemPropsResolver = (props: any) => { <mask> const theme = useTheme(); <mask> const propsWithTheme = { ...props, theme }; <mask> let styleObject: any = {}; <mask> resolversForBox.forEach((resolver: any) => { <mask> styleObject = { ...styleObject, ...resolver(propsWithTheme) }; <mask> }); <mask> <mask> for (const property in styleObject) { <mask> if ( <mask> typeof styleObject[property] === 'string' && <mask> styleObject[property].includes('px') </s> Styled system removal bug fixes (#3878) * feat: alpha opacity in colors and remove styled system * spinner size fixes * fix: spinner size and scrollview error * fix: conflicts </s> remove export const useStyledSystemPropsResolver = (props: any) => { </s> add export const useStyledSystemPropsResolver = ({ style: propStyle, debug, ...props }: any) => { </s> remove for (const property in styleObject) { if ( typeof styleObject[property] === 'string' && styleObject[property].includes('px') ) { styleObject[property] = parseInt(styleObject[property]); </s> add const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; </s> remove import { resolversForBox } from '../utils/styled'; </s> add import React from 'react'; import { useNativeBaseConfig } from '../core/NativeBaseContext'; </s> remove const getColor = (rawValue: any, scale: any, theme: any) => { </s> add export const getColor = (rawValue: any, scale: any, theme: any) => { </s> remove let componentSizeProps = {}; </s> add let componentSizeProps: any = {};
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/67ac3166a353d1610697be4ac5502969ce183b74
src/hooks/useStyledSystemPropsResolver.ts
const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps };
<mask> resolversForBox.forEach((resolver: any) => { <mask> styleObject = { ...styleObject, ...resolver(propsWithTheme) }; <mask> }); <mask> <mask> for (const property in styleObject) { <mask> if ( <mask> typeof styleObject[property] === 'string' && <mask> styleObject[property].includes('px') <mask> ) { <mask> styleObject[property] = parseInt(styleObject[property]); <mask> } <mask> } <mask> <mask> return styleObject; <mask> }; </s> Styled system removal bug fixes (#3878) * feat: alpha opacity in colors and remove styled system * spinner size fixes * fix: spinner size and scrollview error * fix: conflicts </s> remove const propsWithTheme = { ...props, theme }; let styleObject: any = {}; resolversForBox.forEach((resolver: any) => { styleObject = { ...styleObject, ...resolver(propsWithTheme) }; }); </s> add const currentBreakpoint = useNativeBaseConfig('makeStyledComponent') .currentBreakpoint; </s> remove return styleObject; </s> add return [style, restProps]; </s> remove export const useStyledSystemPropsResolver = (props: any) => { </s> add export const useStyledSystemPropsResolver = ({ style: propStyle, debug, ...props }: any) => { </s> remove const getColor = (rawValue: any, scale: any, theme: any) => { </s> add export const getColor = (rawValue: any, scale: any, theme: any) => { </s> remove let componentSizeProps = {}; </s> add let componentSizeProps: any = {};
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/67ac3166a353d1610697be4ac5502969ce183b74
src/hooks/useStyledSystemPropsResolver.ts
}, [props, theme, propStyle, currentBreakpoint, debug]); if (debug) { console.log('style,resprops', currentBreakpoint);
<mask> return { style: styleSheet.box, restProps }; <mask> } <mask> } <mask> <mask> return [style, restProps]; <mask> }; </s> Styled system removal bug fixes (#3878) * feat: alpha opacity in colors and remove styled system * spinner size fixes * fix: spinner size and scrollview error * fix: conflicts </s> remove for (const property in styleObject) { if ( typeof styleObject[property] === 'string' && styleObject[property].includes('px') ) { styleObject[property] = parseInt(styleObject[property]); </s> add const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; </s> remove return React.forwardRef( ({ style: propStyle, children, debug, ...props }: any, ref: any) => { const theme = useTheme(); const currentBreakpoint = useNativeBaseConfig('makeStyledComponent') .currentBreakpoint; const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); return ( <Comp {...restProps} style={style} ref={ref}> {children} </Comp> ); </s> add return React.forwardRef(({ debug, ...props }: any, ref: any) => { const [style, restProps] = useStyledSystemPropsResolver(props); if (debug) { console.log('style:: => ', style, ' restProps:: => ', restProps); </s> remove return styleObject; </s> add return [style, restProps]; </s> remove export const useStyledSystemPropsResolver = (props: any) => { </s> add export const useStyledSystemPropsResolver = ({ style: propStyle, debug, ...props }: any) => { </s> remove ); </s> add return ( <Comp {...restProps} style={style} ref={ref}> {props.children} </Comp> ); });
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/67ac3166a353d1610697be4ac5502969ce183b74
src/hooks/useStyledSystemPropsResolver.ts
return [style, restProps];
<mask> styleObject[property] = parseInt(styleObject[property]); <mask> } <mask> } <mask> <mask> return styleObject; <mask> }; </s> Styled system removal bug fixes (#3878) * feat: alpha opacity in colors and remove styled system * spinner size fixes * fix: spinner size and scrollview error * fix: conflicts </s> remove for (const property in styleObject) { if ( typeof styleObject[property] === 'string' && styleObject[property].includes('px') ) { styleObject[property] = parseInt(styleObject[property]); </s> add const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; </s> remove const propsWithTheme = { ...props, theme }; let styleObject: any = {}; resolversForBox.forEach((resolver: any) => { styleObject = { ...styleObject, ...resolver(propsWithTheme) }; }); </s> add const currentBreakpoint = useNativeBaseConfig('makeStyledComponent') .currentBreakpoint; </s> remove return React.forwardRef( ({ style: propStyle, children, debug, ...props }: any, ref: any) => { const theme = useTheme(); const currentBreakpoint = useNativeBaseConfig('makeStyledComponent') .currentBreakpoint; const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); return ( <Comp {...restProps} style={style} ref={ref}> {children} </Comp> ); </s> add return React.forwardRef(({ debug, ...props }: any, ref: any) => { const [style, restProps] = useStyledSystemPropsResolver(props); if (debug) { console.log('style:: => ', style, ' restProps:: => ', restProps); </s> remove import { resolversForBox } from '../utils/styled'; </s> add import React from 'react'; import { useNativeBaseConfig } from '../core/NativeBaseContext';
[ "keep", "keep", "keep", "keep", "replace", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/67ac3166a353d1610697be4ac5502969ce183b74
src/hooks/useStyledSystemPropsResolver.ts
import Image from '../../components/primitives/Image'; import Spinner from '../../components/primitives/Spinner';
<mask> import { NativeBaseProvider } from '../../core/NativeBaseProvider'; <mask> import Box from '../../components/primitives/Box'; <mask> import { Platform } from 'react-native'; <mask> import { extendTheme } from '../../core/extendTheme'; <mask> <mask> const inset = { <mask> frame: { x: 0, y: 0, width: 0, height: 0 }, <mask> insets: { top: 0, left: 0, right: 0, bottom: 0 }, </s> Styled system removal bug fixes (#3878) * feat: alpha opacity in colors and remove styled system * spinner size fixes * fix: spinner size and scrollview error * fix: conflicts </s> remove import { useToken } from '../../../hooks'; </s> add import { getColor } from '../../../theme'; </s> remove import { makeStyledComponent } from '../../../utils/styled'; const StyledSpinner = makeStyledComponent(ActivityIndicator); const Spinner = (props: ISpinnerProps, ref: any) => { const { color, ...resolvedProps } = usePropsResolution('Spinner', props); const resolvedColor = useToken('colors', color); </s> add import { useStyledSystemPropsResolver, useTheme } from '../../../hooks'; </s> remove import { resolversForBox } from '../utils/styled'; </s> add import React from 'react'; import { useNativeBaseConfig } from '../core/NativeBaseContext'; </s> remove import { useNativeBaseConfig } from '../core/NativeBaseContext'; </s> add import { useStyledSystemPropsResolver } from '../hooks/';
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/67ac3166a353d1610697be4ac5502969ce183b74
src/hooks/useThemeProps/usePropsResolution.test.tsx
let componentSizeProps: any = {};
<mask> currentBreakpoint, <mask> 'size' <mask> ); <mask> <mask> let componentSizeProps = {}; <mask> // Extracting props from size <mask> if (size && componentTheme.sizes && componentTheme.sizes[size]) { <mask> // Type - sizes: {lg: 1}. Refer icon theme <mask> if ( <mask> typeof componentTheme.sizes[size] === 'string' || </s> Styled system removal bug fixes (#3878) * feat: alpha opacity in colors and remove styled system * spinner size fixes * fix: spinner size and scrollview error * fix: conflicts </s> remove sizeResolved = true; </s> add // Type - sizes: { size: 4 }. Refer Images if (!componentSizeProps.size) { sizeResolved = true; } </s> remove const propsWithTheme = { ...props, theme }; let styleObject: any = {}; resolversForBox.forEach((resolver: any) => { styleObject = { ...styleObject, ...resolver(propsWithTheme) }; }); </s> add const currentBreakpoint = useNativeBaseConfig('makeStyledComponent') .currentBreakpoint; </s> remove for (const property in styleObject) { if ( typeof styleObject[property] === 'string' && styleObject[property].includes('px') ) { styleObject[property] = parseInt(styleObject[property]); </s> add const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; </s> remove const getColor = (rawValue: any, scale: any, theme: any) => { </s> add export const getColor = (rawValue: any, scale: any, theme: any) => { </s> remove import { resolversForBox } from '../utils/styled'; </s> add import React from 'react'; import { useNativeBaseConfig } from '../core/NativeBaseContext';
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/67ac3166a353d1610697be4ac5502969ce183b74
src/hooks/useThemeProps/usePropsResolution.tsx
// Type - sizes: { size: 4 }. Refer Images if (!componentSizeProps.size) { sizeResolved = true; }
<mask> } <mask> // Type - sizes: {lg: {px: 1}}. Refer button theme <mask> else { <mask> componentSizeProps = componentTheme.sizes[size]; <mask> sizeResolved = true; <mask> } <mask> // @ts-ignore - Mutating incoming size for now. Fix it after new styled system is implemented <mask> incomingProps.size = undefined; <mask> } <mask> </s> Styled system removal bug fixes (#3878) * feat: alpha opacity in colors and remove styled system * spinner size fixes * fix: spinner size and scrollview error * fix: conflicts </s> remove let componentSizeProps = {}; </s> add let componentSizeProps: any = {}; </s> remove <StyledSpinner </s> add <ActivityIndicator </s> remove return React.forwardRef( ({ style: propStyle, children, debug, ...props }: any, ref: any) => { const theme = useTheme(); const currentBreakpoint = useNativeBaseConfig('makeStyledComponent') .currentBreakpoint; const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); return ( <Comp {...restProps} style={style} ref={ref}> {children} </Comp> ); </s> add return React.forwardRef(({ debug, ...props }: any, ref: any) => { const [style, restProps] = useStyledSystemPropsResolver(props); if (debug) { console.log('style:: => ', style, ' restProps:: => ', restProps); </s> remove for (const property in styleObject) { if ( typeof styleObject[property] === 'string' && styleObject[property].includes('px') ) { styleObject[property] = parseInt(styleObject[property]); </s> add const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; </s> remove const propsWithTheme = { ...props, theme }; let styleObject: any = {}; resolversForBox.forEach((resolver: any) => { styleObject = { ...styleObject, ...resolver(propsWithTheme) }; }); </s> add const currentBreakpoint = useNativeBaseConfig('makeStyledComponent') .currentBreakpoint;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/67ac3166a353d1610697be4ac5502969ce183b74
src/hooks/useThemeProps/usePropsResolution.tsx
export { getColor } from './styled-system';
<mask> }; <mask> <mask> export type ITheme = typeof theme; <mask> export { theme, tools as themeTools }; </s> Styled system removal bug fixes (#3878) * feat: alpha opacity in colors and remove styled system * spinner size fixes * fix: spinner size and scrollview error * fix: conflicts </s> remove for (const property in styleObject) { if ( typeof styleObject[property] === 'string' && styleObject[property].includes('px') ) { styleObject[property] = parseInt(styleObject[property]); </s> add const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; </s> remove const propsWithTheme = { ...props, theme }; let styleObject: any = {}; resolversForBox.forEach((resolver: any) => { styleObject = { ...styleObject, ...resolver(propsWithTheme) }; }); </s> add const currentBreakpoint = useNativeBaseConfig('makeStyledComponent') .currentBreakpoint; </s> remove return React.forwardRef( ({ style: propStyle, children, debug, ...props }: any, ref: any) => { const theme = useTheme(); const currentBreakpoint = useNativeBaseConfig('makeStyledComponent') .currentBreakpoint; const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); return ( <Comp {...restProps} style={style} ref={ref}> {children} </Comp> ); </s> add return React.forwardRef(({ debug, ...props }: any, ref: any) => { const [style, restProps] = useStyledSystemPropsResolver(props); if (debug) { console.log('style:: => ', style, ' restProps:: => ', restProps); </s> remove export const useStyledSystemPropsResolver = (props: any) => { </s> add export const useStyledSystemPropsResolver = ({ style: propStyle, debug, ...props }: any) => {
[ "keep", "keep", "keep", "add" ]
https://github.com/GeekyAnts/NativeBase/commit/67ac3166a353d1610697be4ac5502969ce183b74
src/theme/index.ts
export const getColor = (rawValue: any, scale: any, theme: any) => {
<mask> import { transparentize } from './tools'; <mask> <mask> const isNumber = (n: any) => typeof n === 'number' && !isNaN(n); <mask> <mask> const getColor = (rawValue: any, scale: any, theme: any) => { <mask> let alphaMatched = rawValue?.match(/:alpha\.\d\d?\d?/); <mask> <mask> if (alphaMatched) { <mask> let colorMatched = rawValue?.match(/^.*?(?=:alpha)/); <mask> let color = colorMatched ? colorMatched[0] : colorMatched; </s> Styled system removal bug fixes (#3878) * feat: alpha opacity in colors and remove styled system * spinner size fixes * fix: spinner size and scrollview error * fix: conflicts </s> remove const propsWithTheme = { ...props, theme }; let styleObject: any = {}; resolversForBox.forEach((resolver: any) => { styleObject = { ...styleObject, ...resolver(propsWithTheme) }; }); </s> add const currentBreakpoint = useNativeBaseConfig('makeStyledComponent') .currentBreakpoint; </s> remove return React.forwardRef( ({ style: propStyle, children, debug, ...props }: any, ref: any) => { const theme = useTheme(); const currentBreakpoint = useNativeBaseConfig('makeStyledComponent') .currentBreakpoint; const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; } }, [props, theme, propStyle, currentBreakpoint, debug]); return ( <Comp {...restProps} style={style} ref={ref}> {children} </Comp> ); </s> add return React.forwardRef(({ debug, ...props }: any, ref: any) => { const [style, restProps] = useStyledSystemPropsResolver(props); if (debug) { console.log('style:: => ', style, ' restProps:: => ', restProps); </s> remove export const useStyledSystemPropsResolver = (props: any) => { </s> add export const useStyledSystemPropsResolver = ({ style: propStyle, debug, ...props }: any) => { </s> remove let componentSizeProps = {}; </s> add let componentSizeProps: any = {}; </s> remove import { resolversForBox } from '../utils/styled'; </s> add import React from 'react'; import { useNativeBaseConfig } from '../core/NativeBaseContext';
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/67ac3166a353d1610697be4ac5502969ce183b74
src/theme/styled-system.ts
import styled from 'styled-components/native';
<mask> import { getStyleAndFilteredProps } from '../theme/styled-system'; <mask> import styled, { useTheme } from 'styled-components/native'; <mask> import { <mask> border, <mask> color, <mask> flexbox, <mask> layout, </s> Styled system removal bug fixes (#3878) * feat: alpha opacity in colors and remove styled system * spinner size fixes * fix: spinner size and scrollview error * fix: conflicts </s> remove import { useNativeBaseConfig } from '../core/NativeBaseContext'; </s> add import { useStyledSystemPropsResolver } from '../hooks/'; </s> remove import { makeStyledComponent } from '../../../utils/styled'; const StyledSpinner = makeStyledComponent(ActivityIndicator); const Spinner = (props: ISpinnerProps, ref: any) => { const { color, ...resolvedProps } = usePropsResolution('Spinner', props); const resolvedColor = useToken('colors', color); </s> add import { useStyledSystemPropsResolver, useTheme } from '../../../hooks'; </s> remove import { resolversForBox } from '../utils/styled'; </s> add import React from 'react'; import { useNativeBaseConfig } from '../core/NativeBaseContext'; </s> remove import { useToken } from '../../../hooks'; </s> add import { getColor } from '../../../theme';
[ "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/67ac3166a353d1610697be4ac5502969ce183b74
src/utils/styled.tsx
import { useStyledSystemPropsResolver } from '../hooks/';
<mask> customShadow, <mask> customTypography, <mask> } from './customProps'; <mask> import React from 'react'; <mask> import { useNativeBaseConfig } from '../core/NativeBaseContext'; <mask> <mask> export const resolversForBox: any = [ <mask> color, <mask> space, <mask> layout, <mask> flexbox, </s> Styled system removal bug fixes (#3878) * feat: alpha opacity in colors and remove styled system * spinner size fixes * fix: spinner size and scrollview error * fix: conflicts </s> remove import { resolversForBox } from '../utils/styled'; </s> add import React from 'react'; import { useNativeBaseConfig } from '../core/NativeBaseContext'; </s> remove import { getStyleAndFilteredProps } from '../theme/styled-system'; import styled, { useTheme } from 'styled-components/native'; </s> add import styled from 'styled-components/native'; </s> remove import { useToken } from '../../../hooks'; </s> add import { getColor } from '../../../theme'; </s> remove import { makeStyledComponent } from '../../../utils/styled'; const StyledSpinner = makeStyledComponent(ActivityIndicator); const Spinner = (props: ISpinnerProps, ref: any) => { const { color, ...resolvedProps } = usePropsResolution('Spinner', props); const resolvedColor = useToken('colors', color); </s> add import { useStyledSystemPropsResolver, useTheme } from '../../../hooks';
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/67ac3166a353d1610697be4ac5502969ce183b74
src/utils/styled.tsx
return React.forwardRef(({ debug, ...props }: any, ref: any) => { const [style, restProps] = useStyledSystemPropsResolver(props); if (debug) { console.log('style:: => ', style, ' restProps:: => ', restProps);
<mask> export let shouldEnableNewStyledSystemImplementation = true; <mask> <mask> export const makeStyledComponent = (Comp: any) => { <mask> if (shouldEnableNewStyledSystemImplementation) { <mask> return React.forwardRef( <mask> ({ style: propStyle, children, debug, ...props }: any, ref: any) => { <mask> const theme = useTheme(); <mask> const currentBreakpoint = useNativeBaseConfig('makeStyledComponent') <mask> .currentBreakpoint; <mask> <mask> const { style, restProps } = React.useMemo(() => { <mask> const { styleSheet, restProps } = getStyleAndFilteredProps({ <mask> ...props, <mask> theme, <mask> debug, <mask> currentBreakpoint, <mask> }); <mask> if (propStyle) { <mask> return { style: [styleSheet.box, propStyle], restProps }; <mask> } else { <mask> return { style: styleSheet.box, restProps }; <mask> } <mask> }, [props, theme, propStyle, currentBreakpoint, debug]); <mask> <mask> return ( <mask> <Comp {...restProps} style={style} ref={ref}> <mask> {children} <mask> </Comp> <mask> ); <mask> } <mask> ); <mask> } else { <mask> //@ts-ignore <mask> return styled(Comp)(...resolversForBox); </s> Styled system removal bug fixes (#3878) * feat: alpha opacity in colors and remove styled system * spinner size fixes * fix: spinner size and scrollview error * fix: conflicts </s> remove for (const property in styleObject) { if ( typeof styleObject[property] === 'string' && styleObject[property].includes('px') ) { styleObject[property] = parseInt(styleObject[property]); </s> add const { style, restProps } = React.useMemo(() => { const { styleSheet, restProps } = getStyleAndFilteredProps({ ...props, theme, debug, currentBreakpoint, }); if (propStyle) { return { style: [styleSheet.box, propStyle], restProps }; } else { return { style: styleSheet.box, restProps }; </s> remove export const useStyledSystemPropsResolver = (props: any) => { </s> add export const useStyledSystemPropsResolver = ({ style: propStyle, debug, ...props }: any) => { </s> remove ); </s> add return ( <Comp {...restProps} style={style} ref={ref}> {props.children} </Comp> ); }); </s> remove const propsWithTheme = { ...props, theme }; let styleObject: any = {}; resolversForBox.forEach((resolver: any) => { styleObject = { ...styleObject, ...resolver(propsWithTheme) }; }); </s> add const currentBreakpoint = useNativeBaseConfig('makeStyledComponent') .currentBreakpoint;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/GeekyAnts/NativeBase/commit/67ac3166a353d1610697be4ac5502969ce183b74
src/utils/styled.tsx