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 |
|---|---|---|---|---|
borderBottomWidth: this.getTheme().borderWidth,
padding: this.getTheme().listItemPadding,
backgroundColor: this.getTheme().listDividerBg, | <mask> alignItems: 'center',
<mask> borderColor: this.getTheme().listBorderColor
<mask> },
<mask> listItemDivider: {
<mask> borderBottomWidth: 1,
<mask> padding: 7,
<mask> backgroundColor:... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/d7b406efa97b545e0a07e645bbf904ab3de11538 | Components/Widgets/ListItem.js |
fontSize: 16,
},
dividerItemText: {
fontSize: 16,
fontWeight: '500' | <mask> flexDirection: 'row',
<mask> borderColor: this.getTheme().listBorderColor
<mask> },
<mask> itemText: {
<mask> fontSize: 18,
<mask> },
<mask> itemIcon: {
<mask> fontSiz... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/d7b406efa97b545e0a07e645bbf904ab3de11538 | Components/Widgets/ListItem.js |
fontSize: this.getTheme().iconFontSize, | <mask> itemText: {
<mask> fontSize: 18,
<mask> },
<mask> itemIcon: {
<mask> fontSize: 27,
<mask> color: 'black'
<mask> },
<mask> itemNote: {
<mask> fontSize: ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/d7b406efa97b545e0a07e645bbf904ab3de11538 | Components/Widgets/ListItem.js |
color: this.getTheme().listNoteColor, | <mask> color: 'black'
<mask> },
<mask> itemNote: {
<mask> fontSize: 15,
<mask> color: '#58575C',
<mask> alignSelf: 'center',
<mask> fontWeight: '100',
<mask> flex: 1,
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/d7b406efa97b545e0a07e645bbf904ab3de11538 | Components/Widgets/ListItem.js |
if (this.props.itemDivider) {
defaultProps = {
style: this.getInitialStyle().dividerItemText | <mask> style: this.getInitialStyle().itemButton
<mask> }
<mask> }
<mask> else if(child.type == Text) {
<mask> if(child.props.note && this.thumbnailPresent()) {
<mask> defaultProps = {
<mask> style: this.getInitialStyle().... | [
"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/d7b406efa97b545e0a07e645bbf904ab3de11538 | Components/Widgets/ListItem.js |
newChildren.push(<View style={ this.notePresent() ? this.getRightStyle().right :
this.getRightStyle().right2 }> | <mask> }
<mask> else {
<mask> var childrenArray = React.Children.toArray(this.props.children);
<mask> newChildren.push(React.cloneElement(childrenArray[0], this.getChildProps(childrenArray[0])));
<mask> newChildren.push(<View style={this.getRi... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/d7b406efa97b545e0a07e645bbf904ab3de11538 | Components/Widgets/ListItem.js |
import Badge from './Components/Widgets/Badge'; | <mask> import Icon from './Components/Widgets/Icon';
<mask> import Thumbnail from './Components/Widgets/Thumbnail';
<mask> import Card from './Components/Widgets/Card';
<mask>
<mask> module.exports = {
<mask> Header: Header,
<mask> Footer: Footer,
<mask> Title: Title,
</s> lists updated with badges and ava... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/d7b406efa97b545e0a07e645bbf904ab3de11538 | index.js |
Card: Card,
Badge: Badge | <mask> View: View,
<mask> InputGroup: InputGroup,
<mask> Icon: Icon,
<mask> Thumbnail: Thumbnail,
<mask> Card: Card
<mask> };
</s> lists updated with badges and avatars </s> remove newChildren.push(<View style={this.getRightStyle().right}>
</s> add newChildren.push(<View sty... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/d7b406efa97b545e0a07e645bbf904ab3de11538 | index.js |
import { Box, IBoxProps } from '../components/primitives'; | <mask> import React from 'react';
<mask> import { Box } from '../components/primitives';
<mask> import OverlayProvider from './Overlay/OverlayProvider';
<mask> import { useColorModeValue } from '../color-mode';
<mask>
<mask> const NativeBaseWrapper = ({ children, ...props }: any) => {
<mask> return (
</s> fi... | [
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/d7f4cc216dbcefe1c373eca0cff8cc78a8cb9778 | src/core/NativeBaseWrapper.tsx |
import { SafeAreaView, StyleSheet } from 'react-native'; | <mask> import { Box, IBoxProps } from '../components/primitives';
<mask> import OverlayProvider from './Overlay/OverlayProvider';
<mask> import { useColorModeValue } from '../color-mode';
<mask>
<mask> type INativeBaseWrapperProps = IBoxProps & {
<mask> disableSafeArea?: boolean;
<mask> };
<mask>
<mask> co... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/d7f4cc216dbcefe1c373eca0cff8cc78a8cb9778 | src/core/NativeBaseWrapper.tsx |
type INativeBaseWrapperProps = IBoxProps & {
disableSafeArea?: boolean;
};
const NativeBaseWrapper = ({
children,
disableSafeArea,
...props
}: INativeBaseWrapperProps) => {
const styles = StyleSheet.create({
container: {
flex: 1,
},
});
const defaultView = ( | <mask> import { Box } from '../components/primitives';
<mask> import OverlayProvider from './Overlay/OverlayProvider';
<mask> import { useColorModeValue } from '../color-mode';
<mask>
<mask> const NativeBaseWrapper = ({ children, ...props }: any) => {
<mask> return (
<mask> <Box
<mask> flex={1}
<m... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/d7f4cc216dbcefe1c373eca0cff8cc78a8cb9778 | src/core/NativeBaseWrapper.tsx |
return disableSafeArea ? (
defaultView
) : (
<SafeAreaView style={styles.container}>{defaultView}</SafeAreaView>
); | <mask> >
<mask> <OverlayProvider>{children}</OverlayProvider>
<mask> </Box>
<mask> );
<mask> };
<mask>
<mask> export default NativeBaseWrapper;
</s> fix: added safeareaview to wrapper </s> remove <Box style={{ zIndex: 999999 }} w="100%">
</s> add <Box w="100%" h="100%" zIndex={... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/d7f4cc216dbcefe1c373eca0cff8cc78a8cb9778 | src/core/NativeBaseWrapper.tsx |
zIndex: 999, | <mask> top: 0,
<mask> bottom: 0,
<mask> right: 0,
<mask> left: 0,
<mask> zIndex: 99999,
<mask> alignItems: 'center',
<mask> opacity: 0.5,
<mask>
<mask> // backgroundColor: config.disableOverlay
<mask> // ? 'transparent'
</s> fix: added safeareaview to ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/d7f4cc216dbcefe1c373eca0cff8cc78a8cb9778 | src/core/Overlay/OverlayProvider.tsx |
<Box w="100%" h="100%" zIndex={999999}> | <mask> nativeID="toast-provider"
<mask> style={[providerStyle.provider, { opacity: fadeValue }]}
<mask> pointerEvents={pointerEventsSetter()}
<mask> >
<mask> <Box style={{ zIndex: 999999 }} w="100%">
<mask> {overlayItem}
<mask> </Box>
<mask> <Box
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/d7f4cc216dbcefe1c373eca0cff8cc78a8cb9778 | src/core/Overlay/OverlayProvider.tsx |
import ViewNB from './../View';
import Header from './../Header';
import Content from './../Content';
import Footer from './../Footer';
import Fab from './../Fab';
import NativeBaseComponent from '../../Base/NativeBaseComponent'; | <mask> 'use strict';
<mask>
<mask> import React from 'react';
<mask> import {View, Image, ScrollView} from 'react-native';
<mask> import ViewNB from './View';
<mask> import Header from './Header';
<mask> import Content from './Content';
<mask> import Footer from './Footer';
<mask> import NativeBaseComponent f... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/da39a45ae142d62d9d0a125e4c3fedb1de6ad369 | Components/Widgets/Container/index.js |
import computeProps from '../../../Utils/computeProps'; | <mask> import Content from './Content';
<mask> import Footer from './Footer';
<mask> import NativeBaseComponent from '../Base/NativeBaseComponent';
<mask> import _ from 'lodash';
<mask> import computeProps from '../../Utils/computeProps';
<mask>
<mask> export default class Container extends NativeBaseComponent ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/da39a45ae142d62d9d0a125e4c3fedb1de6ad369 | Components/Widgets/Container/index.js |
<mask>
<mask> propTypes: {
<mask> style : React.PropTypes.object
<mask> }
<mask>
<mask> renderOther(){
<mask> if(Array.isArray(this.props.children)) {
<mask>
<mask> return _.filter(this.props.children, function(item) {
<mask> if(item && (item.type != Header && item.type ... | [
"keep",
"keep",
"keep",
"keep",
"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/da39a45ae142d62d9d0a125e4c3fedb1de6ad369 | Components/Widgets/Container/index.js | |
if(item && _.get(item, 'type', null) == Header) { | <mask>
<mask> renderHeader() {
<mask> if(Array.isArray(this.props.children)) {
<mask> return _.find(this.props.children, function(item) {
<mask> if(item && item.type == Header) {
<mask> return true;
<mask> }
<mask> });
<mask> }
<mask>
</s> Deletes the assets ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/da39a45ae142d62d9d0a125e4c3fedb1de6ad369 | Components/Widgets/Container/index.js |
if(this.props.children && _.get(this.props.children, 'type', null) == Header) { | <mask> });
<mask> }
<mask>
<mask> else {
<mask> if(this.props.children && this.props.children.type == Header) {
<mask> return this.props.children;
<mask> }
<mask> }
<mask> }
<mask> renderContent() {
</s> Deletes the assets from Merge request #218 </s> remove
re... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/da39a45ae142d62d9d0a125e4c3fedb1de6ad369 | Components/Widgets/Container/index.js |
if(item && (_.get(item, 'type', null) == ViewNB || _.get(item, 'type', null) == Content || _.get(item, 'type', null) == Image || _.get(item, 'type', null) == View || _.get(item, 'type', null) == ScrollView || _.get(item, 'type', null) == Fab )) { | <mask> renderContent() {
<mask> if(Array.isArray(this.props.children)) {
<mask>
<mask> return _.filter(this.props.children, function(item) {
<mask> if(item && (item.type == ViewNB || item.type == Content || item.type == Image || item.type == View || item.type == ScrollView )) {
<mask>
<mask... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/da39a45ae142d62d9d0a125e4c3fedb1de6ad369 | Components/Widgets/Container/index.js |
if(item && _.get(item, 'type', null) == Footer) { | <mask> }
<mask> renderFooter() {
<mask> if(Array.isArray(this.props.children)) {
<mask> return _.find(this.props.children, function(item) {
<mask> if(item && item.type == Footer) {
<mask> return true;
<mask> }
<mask> });
<mask> }
<mask>
</s> Deletes the asse... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/da39a45ae142d62d9d0a125e4c3fedb1de6ad369 | Components/Widgets/Container/index.js |
<View ref={c => this._root = c} {...this.prepareRootProps()}> | <mask> return computeProps(this.props, defaultProps);
<mask> }
<mask> render() {
<mask> return(
<mask> <View {...this.prepareRootProps()}>
<mask>
<mask> {this.renderHeader()}
<mask>
<mask> {this.renderContent()}
<mask>
</s> Deletes the assets from Merge request #218 </s> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/da39a45ae142d62d9d0a125e4c3fedb1de6ad369 | Components/Widgets/Container/index.js |
<mask> {this.renderContent()}
<mask>
<mask> {this.renderFooter()}
<mask>
<mask> {this.props.allowExtraContent == true ? this.renderOther() : null}
<mask> </View>
<mask> );
<mask>
<mask> }
<mask>
</s> Deletes the assets from Merge request #218 </s> remove } </s> add </... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/da39a45ae142d62d9d0a125e4c3fedb1de6ad369 | Components/Widgets/Container/index.js | |
<mask> );
<mask>
<mask> }
<mask>
<mask> } </s> Deletes the assets from Merge request #218 </s> remove {this.props.allowExtraContent == true ? this.renderOther() : null}
</s> add </s> remove if(this.props.children && this.props.children.type == Header) {
</s> add if(this.props.childre... | [
"keep",
"keep",
"keep",
"keep",
"replace"
] | https://github.com/GeekyAnts/NativeBase/commit/da39a45ae142d62d9d0a125e4c3fedb1de6ad369 | Components/Widgets/Container/index.js | |
} | <mask>
<mask> }
<mask>
<mask> }
</s> Deletes the assets from Merge request #218 </s> remove } </s> add </s> remove if(this.props.children && this.props.children.type == Header) {
</s> add if(this.props.children && _.get(this.props.children, 'type', null) == Header) { </s> remove if(item &... | [
"keep",
"keep",
"keep",
"add"
] | https://github.com/GeekyAnts/NativeBase/commit/da39a45ae142d62d9d0a125e4c3fedb1de6ad369 | Components/Widgets/Container/index.js |
hoverProps: { | <mask>
<mask> const useHover = () => {
<mask> const [isHovered, setHovered] = React.useState(false);
<mask> return {
<mask> pressableProps: {
<mask> onHoverIn: () => setHovered(true),
<mask> onHoverOut: () => setHovered(false),
<mask> },
<mask> isHovered,
<mask> };
</s> feat: p... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/components/primitives/Pressable/Pressable.tsx |
const { hoverProps, isHovered } = useHover();
const { pressableProps, isPressed } = useIsPressed(); | <mask> ...props
<mask> }: IPressableProps,
<mask> ref: any
<mask> ) => {
<mask> const { pressableProps, isHovered } = useHover();
<mask> const { pressableProps: isPressedProps, isPressed } = useIsPressed();
<mask> const { focusProps, isFocused } = useFocus();
<mask> const {
<mask> _hover,
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/components/primitives/Pressable/Pressable.tsx |
<mask> ) => {
<mask> const { pressableProps, isHovered } = useHover();
<mask> const { pressableProps: isPressedProps, isPressed } = useIsPressed();
<mask> const { focusProps, isFocused } = useFocus();
<mask> const {
<mask> _hover,
<mask> _pressed,
<mask> _focus,
<mask> _focusVisible,
<... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/components/primitives/Pressable/Pressable.tsx | |
const { ...resolvedProps } = usePropsResolution('Pressable', props, {
isHovered,
isPressed,
isFocused,
isFocusVisible,
});
| <mask> const { hoverProps, isHovered } = useHover();
<mask> const { pressableProps, isPressed } = useIsPressed();
<mask> const { focusProps, isFocused } = useFocus();
<mask> const { isFocusVisible, focusProps: focusRingProps }: any = useFocusRing();
<mask> // TODO : Replace Render props with Context Hook... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/components/primitives/Pressable/Pressable.tsx |
onPressIn={composeEventHandlers(onPressIn, pressableProps.onPressIn)}
onPressOut={composeEventHandlers(onPressOut, pressableProps.onPressOut)} | <mask> // TODO : Replace Render props with Context Hook
<mask> return (
<mask> <StyledPressable
<mask> ref={ref}
<mask> onPressIn={composeEventHandlers(onPressIn, isPressedProps.onPressIn)}
<mask> onPressOut={composeEventHandlers(onPressOut, isPressedProps.onPressOut)}
<mask> // @... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/components/primitives/Pressable/Pressable.tsx |
onHoverIn={composeEventHandlers(onHoverIn, hoverProps.onHoverIn)} | <mask> ref={ref}
<mask> onPressIn={composeEventHandlers(onPressIn, isPressedProps.onPressIn)}
<mask> onPressOut={composeEventHandlers(onPressOut, isPressedProps.onPressOut)}
<mask> // @ts-ignore - web only
<mask> onHoverIn={composeEventHandlers(onHoverIn, pressableProps.onHoverIn)}
<... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/components/primitives/Pressable/Pressable.tsx |
onHoverOut={composeEventHandlers(onHoverOut, hoverProps.onHoverOut)} | <mask> onPressOut={composeEventHandlers(onPressOut, isPressedProps.onPressOut)}
<mask> // @ts-ignore - web only
<mask> onHoverIn={composeEventHandlers(onHoverIn, pressableProps.onHoverIn)}
<mask> // @ts-ignore - web only
<mask> onHoverOut={composeEventHandlers(onHoverOut, pressablePro... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/components/primitives/Pressable/Pressable.tsx |
{...resolvedProps} | <mask> onBlur={composeEventHandlers(
<mask> composeEventHandlers(onBlur, focusProps.onBlur),
<mask> focusRingProps.onBlur
<mask> )}
<mask> {...themeProps}
<mask> {...(isHovered && _hover)}
<mask> {...(isFocused && _focus)}
<mask> {...(isFocusVisible && _focusV... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/components/primitives/Pressable/Pressable.tsx |
<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 { useNativeBase } from '../useNativeBase';
<mask> import { usePlatformProps } from '../usePlatformProps';
<mask> import { useColorModeProps }... | [
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx | |
import { useWindowDimensions, Platform } from 'react-native'; | <mask> import React from 'react';
<mask> import get from 'lodash.get';
<mask> import merge from 'lodash.merge';
<mask> import { useNativeBase } from '../useNativeBase';
<mask> import { useColorMode } from '../../core/color-mode';
<mask> import { resolveValueWithBreakpoint } from './utils';
<mask> import {
<mask... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
<mask> import omit from 'lodash.omit';
<mask> import isNil from 'lodash.isnil';
<mask> import merge from 'lodash.merge';
<mask> import { useNativeBase } from '../useNativeBase';
<mask> import { usePlatformProps } from '../usePlatformProps';
<mask> import { useColorModeProps } from '../useColorModeProps';
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx | |
import { resolveValueWithBreakpoint } from './utils'; | <mask> import { useWindowDimensions, Platform } from 'react-native';
<mask> import { useNativeBase } from '../useNativeBase';
<mask> import { useColorMode } from '../../core/color-mode';
<mask> import {
<mask> getClosestBreakpoint,
<mask> omitUndefined,
<mask> extractInObject,
<mask> } from '../../theme/t... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
getClosestBreakpoint,
omitUndefined,
extractInObject,
} from '../../theme/tools'; | <mask> import { usePlatformProps } from '../usePlatformProps';
<mask> import { useColorModeProps } from '../useColorModeProps';
<mask> import { useColorMode } from '../../core/color-mode';
<mask> import {
<mask> resolveValueWithBreakpoint,
<mask> extractPropertyFromFunction,
<mask> } from './utils';
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
// TODO: have to remove as many ts-ignore as possible.
const platformPropsMap = ['_ios', '_android', '_web'];
const colorModePropsMap = ['_light', '_dark'];
const statePropsMap = [
'_invalid',
'_disabled',
'_checked',
'_hover',
'_pressed',
'_focused',
];
const pseudoPropsMap = {
_web: 'web',
_ios: 'ios... | <mask> } from './utils';
<mask> import { omitUndefined, extractInObject } from './../../theme/tools';
<mask> import { themePropertyMap } from './../../theme/base';
<mask> import { useContrastText } from '../useContrastText';
<mask> import { shouldEnableNewStyledSystemImplementation } from '../../utils/styled';
<m... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
* @summary Combines provided porps with component's theme props and resloves them.
* @description NOTE: Avoid passing JSX and functions.
* @arg {string} component - Name of the component. | <mask> import { shouldEnableNewStyledSystemImplementation } from '../../utils/styled';
<mask> import { useNativeBaseConfig } from '../../core/NativeBaseContext';
<mask>
<mask> /**
<mask> * @summary Resolves, simplify and merge components specific theme.
<mask> * @description The function extract and execute co... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
* @arg {object} state - dependent states.
* @arg {object} config - configuration for resolution.
* @returns {object} Resolved and flattened props. | <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).
<mask> * @arg {object} componentTheme - Theme for speci... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
export function usePropsResolution(
component: string,
incomingProps: any,
state?: any,
config?: any
) {
const [ignoredProps, cleanIncomingProps] = extractInObject(
incomingProps,
['children', 'onPress', 'icon', 'onOpen', 'onClose'].concat(
config?.ignoreProps || []
)
);
const { theme }... | <mask> * @arg {object} incomingProps - Props passed by the user.
<mask> * @arg {object} colorModeProps - `colorMode` object.
<mask> * @returns {object} Resolved component specific theme.
<mask> */
<mask> const useSimplifyComponentTheme = (
<mask> theme: object,
<mask> componentTheme: {
<mask> defaul... | [
"keep",
"keep",
"keep",
"keep",
"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/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
const componentTheme = get(theme, `components.${component}`, {});
const windowWidth = useWindowDimensions()?.width;
const currentBreakpoint = React.useMemo(
() => getClosestBreakpoint(theme.breakpoints, windowWidth),
[windowWidth, theme.breakpoints]
);
// STEP 1: combine default props and incoming pr... | <mask> let sizeResolved = false;
<mask> let hasVariant = false;
<mask> // Resolving component's defaultProps.
<mask>
<mask> // Shallow merge defaultProps and incoming props to pass them in baseStyle, variants and sizes
<mask> const combinedProps: any = {
<mask> ...componentTheme.defaultProps,
<ma... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
// NOTE: Resoloving baseStyle | <mask> ...componentTheme.defaultProps,
<mask> ...incomingProps,
<mask> };
<mask>
<mask> // Resolving component's baseStyle
<mask> let componentBaseStyle = {};
<mask> if (componentTheme.baseStyle) {
<mask> componentBaseStyle =
<mask> typeof componentTheme.baseStyle !== 'function'
<ma... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
...flattenProps, | <mask> typeof componentTheme.baseStyle !== 'function'
<mask> ? componentTheme.baseStyle
<mask> : componentTheme.baseStyle({
<mask> theme,
<mask> ...combinedProps,
<mask> ...colorModeProps,
<mask> });
<mask> }
<mask>
<mask> // To handle r... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
pseudoPropsResolver({
props: componentBaseStyle,
platform: Platform.OS,
colormode: colorModeProps.colorMode,
state: state || {},
}); | <mask> ...flattenProps,
<mask> ...colorModeProps,
<mask> });
<mask> }
<mask>
<mask> // NOTE: Resolving variants
<mask> const variant = resolveValueWithBreakpoint(
<mask> flattenProps.variant,
</s> feat: pseudo props combination, simplification and resolution </s> re... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
// NOTE: Resolving variants | <mask> ...colorModeProps,
<mask> });
<mask> }
<mask>
<mask> // To handle responsive type variant. i.e. {sm:"x"} | [x, y]
<mask> const variant = resolveValueWithBreakpoint(
<mask> combinedProps.variant,
<mask> currentBreakpoint,
<mask> 'variant'
<mask> );
</s> feat: ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
flattenProps.variant, | <mask> }
<mask>
<mask> // To handle responsive type variant. i.e. {sm:"x"} | [x, y]
<mask> const variant = resolveValueWithBreakpoint(
<mask> combinedProps.variant,
<mask> currentBreakpoint,
<mask> 'variant'
<mask> );
<mask>
<mask> let componentVariantProps = {};
</s> feat: pseudo pro... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
...flattenProps, | <mask> typeof componentTheme.variants[variant] !== 'function'
<mask> ? componentTheme.variants[variant]
<mask> : componentTheme.variants[variant]({
<mask> theme,
<mask> ...combinedProps,
<mask> ...colorModeProps,
<mask> });
<mask>
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
pseudoPropsResolver({
props: componentVariantProps,
platform: Platform.OS,
colormode: colorModeProps.colorMode,
state: state || {},
});
// We remove variant from original props if we found it in the componentTheme | <mask> ...combinedProps,
<mask> ...colorModeProps,
<mask> });
<mask>
<mask> hasVariant = true;
<mask> //@ts-ignore
<mask> incomingProps.variant = undefined;
<mask> }
<mask>
<mask> // To handle responsive size prop. i.e. {sm:"x"} | [x, y]
</s> feat: pseudo p... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
flattenProps.variant = undefined; | <mask> });
<mask>
<mask> hasVariant = true;
<mask> //@ts-ignore
<mask> incomingProps.variant = undefined;
<mask> }
<mask>
<mask> // To handle responsive size prop. i.e. {sm:"x"} | [x, y]
<mask> const size = resolveValueWithBreakpoint(
<mask> combinedProps.size,
</s> feat: ps... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
// NOTE: Resolving size | <mask> //@ts-ignore
<mask> incomingProps.variant = undefined;
<mask> }
<mask>
<mask> // To handle responsive size prop. i.e. {sm:"x"} | [x, y]
<mask> const size = resolveValueWithBreakpoint(
<mask> combinedProps.size,
<mask> currentBreakpoint,
<mask> 'size'
<mask> );
</s> feat: p... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
flattenProps.size, | <mask> }
<mask>
<mask> // To handle responsive size prop. i.e. {sm:"x"} | [x, y]
<mask> const size = resolveValueWithBreakpoint(
<mask> combinedProps.size,
<mask> currentBreakpoint,
<mask> 'size'
<mask> );
<mask>
<mask> let componentSizeProps: any = {};
</s> feat: pseudo props combina... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
let componentSizeProps = {}; | <mask> currentBreakpoint,
<mask> 'size'
<mask> );
<mask>
<mask> let componentSizeProps: any = {};
<mask> // Extracting props from size
<mask> if (size && componentTheme.sizes && componentTheme.sizes[size]) {
<mask> // Type - sizes: {lg: 1}. Refer icon theme
<mask> if (
<mask> ty... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
flattenProps.size = undefined; | <mask> typeof componentTheme.sizes[size] === 'string' ||
<mask> typeof componentTheme.sizes[size] === 'number'
<mask> ) {
<mask> //@ts-ignore
<mask> componentSizeProps.size = componentTheme.sizes[size];
<mask> }
<mask> // Type - sizes: (props) => ({lg: {px: 1}}). Refer heading... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
flattenProps.size = undefined; | <mask> // Type - sizes: (props) => ({lg: {px: 1}}). Refer heading theme
<mask> else if (typeof componentTheme.sizes[size] === 'function') {
<mask> componentSizeProps = componentTheme.sizes[size]({
<mask> theme,
<mask> ...flattenProps,
<mask> ...colorModeProps,
</s> feat: pse... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
...flattenProps, | <mask> // Type - sizes: (props) => ({lg: {px: 1}}). Refer heading theme
<mask> else if (typeof componentTheme.sizes[size] === 'function') {
<mask> componentSizeProps = componentTheme.sizes[size]({
<mask> theme,
<mask> ...combinedProps,
<mask> ...colorModeProps,
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
<mask> theme,
<mask> ...combinedProps,
<mask> ...colorModeProps,
<mask> });
<mask> sizeResolved = true;
<mask> }
<mask> // Type - sizes: {lg: {px: 1}}. Refer button theme
<mask> else {
<mask> componentSizeProps = componentTheme.sizes[size];
<mask> //... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx | |
flattenProps.size = undefined; | <mask> }
<mask> // Type - sizes: {lg: {px: 1}}. Refer button theme
<mask> else {
<mask> componentSizeProps = componentTheme.sizes[size];
<mask> }
<mask>
<mask> pseudoPropsResolver({
<mask> props: componentSizeProps,
</s> feat: pseudo props combination, simplification and resolu... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
<mask> }
<mask> // Type - sizes: {lg: {px: 1}}. Refer button theme
<mask> else {
<mask> componentSizeProps = componentTheme.sizes[size];
<mask> // Type - sizes: { size: 4 }. Refer Images
<mask> if (!componentSizeProps.size) {
<mask> sizeResolved = true;
<mask> }
<mas... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx | |
<mask> if (!componentSizeProps.size) {
<mask> sizeResolved = true;
<mask> }
<mask> }
<mask> // @ts-ignore - Mutating incoming size for now. Fix it after new styled system is implemented
<mask> incomingProps.size = undefined;
<mask> }
<mask>
<mask> const componentMergedTheme... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx | |
pseudoPropsResolver({
props: componentSizeProps,
platform: Platform.OS,
colormode: colorModeProps.colorMode,
state: state || {},
}); | <mask> // @ts-ignore - Mutating incoming size for now. Fix it after new styled system is implemented
<mask> incomingProps.size = undefined;
<mask> }
<mask>
<mask> const componentMergedTheme = merge(
<mask> {},
<mask> componentTheme.defaultProps,
<mask> componentBaseStyle,
<mask> co... | [
"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/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
// STEP 4: Merge | <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 th... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
// STEP 5: linear Grad and contrastText | <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.
<mask> * @arg {object} incom... | [
"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/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
flattenProps.bg?.linearGradient ||
flattenProps.background?.linearGradient ||
flattenProps.bgColor?.linearGradient ||
flattenProps.backgroundColor?.linearGradient | <mask>
<mask> // NOTE: sperating removing props while should be translated
<mask> let ignore: any = [];
<mask> if (
<mask> componentThemeIntegratedProps.bg?.linearGradient ||
<mask> componentThemeIntegratedProps.background?.linearGradient ||
<mask> componentThemeIntegratedProps.bgColor?.linear... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
if (flattenProps.background?.linearGradient) { | <mask> componentThemeIntegratedProps.bgColor?.linearGradient ||
<mask> componentThemeIntegratedProps.backgroundColor?.linearGradient
<mask> ) {
<mask> let bgProp = 'bg';
<mask> if (componentThemeIntegratedProps.background?.linearGradient) {
<mask> bgProp = 'background';
<mask> } else ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
} else if (flattenProps.bgColor?.linearGradient) { | <mask> ) {
<mask> let bgProp = 'bg';
<mask> if (componentThemeIntegratedProps.background?.linearGradient) {
<mask> bgProp = 'background';
<mask> } else if (componentThemeIntegratedProps.bgColor?.linearGradient) {
<mask> bgProp = 'bgColor';
<mask> } else if (componentThemeIntegratedP... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
} else if (flattenProps.backgroundColor?.linearGradient) { | <mask> if (componentThemeIntegratedProps.background?.linearGradient) {
<mask> bgProp = 'background';
<mask> } else if (componentThemeIntegratedProps.bgColor?.linearGradient) {
<mask> bgProp = 'bgColor';
<mask> } else if (componentThemeIntegratedProps.backgroundColor?.linearGradient) {
<mas... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
flattenProps[bgProp].linearGradient.colors = flattenProps[ | <mask> bgProp = 'bgColor';
<mask> } else if (componentThemeIntegratedProps.backgroundColor?.linearGradient) {
<mask> bgProp = 'backgroundColor';
<mask> }
<mask> componentThemeIntegratedProps[
<mask> bgProp
<mask> ].linearGradient.colors = componentThemeIntegratedProps[
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
const [gradientProps] = extractInObject(flattenProps, ignore); | <mask> });
<mask> ignore = ['bg', 'background', 'backgroundColor', 'bgColor'];
<mask> }
<mask> // NOTE: seprating bg props when linearGardiant is available
<mask> const [gradientProps, nonGradientProps] = extractInObject(
<mask> componentThemeIntegratedProps,
<mask> ignore
<mask> );
<ma... | [
"keep",
"keep",
"keep",
"keep",
"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/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
flattenProps.bg ?? flattenProps.backgroundColor ?? flattenProps.bgColor; | <mask> });
<mask> }
<mask>
<mask> let bgColor =
<mask> translatedProps.bg ??
<mask> translatedProps.backgroundColor ??
<mask> translatedProps.bgColor;
<mask>
<mask> const contrastTextColor = useContrastText(
<mask> bgColor,
<mask> translatedProps?._text?.color
<mask> );
</... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
flattenProps?._text?.color | <mask> translatedProps.bgColor;
<mask>
<mask> const contrastTextColor = useContrastText(
<mask> bgColor,
<mask> translatedProps?._text?.color
<mask> );
<mask>
<mask> translatedProps._text = contrastTextColor
<mask> ? {
<mask> color: contrastTextColor,
</s> feat: pseudo props c... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
flattenProps._text = contrastTextColor | <mask> bgColor,
<mask> translatedProps?._text?.color
<mask> );
<mask>
<mask> translatedProps._text = contrastTextColor
<mask> ? {
<mask> color: contrastTextColor,
<mask> ...translatedProps._text,
<mask> }
<mask> : translatedProps._text;
</s> feat: pseudo props combi... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
...flattenProps._text, | <mask>
<mask> translatedProps._text = contrastTextColor
<mask> ? {
<mask> color: contrastTextColor,
<mask> ...translatedProps._text,
<mask> }
<mask> : translatedProps._text;
<mask>
<mask> const resolvedProps = omitUndefined({
<mask> ...translatedProps,
</s> feat: pseud... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
: flattenProps._text; | <mask> ? {
<mask> color: contrastTextColor,
<mask> ...translatedProps._text,
<mask> }
<mask> : translatedProps._text;
<mask>
<mask> const resolvedProps = omitUndefined({
<mask> ...translatedProps,
<mask> ...ignoredProps,
<mask> ...gradientProps,
</s> feat: pseudo ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
...flattenProps, | <mask> }
<mask> : translatedProps._text;
<mask>
<mask> const resolvedProps = omitUndefined({
<mask> ...translatedProps,
<mask> ...ignoredProps,
<mask> ...gradientProps,
<mask> });
<mask>
<mask> return resolvedProps;
</s> feat: pseudo props combination, simplification and resolut... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
// STEP 6: Return
flattenProps = {};
propertyDepth = {}; | <mask> ...gradientProps,
<mask> });
<mask>
<mask> return resolvedProps;
<mask> }
</s> feat: pseudo props combination, simplification and resolution </s> remove ...translatedProps,
</s> add ...flattenProps, </s> remove : translatedProps._text;
</s> add : flattenProps._text; </s> remove ... | [
"keep",
"add",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/hooks/useThemeProps/usePropsResolution.tsx |
import Pressable from './pressable'; | <mask> import { default as NumberInput, NumberInputStepper } from './number-input';
<mask> import PinInput from './pin-input';
<mask> import Progress from './progress';
<mask> import Radio from './radio';
<mask> import Skeleton from './skeleton';
<mask> import Spinner from './spinner';
</s> feat: pseudo props co... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/theme/components/index.ts |
Pressable, | <mask> NumberInput,
<mask> NumberInputStepper,
<mask> PinInput,
<mask> ...PopoverComponentTheme,
<mask> Progress,
<mask> Radio,
<mask> ScaleFade,
<mask> Select,
<mask> SelectItem,
</s> feat: pseudo props combination, simplification and resolution </s> remove import { shouldEnableNewStyledSys... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/daeb9d148aef8a8fcc1adae420ee93d55554150e | src/theme/components/index.ts |
useColorModeValue, | <mask> Icon,
<mask> StorageManager,
<mask> ColorMode,
<mask> } from 'native-base';
<mask> import AsyncStorage from '@react-native-async-storage/async-storage';
<mask>
<mask> function MyWrapper({ children }: any) {
<mask> const { colorMode, toggleColorMode } = useColorMode();
<mask> return (
</s> Re... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/dc462f484d38c24151cd0776d7d7d66ca718b4a2 | example/storybook/stories/components/Wrapper.tsx |
<mask> const { colorMode, toggleColorMode } = useColorMode();
<mask> return (
<mask> <View
<mask> flex={1}
<mask> height="100%"
<mask> width="100%"
<mask> justifyContent="center"
<mask> alignItems="center"
<mask> >
<mask> {children}
<mask> <IconButton
</... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/dc462f484d38c24151cd0776d7d7d66ca718b4a2 | example/storybook/stories/components/Wrapper.tsx | |
bg={useColorModeValue(`gray.50`, `gray.800`)} | <mask> flex={1}
<mask> justifyContent="center"
<mask> alignItems="center"
<mask> >
<mask> {children}
<mask> <IconButton
<mask> position="absolute"
<mask> top={5}
<mask> right={5}
</s> Removed SafeAreaView and fixes for theme background </s> remove ... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/dc462f484d38c24151cd0776d7d7d66ca718b4a2 | example/storybook/stories/components/Wrapper.tsx |
import { IColorModeProviderProps, ColorModeProvider } from './../color-mode'; | <mask> ThemeContext,
<mask> ThemeProvider,
<mask> } from 'styled-components/native';
<mask> import { theme as defaultTheme, ITheme } from './../theme';
<mask> import {
<mask> IColorModeProviderProps,
<mask> ColorModeProvider,
<mask> useColorModeValue,
<mask> } from './../color-mode';
<mask> import H... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/dc462f484d38c24151cd0776d7d7d66ca718b4a2 | src/core/NativeBaseProvider.tsx |
<mask> ColorModeProvider,
<mask> useColorModeValue,
<mask> } from './../color-mode';
<mask> import HybridProvider from './HybridOverlay/HybridProvider';
<mask> import View from '../components/primitives/View';
<mask> import SafeAreaView from '../components/primitives/SafeAreaView';
<mask>
<mask> export int... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/dc462f484d38c24151cd0776d7d7d66ca718b4a2 | src/core/NativeBaseProvider.tsx | |
// const Wrapper = disableSafeArea ? View : SafeAreaView; | <mask> theme = defaultTheme,
<mask> disableSafeArea,
<mask> children,
<mask> } = props;
<mask>
<mask> const Wrapper = disableSafeArea ? View : SafeAreaView;
<mask> return (
<mask> <ThemeProvider theme={theme}>
<mask> <ColorModeProvider
<mask> colorModeManager={colorModeMan... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/dc462f484d38c24151cd0776d7d7d66ca718b4a2 | src/core/NativeBaseProvider.tsx |
<HybridProvider>{children}</HybridProvider> | <mask> <ColorModeProvider
<mask> colorModeManager={colorModeManager}
<mask> options={theme.config}
<mask> >
<mask> <Wrapper bg={useColorModeValue(`gray.50`, `gray.800`)} flex={1}>
<mask> <HybridProvider>{children}</HybridProvider>
<mask> </Wrapper>
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/dc462f484d38c24151cd0776d7d7d66ca718b4a2 | src/core/NativeBaseProvider.tsx |
<mask> import { default as Box, IBoxProps } from '../Box';
<mask> import HStack from '../Stack/HStack';
<mask> import Pressable from '../Pressable';
<mask> import type { IButtonGroupProps, IButtonProps } from './types';
<mask> import { composeEventHandlers } from '../../../utils';
<mask>
<mask> const useHover =... | [
"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/dcdcc20b5e6c4e1f8fc5cf4c83e3bc3f961c0e79 | src/components/primitives/Button/index.tsx | |
<mask> {
<mask> children,
<mask> isLoading,
<mask> isLoadingText,
<mask> accessibilityLabel,
<mask> accessibilityHint,
<mask> accessibilityState,
<mask> accessibilityRole,
<mask> size,
<mask> startIcon,
<mask> onPress,
<mask> onLongPress,
<mask> onPressIn,
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/dcdcc20b5e6c4e1f8fc5cf4c83e3bc3f961c0e79 | src/components/primitives/Button/index.tsx | |
<mask> accessibilityState,
<mask> accessibilityRole,
<mask> size,
<mask> startIcon,
<mask> onPress,
<mask> onLongPress,
<mask> onPressIn,
<mask> onPressOut,
<mask> onHoverIn,
<mask> onHoverOut,
<mask> endIcon,
<mask> spinner,
<mask> ...props
<mask> }: ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/dcdcc20b5e6c4e1f8fc5cf4c83e3bc3f961c0e79 | src/components/primitives/Button/index.tsx | |
const { _text, _hover, _pressed, ...restProps } = useThemeProps('Button', { | <mask> ...props
<mask> }: IButtonProps & IBoxProps,
<mask> ref: any
<mask> ) => {
<mask> const { _text, _hover, _pressed, ...newProps } = useThemeProps('Button', {
<mask> ...props,
<mask> size,
<mask> });
<mask>
<mask> const { isDisabled } = props;
</s> feat: add hover and pressed in p... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/dcdcc20b5e6c4e1f8fc5cf4c83e3bc3f961c0e79 | src/components/primitives/Button/index.tsx |
const pressableProps = {
...restProps,
_hover,
_pressed, | <mask> });
<mask>
<mask> const { isDisabled } = props;
<mask>
<mask> const { pressableProps, isHovered } = useHover();
<mask> const { pressableProps: isPressedProps, isPressed } = useIsPressed();
<mask>
<mask> const themeProps = {
<mask> ...newProps,
<mask> ...(isHovered && _hover),
<mas... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/dcdcc20b5e6c4e1f8fc5cf4c83e3bc3f961c0e79 | src/components/primitives/Button/index.tsx |
<Pressable disabled={isDisabled} ref={ref} {...pressableProps}> | <mask> ...(isPressed && _pressed),
<mask> };
<mask>
<mask> return (
<mask> <Pressable
<mask> onPress={onPress}
<mask> onLongPress={onLongPress}
<mask> onPressIn={composeEventHandlers(onPressIn, isPressedProps.onPressIn)}
<mask> onPressOut={composeEventHandlers(onPressOut, i... | [
"keep",
"keep",
"keep",
"keep",
"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/dcdcc20b5e6c4e1f8fc5cf4c83e3bc3f961c0e79 | src/components/primitives/Button/index.tsx |
<mask> import type { ViewProps, ViewStyle } from 'react-native';
<mask> import type { IAccessibilityProps } from '../../../utils/accessibilityTypes';
<mask> import type {
<mask> BorderProps,
<mask> ColorProps,
<mask> FlexboxProps,
<mask> LayoutProps,
<mask> PositionProps,
<mask> SpaceProps,
<mask>... | [
"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/dcdcc20b5e6c4e1f8fc5cf4c83e3bc3f961c0e79 | src/components/primitives/Button/types.ts | |
import type { IPressableProps } from '../Pressable'; | <mask> import type { ITextProps } from './../Text/types';
<mask>
<mask> export type IButtonProps = IPressableProps & {
<mask> colorScheme?: string;
<mask> variant?: string;
<mask> isLoading?: any;
<mask> size?: 'xs' | 'sm' | 'md' | 'lg';
</s> feat: add hover and pressed in pressable </s> remove export ... | [
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/dcdcc20b5e6c4e1f8fc5cf4c83e3bc3f961c0e79 | src/components/primitives/Button/types.ts |
export type IButtonProps = IPressableProps & {
colorScheme?: string;
variant?: string;
isLoading?: any;
size?: 'xs' | 'sm' | 'md' | 'lg';
startIcon?: JSX.Element | Array<JSX.Element>;
endIcon?: JSX.Element | Array<JSX.Element>;
isLoadingText?: string;
spinner?: JSX.Element;
isDisabled?: boolean;
_te... | <mask> customPositionProps,
<mask> } from '../../../utils/customProps';
<mask> import type { ITextProps } from './../Text/types';
<mask>
<mask> export type IButtonProps = ViewProps &
<mask> ColorProps &
<mask> SpaceProps &
<mask> LayoutProps &
<mask> FlexboxProps &
<mask> BorderProps &
<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/dcdcc20b5e6c4e1f8fc5cf4c83e3bc3f961c0e79 | src/components/primitives/Button/types.ts |
export type IPressableProps = PressableProps &
IBoxProps & {
onHoverIn?: any;
onHoverOut?: any;
_hover?: any;
_pressed?: any;
};
const useHover = () => {
const [isHovered, setHovered] = React.useState(false);
return {
pressableProps: {
onHoverIn: () => setHovered(true),
onHoverO... | <mask> customShadow,
<mask> } from '../../../utils/customProps';
<mask> import type { IBoxProps } from '../Box';
<mask>
<mask> type IPressableProps = PressableProps & IBoxProps;
<mask>
<mask> const StyledPressable = styled(RNPressable)<IPressableProps>(
<mask> color,
<mask> space,
<mask> layout,
</... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/dcdcc20b5e6c4e1f8fc5cf4c83e3bc3f961c0e79 | src/components/primitives/Pressable/index.tsx |
const Pressable = (
{
onPressIn,
onPressOut,
onHoverIn,
onHoverOut,
_hover,
_pressed,
...props
}: IPressableProps,
ref: any
) => {
const { pressableProps, isHovered } = useHover();
const { pressableProps: isPressedProps, isPressed } = useIsPressed();
return (
<StyledPressabl... | <mask> customExtra,
<mask> customLayout
<mask> );
<mask>
<mask> const Pressable = (props: IPressableProps, ref: any) => {
<mask> return <StyledPressable {...props} ref={ref} />;
<mask> };
<mask>
<mask> export default React.forwardRef(Pressable);
</s> feat: add hover and pressed in pressable </s> remov... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/dcdcc20b5e6c4e1f8fc5cf4c83e3bc3f961c0e79 | src/components/primitives/Pressable/index.tsx |
originalEventHandler?: null | ((event: E) => void), | <mask> };
<mask> }
<mask>
<mask> export function composeEventHandlers<E>(
<mask> originalEventHandler?: (event: E) => void,
<mask> ourEventHandler?: (event: E) => void,
<mask> { checkForDefaultPrevented = true } = {}
<mask> ) {
<mask> return function handleEvent(event: E) {
<mask> originalEvent... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/dcdcc20b5e6c4e1f8fc5cf4c83e3bc3f961c0e79 | src/utils/mergeRefs.ts |
if (!this.props.placeHolderText && this.props.defaultDate) {
this.setState({ chosenDate: this.props.defaultDate })
} | <mask> defaultDate: this.props.defaultDate ? this.props.defaultDate : new Date()
<mask> });
<mask> };
<mask>
<mask> setDate(date) {
<mask> this.setState({ chosenDate: new Date(date) });
</s> Shows default date instead of "Select Date" if placeHolderText prop isn't specified.
Enhancement based ... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/dd6e79800eecba6763aaf14f58b84463972a3af8 | src/basic/DatePicker.js |
"/" +
(this.state.chosenDate.getMonth() + 1) +
"/" +
+this.state.chosenDate.getFullYear()
: this.props.placeHolderText
? this.props.placeHolderText
: "Select Date"} | <mask> ]}
<mask> >
<mask> {this.state.chosenDate
<mask> ? this.state.chosenDate.getDate() +
<mask> "/" +
<mask> (this.state.chosenDate.getMonth() + 1) +
<mask> "/" +
<mask> +this.state.chosenDate.getF... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/dd6e79800eecba6763aaf14f58b84463972a3af8 | src/basic/DatePicker.js |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.