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> re... | [
"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 onCo... | [
"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 inte... | [
"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> co... | [
"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> }... | [
"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={computedSt... | [
"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> ... | [
"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> ... | [
"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?:... | [
"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;
i... | [
"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> remov... | [
"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... | [
"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... | [
"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",
... | 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> ... | [
"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: ... | [
"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 hover... | [
"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 ... | [
"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> ... | [
"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> >
... | [
"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.... | [
"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> )... | [
"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 } f... | [
"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> // omitUnd... | [
"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 '... | [
"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> ... | [
"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 `varia... | [
"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 pro... | <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> ... | [
"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",
"re... | 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)) {
... | <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: Nest... | [
"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",
"re... | 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} compone... | [
"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>... | [
"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> ... | [
"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 incomingPr... | [
"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?.linea... | [
"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> ... | [
"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.bg... | [
"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?.linea... | [
"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 = 'backgrou... | [
"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((co... | [
"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?.co... | [
"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:... | [
"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... | [
"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 ... | [
"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 ...componentThe... | [
"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... | [
"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 fro... | [
"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> ... | [
"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... | [
"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... | [
"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], r... | <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> deb... | [
"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> );
<ma... | [
"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.get... | [
"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: ... | [
"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> ... | [
"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> col... | [
"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... | [
"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> ... | [
"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 = {
... | [
"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 jus... | [
"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().fontSize... | [
"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().fontSize... | [
"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().fontSize... | [
"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 c... | [
"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',
<ma... | [
"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> fon... | [
"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().input... | [
"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: 'transpare... | [
"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... | [
"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.get... | [
"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... | [
"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> a... | [
"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... | [
"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... | [
"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> ... | [
"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 childre... | [
"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>... | [
"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={th... | <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> ... | [
"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> ... | [
"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... | [
"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> {.... | [
"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 { makeStyl... | [
"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>
<ma... | [
"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>... | [
"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... | [
"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> };
</... | [
"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 sty... | [
"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> St... | [
"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> ... | [
"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) => {
... | [
"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: styleSh... | <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].include... | [
"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
* ... | [
"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
... | [
"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, ... | [
"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 ... | [
"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... | [
"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... | [
"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) {
<ma... | [
"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 rem... | [
"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,
<... | [
"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) => {
<... | [
"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",
"re... | https://github.com/GeekyAnts/NativeBase/commit/67ac3166a353d1610697be4ac5502969ce183b74 | src/utils/styled.tsx |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.