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
|
---|---|---|---|---|
<Accordion.AccordionIcon />
</Accordion.AccordionSummary>
<Accordion.AccordionDetails>
|
<mask> </AccordionItem>
<mask> <AccordionItem>
<mask> <AccordionButton>
<mask> <Box>Section 3 title</Box>
<mask> <AccordionIcon />
<mask> </AccordionButton>
<mask> <AccordionPanel>
<mask> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
<mask> eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
<mask> ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
<mask> aliquip ex ea commodo consequat.
<mask> </AccordionPanel>
</s> fix: reduced accordion exports and api changes
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
example/storybook/stories/components/composites/Accordion/Toggle.tsx
|
</Accordion.AccordionDetails>
</Accordion.AccordionItem>
|
<mask> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
<mask> eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
<mask> ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
<mask> aliquip ex ea commodo consequat.
<mask> </AccordionPanel>
<mask> </AccordionItem>
<mask> </Accordion>
<mask> </Box>
<mask> );
<mask> }
</s> fix: reduced accordion exports and api changes
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
example/storybook/stories/components/composites/Accordion/Toggle.tsx
|
import Usage from './Basic';
|
<mask> import React from 'react';
<mask> import { storiesOf } from '@storybook/react-native';
<mask> import { withKnobs } from '@storybook/addon-knobs';
<mask> import Wrapper from './../../Wrapper';
<mask> import Usage from './Usage';
<mask> import Playground from './Playground';
<mask> import Multiple from './Multiple';
<mask> import AccessingInternalState from './AccessingInternalState';
<mask> import ExpandedStyle from './ExpandedStyle';
<mask> import Toggle from './Toggle';
</s> fix: reduced accordion exports and api changes </s> remove import {
Accordion,
AccordionItem,
AccordionButton,
AccordionPanel,
AccordionIcon,
Box,
} from 'native-base';
</s> add import { Accordion, Box } from 'native-base'; </s> remove AccordionButton,
AccordionPanel,
</s> add AccordionSummary,
AccordionDetails, </s> remove import {
Accordion,
AccordionItem,
AccordionButton,
AccordionPanel,
AccordionIcon,
Box,
} from 'native-base';
</s> add import { Accordion, Box } from 'native-base'; </s> remove import {
Accordion,
AccordionItem,
AccordionButton,
AccordionPanel,
AccordionIcon,
Box,
} from 'native-base';
</s> add import { Accordion, Box } from 'native-base';
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
example/storybook/stories/components/composites/Accordion/index.tsx
|
import { default as AccordionItem } from './AccordionItem';
import { default as AccordionSummary } from './AccordionSummary';
import { default as AccordionDetails } from './AccordionDetails';
import { default as AccordionIcon } from './AccordionIcon';
|
<mask> import type { IAccordionProps } from './types';
<mask> import { useThemeProps } from '../../../hooks';
<mask> import getIndexedChildren from '../../../utils/getIndexedChildren';
<mask>
<mask> import { AccordionContext } from './Context';
<mask>
<mask> const Accordion = ({
<mask> children,
</s> fix: reduced accordion exports and api changes </s> remove import Usage from './Usage';
</s> add import Usage from './Basic'; </s> remove AccordionButton,
AccordionPanel,
</s> add AccordionSummary,
AccordionDetails, </s> remove import {
Accordion,
AccordionItem,
AccordionButton,
AccordionPanel,
AccordionIcon,
Box,
} from 'native-base';
</s> add import { Accordion, Box } from 'native-base';
|
[
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/components/composites/Accordion/Accordion.tsx
|
Accordion.AccordionItem = AccordionItem;
Accordion.AccordionSummary = AccordionSummary;
Accordion.AccordionDetails = AccordionDetails;
Accordion.AccordionIcon = AccordionIcon;
export default Accordion;
|
<mask> </AccordionContext.Provider>
<mask> );
<mask> };
<mask>
<mask> export default React.memo(Accordion);
</s> fix: reduced accordion exports and api changes </s> remove export const AccordionButton = {
</s> add export const AccordionSummary = { </s> remove export const AccordionPanel = {
</s> add export const AccordionDetails = { </s> remove // AccordionPanel
</s> add // AccordionDetails </s> remove </AccordionItem>
</s> add </Accordion.AccordionItem>
|
[
"keep",
"keep",
"keep",
"keep",
"replace"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/components/composites/Accordion/Accordion.tsx
|
export { AccordionContext } from './Context';
|
<mask> export { default as Accordion } from './Accordion';
<mask> export { AccordionItemContext } from './Context';
<mask>
<mask> export type {
<mask> IAccordionProps,
</s> fix: reduced accordion exports and api changes </s> remove export { default as AccordionItem } from './AccordionItem';
export { default as AccordionButton } from './AccordionButton';
export { default as AccordionPanel } from './AccordionPanel';
export { default as AccordionIcon } from './AccordionIcon';
</s> add </s> remove export {
Accordion,
AccordionItem,
AccordionButton,
AccordionPanel,
AccordionIcon,
} from './Accordion';
</s> add export { Accordion } from './Accordion'; </s> remove IAccordionButtonProps,
IAccordionPanelProps,
</s> add IAccordionSummaryProps,
IAccordionDetailsProps, </s> remove IAccordionPanelProps,
IAccordionButtonProps,
</s> add IAccordionDetailsProps,
IAccordionSummaryProps,
|
[
"add",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/components/composites/Accordion/index.tsx
|
<mask> export { default as Accordion } from './Accordion';
<mask> export { AccordionItemContext } from './Context';
<mask> export { default as AccordionItem } from './AccordionItem';
<mask> export { default as AccordionButton } from './AccordionButton';
<mask> export { default as AccordionPanel } from './AccordionPanel';
<mask> export { default as AccordionIcon } from './AccordionIcon';
<mask> export type {
<mask> IAccordionProps,
<mask> IAccordionItemProps,
<mask> IAccordionButtonProps,
<mask> IAccordionPanelProps,
</s> fix: reduced accordion exports and api changes </s> remove IAccordionButtonProps,
IAccordionPanelProps,
</s> add IAccordionSummaryProps,
IAccordionDetailsProps, </s> remove export {
Accordion,
AccordionItem,
AccordionButton,
AccordionPanel,
AccordionIcon,
} from './Accordion';
</s> add export { Accordion } from './Accordion'; </s> remove IAccordionPanelProps,
IAccordionButtonProps,
</s> add IAccordionDetailsProps,
IAccordionSummaryProps,
|
[
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/components/composites/Accordion/index.tsx
|
|
IAccordionSummaryProps,
IAccordionDetailsProps,
|
<mask> export { default as AccordionIcon } from './AccordionIcon';
<mask> export type {
<mask> IAccordionProps,
<mask> IAccordionItemProps,
<mask> IAccordionButtonProps,
<mask> IAccordionPanelProps,
<mask> IAccordionIconProps,
<mask> IAccordionContextProps,
<mask> IAccordionItemContextProps,
<mask> } from './types';
</s> fix: reduced accordion exports and api changes </s> remove IAccordionPanelProps,
IAccordionButtonProps,
</s> add IAccordionDetailsProps,
IAccordionSummaryProps, </s> remove export { default as AccordionItem } from './AccordionItem';
export { default as AccordionButton } from './AccordionButton';
export { default as AccordionPanel } from './AccordionPanel';
export { default as AccordionIcon } from './AccordionIcon';
</s> add </s> remove IAccordionButtonProps,
IAccordionPanelProps,
</s> add IAccordionSummaryProps,
IAccordionDetailsProps, </s> remove AccordionButton,
IAccordionButtonProps,
AccordionPanel,
IAccordionPanelProps,
AccordionIcon,
</s> add IAccordionSummaryProps,
IAccordionDetailsProps,
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/components/composites/Accordion/index.tsx
|
import type { ITextProps } from '../../primitives/Text/types';
|
<mask> import type { IBoxProps, IIconProps } from '../../primitives';
<mask>
<mask> export type IAccordionProps = IBoxProps & {
<mask> allowMultiple?: boolean;
<mask> allowToggle?: boolean;
<mask> index?: number[];
</s> fix: reduced accordion exports and api changes </s> remove export type IAccordionButtonProps = IBoxProps & {
</s> add export type IAccordionSummaryProps = IBoxProps & { </s> remove export type IAccordionPanelProps = IBoxProps & {};
</s> add export type IAccordionDetailsProps = IBoxProps & {};
|
[
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/components/composites/Accordion/types.ts
|
_text?: ITextProps;
|
<mask> allowToggle?: boolean;
<mask> index?: number[];
<mask> defaultIndex?: number[];
<mask> onChange?: (index?: number[]) => void;
<mask> };
<mask> export type IAccordionItemProps = IBoxProps & {
<mask> index?: number;
<mask> defaultIsOpen?: boolean;
<mask> isDisabled?: boolean;
</s> fix: reduced accordion exports and api changes </s> remove export type IAccordionButtonProps = IBoxProps & {
</s> add export type IAccordionSummaryProps = IBoxProps & { </s> remove export type IAccordionPanelProps = IBoxProps & {};
</s> add export type IAccordionDetailsProps = IBoxProps & {};
|
[
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/components/composites/Accordion/types.ts
|
_text?: ITextProps;
|
<mask> isDisabled?: boolean;
<mask> id?: number;
<mask> };
<mask> export type IAccordionSummaryProps = IBoxProps & {
<mask> style?: any;
<mask> _expanded?: any;
<mask> _disabled?: any;
</s> fix: reduced accordion exports and api changes </s> remove export type IAccordionButtonProps = IBoxProps & {
</s> add export type IAccordionSummaryProps = IBoxProps & { </s> remove export type IAccordionPanelProps = IBoxProps & {};
</s> add export type IAccordionDetailsProps = IBoxProps & {};
|
[
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/components/composites/Accordion/types.ts
|
export type IAccordionSummaryProps = IBoxProps & {
|
<mask> defaultIsOpen?: boolean;
<mask> isDisabled?: boolean;
<mask> id?: number;
<mask> };
<mask> export type IAccordionButtonProps = IBoxProps & {
<mask> style?: any;
<mask> _expanded?: any;
<mask> _disabled?: any;
<mask> _hover?: any;
<mask> };
</s> fix: reduced accordion exports and api changes </s> remove export type IAccordionPanelProps = IBoxProps & {};
</s> add export type IAccordionDetailsProps = IBoxProps & {};
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/components/composites/Accordion/types.ts
|
_text?: ITextProps;
|
<mask> _expanded?: any;
<mask> _disabled?: any;
<mask> _hover?: any;
<mask> };
<mask> export type IAccordionDetailsProps = IBoxProps & {};
<mask> export type IAccordionContextProps = {
<mask> index?: number[];
<mask> changeHandler?: (isOpening: boolean, id: number) => void;
<mask> _text?: ITextProps;
</s> fix: reduced accordion exports and api changes </s> remove export type IAccordionPanelProps = IBoxProps & {};
</s> add export type IAccordionDetailsProps = IBoxProps & {}; </s> remove export type IAccordionButtonProps = IBoxProps & {
</s> add export type IAccordionSummaryProps = IBoxProps & {
|
[
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/components/composites/Accordion/types.ts
|
export type IAccordionDetailsProps = IBoxProps & {};
|
<mask> _expanded?: any;
<mask> _disabled?: any;
<mask> _hover?: any;
<mask> };
<mask> export type IAccordionPanelProps = IBoxProps & {};
<mask> export type IAccordionContextProps = {
<mask> index?: number[];
<mask> changeHandler?: (isOpening: boolean, id: number) => void;
<mask> };
<mask> export type IAccordionItemContextProps = {
</s> fix: reduced accordion exports and api changes </s> remove export type IAccordionButtonProps = IBoxProps & {
</s> add export type IAccordionSummaryProps = IBoxProps & {
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/components/composites/Accordion/types.ts
|
_text?: ITextProps;
|
<mask> index?: number[];
<mask> changeHandler?: (isOpening: boolean, id: number) => void;
<mask> };
<mask> export type IAccordionItemContextProps = {
<mask> index?: number;
<mask> isOpen?: boolean;
<mask> isDisabled?: boolean;
<mask> onClose?: () => void;
</s> fix: reduced accordion exports and api changes </s> remove export type IAccordionPanelProps = IBoxProps & {};
</s> add export type IAccordionDetailsProps = IBoxProps & {};
|
[
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/components/composites/Accordion/types.ts
|
_text?: ITextProps;
|
<mask> isOpen?: boolean;
<mask> isDisabled?: boolean;
<mask> onClose?: () => void;
<mask> onOpen?: () => void;
<mask> };
<mask> export type IAccordionIconProps = IIconProps & {
<mask> style?: any;
<mask> _text?: ITextProps;
</s> fix: reduced accordion exports and api changes
|
[
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/components/composites/Accordion/types.ts
|
_text?: ITextProps;
|
<mask> _text?: ITextProps;
<mask> };
<mask> export type IAccordionIconProps = IIconProps & {
<mask> style?: any;
<mask> };
</s> fix: reduced accordion exports and api changes </s> remove export type IAccordionButtonProps = IBoxProps & {
</s> add export type IAccordionSummaryProps = IBoxProps & { </s> remove export type IAccordionPanelProps = IBoxProps & {};
</s> add export type IAccordionDetailsProps = IBoxProps & {};
|
[
"keep",
"keep",
"keep",
"add",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/components/composites/Accordion/types.ts
|
export { Accordion } from './Accordion';
|
<mask> ISkeletonCircleProps,
<mask> ISkeletonTextProps,
<mask> } from './Skeleton';
<mask>
<mask> export {
<mask> Accordion,
<mask> AccordionItem,
<mask> AccordionButton,
<mask> AccordionPanel,
<mask> AccordionIcon,
<mask> } from './Accordion';
<mask> export type {
<mask> IAccordionProps,
<mask> IAccordionPanelProps,
<mask> IAccordionButtonProps,
<mask> IAccordionItemProps,
</s> fix: reduced accordion exports and api changes </s> remove IAccordionPanelProps,
IAccordionButtonProps,
</s> add IAccordionDetailsProps,
IAccordionSummaryProps, </s> remove AccordionButton,
IAccordionButtonProps,
AccordionPanel,
IAccordionPanelProps,
AccordionIcon,
</s> add IAccordionSummaryProps,
IAccordionDetailsProps, </s> remove AccordionItem,
</s> add </s> remove export { default as AccordionItem } from './AccordionItem';
export { default as AccordionButton } from './AccordionButton';
export { default as AccordionPanel } from './AccordionPanel';
export { default as AccordionIcon } from './AccordionIcon';
</s> add </s> remove IAccordionButtonProps,
IAccordionPanelProps,
</s> add IAccordionSummaryProps,
IAccordionDetailsProps,
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/components/composites/index.ts
|
IAccordionDetailsProps,
IAccordionSummaryProps,
|
<mask> AccordionIcon,
<mask> } from './Accordion';
<mask> export type {
<mask> IAccordionProps,
<mask> IAccordionPanelProps,
<mask> IAccordionButtonProps,
<mask> IAccordionItemProps,
<mask> IAccordionIconProps,
<mask> IAccordionContextProps,
<mask> IAccordionItemContextProps,
<mask> } from './Accordion';
</s> fix: reduced accordion exports and api changes </s> remove export {
Accordion,
AccordionItem,
AccordionButton,
AccordionPanel,
AccordionIcon,
} from './Accordion';
</s> add export { Accordion } from './Accordion'; </s> remove IAccordionButtonProps,
IAccordionPanelProps,
</s> add IAccordionSummaryProps,
IAccordionDetailsProps, </s> remove AccordionButton,
IAccordionButtonProps,
AccordionPanel,
IAccordionPanelProps,
AccordionIcon,
</s> add IAccordionSummaryProps,
IAccordionDetailsProps, </s> remove IAccordionButtonProps,
IAccordionPanelProps,
</s> add IAccordionSummaryProps,
IAccordionDetailsProps, </s> remove export { default as AccordionItem } from './AccordionItem';
export { default as AccordionButton } from './AccordionButton';
export { default as AccordionPanel } from './AccordionPanel';
export { default as AccordionIcon } from './AccordionIcon';
</s> add
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/components/composites/index.ts
|
<mask> Kbd,
<mask> Progress,
<mask> Accordion,
<mask> IAccordionProps,
<mask> AccordionItem,
<mask> IAccordionItemProps,
<mask> AccordionButton,
<mask> IAccordionButtonProps,
<mask> AccordionPanel,
<mask> IAccordionPanelProps,
</s> fix: reduced accordion exports and api changes </s> remove AccordionButton,
IAccordionButtonProps,
AccordionPanel,
IAccordionPanelProps,
AccordionIcon,
</s> add IAccordionSummaryProps,
IAccordionDetailsProps, </s> remove export {
Accordion,
AccordionItem,
AccordionButton,
AccordionPanel,
AccordionIcon,
} from './Accordion';
</s> add export { Accordion } from './Accordion'; </s> remove AccordionItem,
AccordionButton,
AccordionPanel,
AccordionIcon,
</s> add </s> remove IAccordionButtonProps,
IAccordionPanelProps,
</s> add IAccordionSummaryProps,
IAccordionDetailsProps, </s> remove IAccordionPanelProps,
IAccordionButtonProps,
</s> add IAccordionDetailsProps,
IAccordionSummaryProps,
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/index.tsx
|
|
IAccordionSummaryProps,
IAccordionDetailsProps,
|
<mask> Accordion,
<mask> IAccordionProps,
<mask> AccordionItem,
<mask> IAccordionItemProps,
<mask> AccordionButton,
<mask> IAccordionButtonProps,
<mask> AccordionPanel,
<mask> IAccordionPanelProps,
<mask> AccordionIcon,
<mask> IAccordionIconProps,
<mask> IAccordionContextProps,
<mask> IAccordionItemContextProps,
<mask> Skeleton,
<mask> ISkeletonProps,
</s> fix: reduced accordion exports and api changes </s> remove IAccordionButtonProps,
IAccordionPanelProps,
</s> add IAccordionSummaryProps,
IAccordionDetailsProps, </s> remove IAccordionPanelProps,
IAccordionButtonProps,
</s> add IAccordionDetailsProps,
IAccordionSummaryProps, </s> remove AccordionItem,
</s> add </s> remove IAccordionButtonProps,
IAccordionPanelProps,
</s> add IAccordionSummaryProps,
IAccordionDetailsProps, </s> remove export {
Accordion,
AccordionItem,
AccordionButton,
AccordionPanel,
AccordionIcon,
} from './Accordion';
</s> add export { Accordion } from './Accordion';
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/index.tsx
|
<mask> Divider,
<mask> Link,
<mask> Progress,
<mask> Accordion,
<mask> AccordionItem,
<mask> AccordionButton,
<mask> AccordionPanel,
<mask> AccordionIcon,
<mask> Skeleton,
<mask> SkeletonCircle,
<mask> SkeletonText,
<mask> FormControl,
<mask> FormLabel,
</s> fix: reduced accordion exports and api changes </s> remove AccordionButton,
IAccordionButtonProps,
AccordionPanel,
IAccordionPanelProps,
AccordionIcon,
</s> add IAccordionSummaryProps,
IAccordionDetailsProps, </s> remove AccordionItem,
</s> add </s> remove AccordionButton,
AccordionPanel,
</s> add AccordionSummary,
AccordionDetails, </s> remove import {
Accordion,
AccordionItem,
AccordionButton,
AccordionPanel,
AccordionIcon,
Box,
} from 'native-base';
</s> add import { Accordion, Box } from 'native-base'; </s> remove import {
Accordion,
AccordionItem,
AccordionButton,
AccordionPanel,
AccordionIcon,
Box,
} from 'native-base';
</s> add import { Accordion, Box } from 'native-base';
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/index.tsx
|
|
IAccordionSummaryProps,
IAccordionDetailsProps,
|
<mask> IDividerProps,
<mask> ILinkProps,
<mask> IAccordionProps,
<mask> IAccordionItemProps,
<mask> IAccordionButtonProps,
<mask> IAccordionPanelProps,
<mask> IAccordionIconProps,
<mask> IAccordionContextProps,
<mask> IAccordionItemContextProps,
<mask> ISkeletonProps,
<mask> ISkeletonCircleProps,
</s> fix: reduced accordion exports and api changes </s> remove AccordionButton,
IAccordionButtonProps,
AccordionPanel,
IAccordionPanelProps,
AccordionIcon,
</s> add IAccordionSummaryProps,
IAccordionDetailsProps, </s> remove IAccordionPanelProps,
IAccordionButtonProps,
</s> add IAccordionDetailsProps,
IAccordionSummaryProps, </s> remove IAccordionButtonProps,
IAccordionPanelProps,
</s> add IAccordionSummaryProps,
IAccordionDetailsProps, </s> remove export {
Accordion,
AccordionItem,
AccordionButton,
AccordionPanel,
AccordionIcon,
} from './Accordion';
</s> add export { Accordion } from './Accordion'; </s> remove AccordionItem,
</s> add
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/index.tsx
|
// AccordionSummary
|
<mask>
<mask> // AccordionIcon
<mask> export const AccordionIcon = {};
<mask>
<mask> // AccordionButton
<mask> const accordionButtonBaseStyle = (props: Record<string, any>) => {
<mask> return {
<mask> borderWidth: 1,
<mask> borderColor: 'transparent',
<mask> borderTopColor: mode('gray.800', 'gray.50')(props),
</s> fix: reduced accordion exports and api changes </s> remove // AccordionPanel
</s> add // AccordionDetails </s> remove export const AccordionButton = {
</s> add export const AccordionSummary = { </s> remove export const AccordionPanel = {
</s> add export const AccordionDetails = { </s> remove export type IAccordionPanelProps = IBoxProps & {};
</s> add export type IAccordionDetailsProps = IBoxProps & {};
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/theme/components/accordion.ts
|
export const AccordionSummary = {
|
<mask> bg: mode('gray.200', 'gray.700')(props),
<mask> },
<mask> };
<mask> };
<mask> export const AccordionButton = {
<mask> baseStyle: accordionButtonBaseStyle,
<mask> };
<mask>
<mask> // AccordionPanel
<mask> const accordionPanelBaseStyle = {
</s> fix: reduced accordion exports and api changes </s> remove // AccordionPanel
</s> add // AccordionDetails </s> remove export const AccordionPanel = {
</s> add export const AccordionDetails = { </s> remove // AccordionButton
</s> add // AccordionSummary </s> remove export type IAccordionPanelProps = IBoxProps & {};
</s> add export type IAccordionDetailsProps = IBoxProps & {};
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/theme/components/accordion.ts
|
// AccordionDetails
|
<mask> export const AccordionButton = {
<mask> baseStyle: accordionButtonBaseStyle,
<mask> };
<mask>
<mask> // AccordionPanel
<mask> const accordionPanelBaseStyle = {
<mask> p: 3,
<mask> };
<mask>
<mask> export const AccordionPanel = {
</s> fix: reduced accordion exports and api changes </s> remove export const AccordionButton = {
</s> add export const AccordionSummary = { </s> remove export const AccordionPanel = {
</s> add export const AccordionDetails = { </s> remove // AccordionButton
</s> add // AccordionSummary </s> remove export type IAccordionPanelProps = IBoxProps & {};
</s> add export type IAccordionDetailsProps = IBoxProps & {}; </s> remove export default React.memo(Accordion);
</s> add Accordion.AccordionItem = AccordionItem;
Accordion.AccordionSummary = AccordionSummary;
Accordion.AccordionDetails = AccordionDetails;
Accordion.AccordionIcon = AccordionIcon;
export default Accordion;
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/theme/components/accordion.ts
|
export const AccordionDetails = {
|
<mask> const accordionPanelBaseStyle = {
<mask> p: 3,
<mask> };
<mask>
<mask> export const AccordionPanel = {
<mask> baseStyle: accordionPanelBaseStyle,
<mask> };
</s> fix: reduced accordion exports and api changes </s> remove // AccordionPanel
</s> add // AccordionDetails </s> remove export const AccordionButton = {
</s> add export const AccordionSummary = { </s> remove // AccordionButton
</s> add // AccordionSummary </s> remove export type IAccordionPanelProps = IBoxProps & {};
</s> add export type IAccordionDetailsProps = IBoxProps & {};
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/theme/components/accordion.ts
|
AccordionSummary,
AccordionDetails,
|
<mask> import {
<mask> Accordion,
<mask> AccordionItem,
<mask> AccordionIcon,
<mask> AccordionButton,
<mask> AccordionPanel,
<mask> } from './accordion';
<mask> import { Alert, AlertDescription, AlertTitle } from './alert';
<mask> import Avatar from './avatar';
<mask> import AvatarBadge from './avatar-badge';
<mask> import Badge from './badge';
</s> fix: reduced accordion exports and api changes </s> remove import {
Accordion,
AccordionItem,
AccordionButton,
AccordionPanel,
AccordionIcon,
Box,
} from 'native-base';
</s> add import { Accordion, Box } from 'native-base'; </s> remove import {
Accordion,
AccordionItem,
AccordionButton,
AccordionPanel,
AccordionIcon,
Box,
} from 'native-base';
</s> add import { Accordion, Box } from 'native-base'; </s> remove import {
Accordion,
AccordionItem,
AccordionButton,
AccordionPanel,
AccordionIcon,
Box,
} from 'native-base';
</s> add import { Accordion, Box } from 'native-base'; </s> remove import {
Accordion,
AccordionItem,
AccordionButton,
AccordionPanel,
AccordionIcon,
Box,
} from 'native-base';
</s> add import { Accordion, Box } from 'native-base'; </s> remove import {
Accordion,
AccordionItem,
AccordionButton,
AccordionPanel,
AccordionIcon,
Box,
} from 'native-base';
</s> add import { Accordion, Box } from 'native-base';
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/theme/components/index.ts
|
AccordionSummary,
AccordionDetails,
|
<mask> export default {
<mask> Accordion,
<mask> AccordionItem,
<mask> AccordionIcon,
<mask> AccordionButton,
<mask> AccordionPanel,
<mask> Alert,
<mask> AlertDescription,
<mask> AlertTitle,
<mask> Avatar,
<mask> AvatarBadge,
</s> fix: reduced accordion exports and api changes </s> remove AccordionButton,
AccordionPanel,
</s> add AccordionSummary,
AccordionDetails, </s> remove AccordionItem,
AccordionButton,
AccordionPanel,
AccordionIcon,
</s> add </s> remove import {
Accordion,
AccordionItem,
AccordionButton,
AccordionPanel,
AccordionIcon,
Box,
} from 'native-base';
</s> add import { Accordion, Box } from 'native-base'; </s> remove import {
Accordion,
AccordionItem,
AccordionButton,
AccordionPanel,
AccordionIcon,
Box,
} from 'native-base';
</s> add import { Accordion, Box } from 'native-base'; </s> remove AccordionButton,
IAccordionButtonProps,
AccordionPanel,
IAccordionPanelProps,
AccordionIcon,
</s> add IAccordionSummaryProps,
IAccordionDetailsProps,
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/81a3011d9eec93c05fd72f564e14da49828508df
|
src/theme/components/index.ts
|
Heading,
|
<mask> Spinner,
<mask> Text,
<mask> } from '../../components/primitives';
<mask> import { FormControl, Menu } from '../../components/composites';
<mask> import { Platform } from 'react-native';
<mask> import { extendTheme } from '../../core/extendTheme';
<mask> import { fireEvent } from '@testing-library/react-native';
<mask>
</s> fix: lineheight and letterspacing tests on heading </s> remove <Text letterSpacing="2xl" testID="test">
</s> add <Text letterSpacing="0.1em" testID="test"> </s> remove let letterSpacing = Math.round(text.props.style.letterSpacing * 10) / 10;
expect(letterSpacing).toBe(1.2);
</s> add expect(text.props.style.letterSpacing).toBe(24);
});
it('Text: style props test on ios with dark mode', () => {
const newTheme = extendTheme({
config: { initialColorMode: 'dark' },
});
Platform.OS = 'ios';
const { getByTestId } = render(
<Provider theme={newTheme}>
<Box>
<Text
// @ts-ignore
fontSize="12px"
testID="test"
letterSpacing="3em"
_ios={{
_dark: {
fontSize: '15px',
},
}}
>
This is a text
</Text>
</Box>
</Provider>
);
const text = getByTestId('test');
expect(text.props.style.letterSpacing).toBe(45);
});
it('tests absolute em lineHeight in Heading ', () => {
const { getByTestId } = render(
<Provider>
<Heading lineHeight="3em" testID="test">
This is a Heading.
</Heading>
</Provider>
);
const heading = getByTestId('test');
expect(heading.props.style.lineHeight).toBe(9);
});
it('tests relative em lineHeight in Heading ', () => {
const { getByTestId } = render(
<Provider>
{/* @ts-ignore */}
<Heading fontSize="20px" lineHeight="3em" testID="test">
This is a Heading.
</Heading>
</Provider>
);
const heading = getByTestId('test');
expect(heading.props.style.lineHeight).toBe(60);
});
it('tests letterSpacing from token in Heading ', () => {
const { getByTestId } = render(
<Provider>
<Heading letterSpacing="2em" testID="test">
This is a Heading.
</Heading>
</Provider>
);
const heading = getByTestId('test');
expect(heading.props.style.letterSpacing).toBe(6);
});
it('tests letterSpacing from token in Heading ', () => {
const { getByTestId } = render(
<Provider>
{/* @ts-ignore */}
<Heading fontSize="12px" letterSpacing="1em" testID="test">
This is a Heading.
</Heading>
</Provider>
);
const heading = getByTestId('test');
expect(heading.props.style.letterSpacing).toBe(12);
});
it('tests letterSpacing from token in Heading ', () => {
const newTheme = extendTheme({
config: { initialColorMode: 'dark' },
});
const { getByTestId } = render(
<Provider theme={newTheme}>
{/* @ts-ignore */}
<Heading
letterSpacing="1em"
testID="test"
//@ts-ignore
fontSize="12px"
_dark={{
fontSize: '6px',
}}
>
This is a Heading.
</Heading>
</Provider>
);
const heading = getByTestId('test');
expect(heading.props.style.letterSpacing).toBe(6); </s> remove <Text fontSize="12px" letterSpacing="2xl" testID="test">
</s> add <Text fontSize="12px" letterSpacing="2em" testID="test">
|
[
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/828ca4541b9b454992da254ceab7f25f07cbd055
|
src/hooks/useThemeProps/usePropsResolution.test.tsx
|
<Text letterSpacing="0.1em" testID="test">
|
<mask> it('tests letterSpacing from token in text ', () => {
<mask> const { getByTestId } = render(
<mask> <Provider>
<mask> <Box>
<mask> <Text letterSpacing="2xl" testID="test">
<mask> This is a text
<mask> </Text>
<mask> </Box>
<mask> </Provider>
<mask> );
</s> fix: lineheight and letterspacing tests on heading </s> remove <Text fontSize="12px" letterSpacing="2xl" testID="test">
</s> add <Text fontSize="12px" letterSpacing="2em" testID="test"> </s> remove let letterSpacing = Math.round(text.props.style.letterSpacing * 10) / 10;
expect(letterSpacing).toBe(1.2);
</s> add expect(text.props.style.letterSpacing).toBe(24);
});
it('Text: style props test on ios with dark mode', () => {
const newTheme = extendTheme({
config: { initialColorMode: 'dark' },
});
Platform.OS = 'ios';
const { getByTestId } = render(
<Provider theme={newTheme}>
<Box>
<Text
// @ts-ignore
fontSize="12px"
testID="test"
letterSpacing="3em"
_ios={{
_dark: {
fontSize: '15px',
},
}}
>
This is a text
</Text>
</Box>
</Provider>
);
const text = getByTestId('test');
expect(text.props.style.letterSpacing).toBe(45);
});
it('tests absolute em lineHeight in Heading ', () => {
const { getByTestId } = render(
<Provider>
<Heading lineHeight="3em" testID="test">
This is a Heading.
</Heading>
</Provider>
);
const heading = getByTestId('test');
expect(heading.props.style.lineHeight).toBe(9);
});
it('tests relative em lineHeight in Heading ', () => {
const { getByTestId } = render(
<Provider>
{/* @ts-ignore */}
<Heading fontSize="20px" lineHeight="3em" testID="test">
This is a Heading.
</Heading>
</Provider>
);
const heading = getByTestId('test');
expect(heading.props.style.lineHeight).toBe(60);
});
it('tests letterSpacing from token in Heading ', () => {
const { getByTestId } = render(
<Provider>
<Heading letterSpacing="2em" testID="test">
This is a Heading.
</Heading>
</Provider>
);
const heading = getByTestId('test');
expect(heading.props.style.letterSpacing).toBe(6);
});
it('tests letterSpacing from token in Heading ', () => {
const { getByTestId } = render(
<Provider>
{/* @ts-ignore */}
<Heading fontSize="12px" letterSpacing="1em" testID="test">
This is a Heading.
</Heading>
</Provider>
);
const heading = getByTestId('test');
expect(heading.props.style.letterSpacing).toBe(12);
});
it('tests letterSpacing from token in Heading ', () => {
const newTheme = extendTheme({
config: { initialColorMode: 'dark' },
});
const { getByTestId } = render(
<Provider theme={newTheme}>
{/* @ts-ignore */}
<Heading
letterSpacing="1em"
testID="test"
//@ts-ignore
fontSize="12px"
_dark={{
fontSize: '6px',
}}
>
This is a Heading.
</Heading>
</Provider>
);
const heading = getByTestId('test');
expect(heading.props.style.letterSpacing).toBe(6);
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/828ca4541b9b454992da254ceab7f25f07cbd055
|
src/hooks/useThemeProps/usePropsResolution.test.tsx
|
<Text fontSize="12px" letterSpacing="2em" testID="test">
|
<mask> const { getByTestId } = render(
<mask> <Provider>
<mask> <Box>
<mask> {/* @ts-ignore */}
<mask> <Text fontSize="12px" letterSpacing="2xl" testID="test">
<mask> This is a text
<mask> </Text>
<mask> </Box>
<mask> </Provider>
<mask> );
</s> fix: lineheight and letterspacing tests on heading </s> remove <Text letterSpacing="2xl" testID="test">
</s> add <Text letterSpacing="0.1em" testID="test"> </s> remove let letterSpacing = Math.round(text.props.style.letterSpacing * 10) / 10;
expect(letterSpacing).toBe(1.2);
</s> add expect(text.props.style.letterSpacing).toBe(24);
});
it('Text: style props test on ios with dark mode', () => {
const newTheme = extendTheme({
config: { initialColorMode: 'dark' },
});
Platform.OS = 'ios';
const { getByTestId } = render(
<Provider theme={newTheme}>
<Box>
<Text
// @ts-ignore
fontSize="12px"
testID="test"
letterSpacing="3em"
_ios={{
_dark: {
fontSize: '15px',
},
}}
>
This is a text
</Text>
</Box>
</Provider>
);
const text = getByTestId('test');
expect(text.props.style.letterSpacing).toBe(45);
});
it('tests absolute em lineHeight in Heading ', () => {
const { getByTestId } = render(
<Provider>
<Heading lineHeight="3em" testID="test">
This is a Heading.
</Heading>
</Provider>
);
const heading = getByTestId('test');
expect(heading.props.style.lineHeight).toBe(9);
});
it('tests relative em lineHeight in Heading ', () => {
const { getByTestId } = render(
<Provider>
{/* @ts-ignore */}
<Heading fontSize="20px" lineHeight="3em" testID="test">
This is a Heading.
</Heading>
</Provider>
);
const heading = getByTestId('test');
expect(heading.props.style.lineHeight).toBe(60);
});
it('tests letterSpacing from token in Heading ', () => {
const { getByTestId } = render(
<Provider>
<Heading letterSpacing="2em" testID="test">
This is a Heading.
</Heading>
</Provider>
);
const heading = getByTestId('test');
expect(heading.props.style.letterSpacing).toBe(6);
});
it('tests letterSpacing from token in Heading ', () => {
const { getByTestId } = render(
<Provider>
{/* @ts-ignore */}
<Heading fontSize="12px" letterSpacing="1em" testID="test">
This is a Heading.
</Heading>
</Provider>
);
const heading = getByTestId('test');
expect(heading.props.style.letterSpacing).toBe(12);
});
it('tests letterSpacing from token in Heading ', () => {
const newTheme = extendTheme({
config: { initialColorMode: 'dark' },
});
const { getByTestId } = render(
<Provider theme={newTheme}>
{/* @ts-ignore */}
<Heading
letterSpacing="1em"
testID="test"
//@ts-ignore
fontSize="12px"
_dark={{
fontSize: '6px',
}}
>
This is a Heading.
</Heading>
</Provider>
);
const heading = getByTestId('test');
expect(heading.props.style.letterSpacing).toBe(6);
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/828ca4541b9b454992da254ceab7f25f07cbd055
|
src/hooks/useThemeProps/usePropsResolution.test.tsx
|
expect(text.props.style.letterSpacing).toBe(24);
});
it('Text: style props test on ios with dark mode', () => {
const newTheme = extendTheme({
config: { initialColorMode: 'dark' },
});
Platform.OS = 'ios';
const { getByTestId } = render(
<Provider theme={newTheme}>
<Box>
<Text
// @ts-ignore
fontSize="12px"
testID="test"
letterSpacing="3em"
_ios={{
_dark: {
fontSize: '15px',
},
}}
>
This is a text
</Text>
</Box>
</Provider>
);
const text = getByTestId('test');
expect(text.props.style.letterSpacing).toBe(45);
});
it('tests absolute em lineHeight in Heading ', () => {
const { getByTestId } = render(
<Provider>
<Heading lineHeight="3em" testID="test">
This is a Heading.
</Heading>
</Provider>
);
const heading = getByTestId('test');
expect(heading.props.style.lineHeight).toBe(9);
});
it('tests relative em lineHeight in Heading ', () => {
const { getByTestId } = render(
<Provider>
{/* @ts-ignore */}
<Heading fontSize="20px" lineHeight="3em" testID="test">
This is a Heading.
</Heading>
</Provider>
);
const heading = getByTestId('test');
expect(heading.props.style.lineHeight).toBe(60);
});
it('tests letterSpacing from token in Heading ', () => {
const { getByTestId } = render(
<Provider>
<Heading letterSpacing="2em" testID="test">
This is a Heading.
</Heading>
</Provider>
);
const heading = getByTestId('test');
expect(heading.props.style.letterSpacing).toBe(6);
});
it('tests letterSpacing from token in Heading ', () => {
const { getByTestId } = render(
<Provider>
{/* @ts-ignore */}
<Heading fontSize="12px" letterSpacing="1em" testID="test">
This is a Heading.
</Heading>
</Provider>
);
const heading = getByTestId('test');
expect(heading.props.style.letterSpacing).toBe(12);
});
it('tests letterSpacing from token in Heading ', () => {
const newTheme = extendTheme({
config: { initialColorMode: 'dark' },
});
const { getByTestId } = render(
<Provider theme={newTheme}>
{/* @ts-ignore */}
<Heading
letterSpacing="1em"
testID="test"
//@ts-ignore
fontSize="12px"
_dark={{
fontSize: '6px',
}}
>
This is a Heading.
</Heading>
</Provider>
);
const heading = getByTestId('test');
expect(heading.props.style.letterSpacing).toBe(6);
|
<mask> </Box>
<mask> </Provider>
<mask> );
<mask> const text = getByTestId('test');
<mask> let letterSpacing = Math.round(text.props.style.letterSpacing * 10) / 10;
<mask> expect(letterSpacing).toBe(1.2);
<mask> });
<mask> });
</s> fix: lineheight and letterspacing tests on heading </s> remove <Text letterSpacing="2xl" testID="test">
</s> add <Text letterSpacing="0.1em" testID="test"> </s> remove <Text fontSize="12px" letterSpacing="2xl" testID="test">
</s> add <Text fontSize="12px" letterSpacing="2em" testID="test">
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/828ca4541b9b454992da254ceab7f25f07cbd055
|
src/hooks/useThemeProps/usePropsResolution.test.tsx
|
constructor(props) {
super(props);
this.state = {
text: "",
topAnim: new Animated.Value(18),
opacAnim: new Animated.Value(1)
};
}
componentDidMount() {
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
}
componentWillReceiveProps(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type.displayName === "Styled(Input)") {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
}
|
<mask> import mapPropsToStyleNames from "../Utils/mapPropsToStyleNames";
<mask> import _ from "lodash";
<mask>
<mask> class Item extends Component {
<mask> constructor(props) {
<mask> super(props);
<mask> this.state = {
<mask> text: "",
<mask> topAnim: new Animated.Value(18),
<mask> opacAnim: new Animated.Value(1),
<mask> };
<mask> }
<mask> componentDidMount() {
<mask> if (this.props.floatingLabel) {
<mask> if (this.inputProps && this.inputProps.value) {
<mask> this.setState({ isFocused: true });
<mask> this.floatUp(-16);
<mask> }
<mask> if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
<mask> }
<mask> }
<mask> componentWillReceiveProps(nextProps) {
<mask> const childrenArray = React.Children.toArray(nextProps.children);
<mask> let inputProps = {};
<mask> input = _.remove(childrenArray, item => {
<mask> if (item.type.displayName === "Styled(Input)") {
<mask> inputProps = item.props;
<mask> this.inputProps = item.props;
<mask> return item;
<mask> }
<mask> });
<mask> if (this.props.floatingLabel) {
<mask> if (this.inputProps && this.inputProps.value) {
<mask> this.setState({ isFocused: true });
<mask> this.floatUp(-16);
<mask> }
<mask> if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
<mask> }
<mask> }
<mask>
<mask> floatBack() {
<mask> Animated.timing(this.state.topAnim, {
<mask> toValue: 18,
<mask> duration: 150,
</s> floating and stacked label with icons </s> remove floatBack() {
Animated.timing(this.state.topAnim, {
toValue: 18,
duration: 150,
}).start();
Animated.timing(this.state.opacAnim, {
toValue: 1,
duration: 150,
}).start();
}
</s> add floatBack() {
Animated.timing(this.state.topAnim, {
toValue: 18,
duration: 150
}).start();
Animated.timing(this.state.opacAnim, {
toValue: 1,
duration: 150
}).start();
} </s> remove let icon = [];
let iconProps = {};
icon = _.remove(childrenArray, item => {
if (item.type === Icon) {
iconProps = item.props;
return item;
}
});
if (this.props.floatingLabel && icon.length) {
newChildren.push(<Icon key="i1" {...iconProps} />);
newChildren.push(
<Animated.View
key="float"
style={{
position: "absolute",
left: this.props.last ? 22 : 22,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop: Platform.OS === "ios" ? undefined : undefined,
paddingBottom: Platform.OS === "ios" ? undefined : 12,
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
);
newChildren.push(
<Input
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true,
})
: !this.state.text.length && this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText && inputProps.onChangeText(text);
}}
/>
);
} else if (this.props.floatingLabel) {
newChildren.push(
<Animated.View
key="float"
style={{
position: "absolute",
left: this.props.last ? 15 : 0,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop: Platform.OS === "ios" ? undefined : undefined,
paddingBottom: Platform.OS === "ios" ? undefined : 12,
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
);
newChildren.push(
<Input
ref={c => (this._inputRef = c)}
value={this.state.text}
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true,
})
: !this.state.text.length && this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText && inputProps.onChangeText(text);
}}
/>
);
} else if (this.props.stackedLabel && icon.length) {
newChildren.push(
<View
key="s"
style={{
flexDirection: "row",
flex: 1,
width: variables.deviceWidth - 15,
}}
>
<Icon key="s1" {...iconProps} />
<View style={{ flexDirection: "column" }}>
<Label key="s2" {...labelProps} />
<Input key="s3" {...inputProps} style={{ width: variables.deviceWidth - 40 }} />
</View>
</View>
);
} else {
return this.props.children;
}
return newChildren;
}
getInitialStyle() {
return {
roundedInputGroup: {
borderWidth: this.props.rounded ? variables.borderWidth * 2 : undefined,
borderRadius: this.props.rounded ? variables.inputGroupRoundedBorderRadius : undefined,
},
};
}
</s> add // console.log("label childrenArray", label); </s> remove return computeProps(this.props, defaultProps);
}
render() {
return (
<TouchableOpacity ref={c => (this._root = c)} {...this.prepareRootProps()} activeOpacity={1}>
{this.renderChildren()}
</TouchableOpacity>
);
}
</s> add let icon = [];
let iconProps = {};
icon = _.remove(childrenArray, item => {
if (item.type === Icon) {
iconProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
newChildren.push(
<View key="v1" style={{ flexDirection: "row" }}>
{_.remove(left, item => {
return item;
})}
</View>
);
/*newChildren.push(
<Animated.View
key="float"
style={{
flexGrow: 1,
position: "absolute",
left: this.props.last ? 15 : 0,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop:
Platform.OS === "ios" ? undefined : undefined,
paddingBottom: Platform.OS === "ios" ? undefined : 12
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
);*/
newChildren.push(
<View key="pa1" style={{ flex: 1 }}>
<Animated.View
key="float"
style={{
flex: 1,
position: "absolute",
left: this.props.last ? 15 : 0,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop:
Platform.OS === "ios" ? undefined : undefined,
paddingBottom:
Platform.OS === "ios" ? undefined : 12
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
<Input
ref={c => (this._inputRef = c)}
value={this.state.text}
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true
})
: !this.state.text.length &&
this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText &&
inputProps.onChangeText(text);
}}
/>
</View>
);
/*newChildren.push(
<Input
ref={c => (this._inputRef = c)}
value={this.state.text}
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true
})
: !this.state.text.length &&
this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText &&
inputProps.onChangeText(text);
}}
/>
);*/
newChildren.push(
<View key="v2" style={{ flexDirection: "row" }}>
{_.remove(right, item => {
return item;
})}
</View>
);
} else if (this.props.stackedLabel && icon.length) {
newChildren.push(
<View
key="s"
style={{
flexDirection: "row",
flex: 1,
width: variables.deviceWidth - 15
}}
>
<View key="v3" style={{ flexDirection: "row" }}>
{_.remove(left, item => {
return item;
})}
</View>
<View style={{ flex: 1, flexDirection: "column" }}>
<Label key="s2" {...labelProps} />
<Input key="s3" {...inputProps} />
</View>
<View key="v4" style={{ flexDirection: "row" }}>
{_.remove(right, item => {
return item;
})}
</View>
</View>
);
} else {
return this.props.children;
}
return newChildren;
}
getInitialStyle() {
return {
roundedInputGroup: {
borderWidth: this.props.rounded
? variables.borderWidth * 2
: undefined,
borderRadius: this.props.rounded
? variables.inputGroupRoundedBorderRadius
: undefined
}
};
}
prepareRootProps() {
const defaultProps = {
style: this.getInitialStyle().roundedInputGroup
};
return computeProps(this.props, defaultProps);
}
render() {
return (
<TouchableOpacity
ref={c => (this._root = c)}
{...this.prepareRootProps()}
activeOpacity={1}
>
{this.renderChildren()}
</TouchableOpacity>
);
} </s> remove prepareRootProps() {
const defaultProps = {
style: this.getInitialStyle().roundedInputGroup,
};
</s> add let input = [];
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type === Input) {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
}); </s> remove let input = [];
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type === Input) {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
</s> add i += 2;
for (j = i, k = 0; j < childrenArray.length; j++, k++) {
right[k] = childrenArray[j];
}
// console.log("left", left);
// console.log("right", right);
let label = [];
let labelProps = {};
label = _.remove(childrenArray, item => {
if (item.type === Label) {
labelProps = item.props;
return item;
}
});
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/8368ee0627076abfc66e08706bfc3274257ea849
|
src/basic/Item.js
|
floatBack() {
Animated.timing(this.state.topAnim, {
toValue: 18,
duration: 150
}).start();
Animated.timing(this.state.opacAnim, {
toValue: 1,
duration: 150
}).start();
}
|
<mask> if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
<mask> }
<mask> }
<mask>
<mask> floatBack() {
<mask> Animated.timing(this.state.topAnim, {
<mask> toValue: 18,
<mask> duration: 150,
<mask> }).start();
<mask> Animated.timing(this.state.opacAnim, {
<mask> toValue: 1,
<mask> duration: 150,
<mask> }).start();
<mask> }
<mask>
<mask> floatUp(e) {
<mask> Animated.timing(this.state.topAnim, {
<mask> toValue: e || -22,
<mask> duration: 150,
</s> floating and stacked label with icons </s> remove floatUp(e) {
Animated.timing(this.state.topAnim, {
toValue: e || -22,
duration: 150,
}).start();
Animated.timing(this.state.opacAnim, {
toValue: 0.7,
duration: 150,
}).start();
}
</s> add floatUp(e) {
Animated.timing(this.state.topAnim, {
toValue: e || -22,
duration: 150
}).start();
Animated.timing(this.state.opacAnim, {
toValue: 0.7,
duration: 150
}).start();
} </s> remove constructor(props) {
super(props);
this.state = {
text: "",
topAnim: new Animated.Value(18),
opacAnim: new Animated.Value(1),
};
}
componentDidMount() {
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
}
}
componentWillReceiveProps(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type.displayName === "Styled(Input)") {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
}
}
</s> add constructor(props) {
super(props);
this.state = {
text: "",
topAnim: new Animated.Value(18),
opacAnim: new Animated.Value(1)
};
}
componentDidMount() {
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
}
componentWillReceiveProps(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type.displayName === "Styled(Input)") {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
} </s> remove renderLabel(label, labelProps) {
const newLabel = [];
if (this.props.floatingLabel) {
if (this.state.isFocused) {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newFLabel",
float: true,
style: {
fontSize: 15,
lineHeight: 30,
...labelProps.style,
},
})
);
this.floatUp();
} else {
newLabel.push(label);
this.floatBack();
}
} else {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newLabel",
})
);
}
return newLabel;
}
</s> add renderLabel(label, labelProps) {
const newLabel = [];
if (this.props.floatingLabel) {
if (this.state.isFocused) {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newFLabel",
float: true,
style: {
fontSize: 15,
lineHeight: 30,
...labelProps.style
}
})
);
this.floatUp();
} else {
newLabel.push(label);
this.floatBack();
}
} else {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newLabel"
})
);
}
return newLabel;
} </s> remove return computeProps(this.props, defaultProps);
}
render() {
return (
<TouchableOpacity ref={c => (this._root = c)} {...this.prepareRootProps()} activeOpacity={1}>
{this.renderChildren()}
</TouchableOpacity>
);
}
</s> add let icon = [];
let iconProps = {};
icon = _.remove(childrenArray, item => {
if (item.type === Icon) {
iconProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
newChildren.push(
<View key="v1" style={{ flexDirection: "row" }}>
{_.remove(left, item => {
return item;
})}
</View>
);
/*newChildren.push(
<Animated.View
key="float"
style={{
flexGrow: 1,
position: "absolute",
left: this.props.last ? 15 : 0,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop:
Platform.OS === "ios" ? undefined : undefined,
paddingBottom: Platform.OS === "ios" ? undefined : 12
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
);*/
newChildren.push(
<View key="pa1" style={{ flex: 1 }}>
<Animated.View
key="float"
style={{
flex: 1,
position: "absolute",
left: this.props.last ? 15 : 0,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop:
Platform.OS === "ios" ? undefined : undefined,
paddingBottom:
Platform.OS === "ios" ? undefined : 12
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
<Input
ref={c => (this._inputRef = c)}
value={this.state.text}
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true
})
: !this.state.text.length &&
this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText &&
inputProps.onChangeText(text);
}}
/>
</View>
);
/*newChildren.push(
<Input
ref={c => (this._inputRef = c)}
value={this.state.text}
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true
})
: !this.state.text.length &&
this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText &&
inputProps.onChangeText(text);
}}
/>
);*/
newChildren.push(
<View key="v2" style={{ flexDirection: "row" }}>
{_.remove(right, item => {
return item;
})}
</View>
);
} else if (this.props.stackedLabel && icon.length) {
newChildren.push(
<View
key="s"
style={{
flexDirection: "row",
flex: 1,
width: variables.deviceWidth - 15
}}
>
<View key="v3" style={{ flexDirection: "row" }}>
{_.remove(left, item => {
return item;
})}
</View>
<View style={{ flex: 1, flexDirection: "column" }}>
<Label key="s2" {...labelProps} />
<Input key="s3" {...inputProps} />
</View>
<View key="v4" style={{ flexDirection: "row" }}>
{_.remove(right, item => {
return item;
})}
</View>
</View>
);
} else {
return this.props.children;
}
return newChildren;
}
getInitialStyle() {
return {
roundedInputGroup: {
borderWidth: this.props.rounded
? variables.borderWidth * 2
: undefined,
borderRadius: this.props.rounded
? variables.inputGroupRoundedBorderRadius
: undefined
}
};
}
prepareRootProps() {
const defaultProps = {
style: this.getInitialStyle().roundedInputGroup
};
return computeProps(this.props, defaultProps);
}
render() {
return (
<TouchableOpacity
ref={c => (this._root = c)}
{...this.prepareRootProps()}
activeOpacity={1}
>
{this.renderChildren()}
</TouchableOpacity>
);
} </s> remove let icon = [];
let iconProps = {};
icon = _.remove(childrenArray, item => {
if (item.type === Icon) {
iconProps = item.props;
return item;
}
});
if (this.props.floatingLabel && icon.length) {
newChildren.push(<Icon key="i1" {...iconProps} />);
newChildren.push(
<Animated.View
key="float"
style={{
position: "absolute",
left: this.props.last ? 22 : 22,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop: Platform.OS === "ios" ? undefined : undefined,
paddingBottom: Platform.OS === "ios" ? undefined : 12,
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
);
newChildren.push(
<Input
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true,
})
: !this.state.text.length && this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText && inputProps.onChangeText(text);
}}
/>
);
} else if (this.props.floatingLabel) {
newChildren.push(
<Animated.View
key="float"
style={{
position: "absolute",
left: this.props.last ? 15 : 0,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop: Platform.OS === "ios" ? undefined : undefined,
paddingBottom: Platform.OS === "ios" ? undefined : 12,
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
);
newChildren.push(
<Input
ref={c => (this._inputRef = c)}
value={this.state.text}
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true,
})
: !this.state.text.length && this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText && inputProps.onChangeText(text);
}}
/>
);
} else if (this.props.stackedLabel && icon.length) {
newChildren.push(
<View
key="s"
style={{
flexDirection: "row",
flex: 1,
width: variables.deviceWidth - 15,
}}
>
<Icon key="s1" {...iconProps} />
<View style={{ flexDirection: "column" }}>
<Label key="s2" {...labelProps} />
<Input key="s3" {...inputProps} style={{ width: variables.deviceWidth - 40 }} />
</View>
</View>
);
} else {
return this.props.children;
}
return newChildren;
}
getInitialStyle() {
return {
roundedInputGroup: {
borderWidth: this.props.rounded ? variables.borderWidth * 2 : undefined,
borderRadius: this.props.rounded ? variables.inputGroupRoundedBorderRadius : undefined,
},
};
}
</s> add // console.log("label childrenArray", label);
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/8368ee0627076abfc66e08706bfc3274257ea849
|
src/basic/Item.js
|
floatUp(e) {
Animated.timing(this.state.topAnim, {
toValue: e || -22,
duration: 150
}).start();
Animated.timing(this.state.opacAnim, {
toValue: 0.7,
duration: 150
}).start();
}
|
<mask> duration: 150,
<mask> }).start();
<mask> }
<mask>
<mask> floatUp(e) {
<mask> Animated.timing(this.state.topAnim, {
<mask> toValue: e || -22,
<mask> duration: 150,
<mask> }).start();
<mask> Animated.timing(this.state.opacAnim, {
<mask> toValue: 0.7,
<mask> duration: 150,
<mask> }).start();
<mask> }
<mask>
<mask> renderLabel(label, labelProps) {
<mask> const newLabel = [];
<mask> if (this.props.floatingLabel) {
<mask> if (this.state.isFocused) {
</s> floating and stacked label with icons </s> remove floatBack() {
Animated.timing(this.state.topAnim, {
toValue: 18,
duration: 150,
}).start();
Animated.timing(this.state.opacAnim, {
toValue: 1,
duration: 150,
}).start();
}
</s> add floatBack() {
Animated.timing(this.state.topAnim, {
toValue: 18,
duration: 150
}).start();
Animated.timing(this.state.opacAnim, {
toValue: 1,
duration: 150
}).start();
} </s> remove renderLabel(label, labelProps) {
const newLabel = [];
if (this.props.floatingLabel) {
if (this.state.isFocused) {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newFLabel",
float: true,
style: {
fontSize: 15,
lineHeight: 30,
...labelProps.style,
},
})
);
this.floatUp();
} else {
newLabel.push(label);
this.floatBack();
}
} else {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newLabel",
})
);
}
return newLabel;
}
</s> add renderLabel(label, labelProps) {
const newLabel = [];
if (this.props.floatingLabel) {
if (this.state.isFocused) {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newFLabel",
float: true,
style: {
fontSize: 15,
lineHeight: 30,
...labelProps.style
}
})
);
this.floatUp();
} else {
newLabel.push(label);
this.floatBack();
}
} else {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newLabel"
})
);
}
return newLabel;
} </s> remove constructor(props) {
super(props);
this.state = {
text: "",
topAnim: new Animated.Value(18),
opacAnim: new Animated.Value(1),
};
}
componentDidMount() {
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
}
}
componentWillReceiveProps(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type.displayName === "Styled(Input)") {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
}
}
</s> add constructor(props) {
super(props);
this.state = {
text: "",
topAnim: new Animated.Value(18),
opacAnim: new Animated.Value(1)
};
}
componentDidMount() {
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
}
componentWillReceiveProps(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type.displayName === "Styled(Input)") {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
} </s> remove let error;
const prop = props[propName];
if (!props.children.length) {
error = new Error(`${component} should have both Label and Input components`);
} else if (
props.children[0].type.displayName !== "Styled(Label)" ||
props.children[1].type.displayName !== "Styled(Input)"
) {
error = new Error(`${component} should have Label and Input components only`);
}
return error;
</s> add let error;
const prop = props[propName];
if (!props.children.length) {
error = new Error(
`${component} should have both Label and Input components`
);
} else if (
props.children[0].type.displayName !== "Styled(Label)" ||
props.children[1].type.displayName !== "Styled(Input)"
) {
error = new Error(
`${component} should have Label and Input components only`
);
}
return error; </s> remove let label = [];
let labelProps = {};
label = _.remove(childrenArray, item => {
if (item.type === Label) {
labelProps = item.props;
return item;
}
});
</s> add let i = 0;
for (i = 0; childrenArray[i].type !== Label; i++) {
left[i] = childrenArray[i];
}
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/8368ee0627076abfc66e08706bfc3274257ea849
|
src/basic/Item.js
|
renderLabel(label, labelProps) {
const newLabel = [];
if (this.props.floatingLabel) {
if (this.state.isFocused) {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newFLabel",
float: true,
style: {
fontSize: 15,
lineHeight: 30,
...labelProps.style
}
})
);
this.floatUp();
} else {
newLabel.push(label);
this.floatBack();
}
} else {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newLabel"
})
);
}
return newLabel;
}
|
<mask> duration: 150,
<mask> }).start();
<mask> }
<mask>
<mask> renderLabel(label, labelProps) {
<mask> const newLabel = [];
<mask> if (this.props.floatingLabel) {
<mask> if (this.state.isFocused) {
<mask> newLabel.push(
<mask> React.createElement(Label, {
<mask> ...labelProps,
<mask> key: "newFLabel",
<mask> float: true,
<mask> style: {
<mask> fontSize: 15,
<mask> lineHeight: 30,
<mask> ...labelProps.style,
<mask> },
<mask> })
<mask> );
<mask> this.floatUp();
<mask> } else {
<mask> newLabel.push(label);
<mask> this.floatBack();
<mask> }
<mask> } else {
<mask> newLabel.push(
<mask> React.createElement(Label, {
<mask> ...labelProps,
<mask> key: "newLabel",
<mask> })
<mask> );
<mask> }
<mask> return newLabel;
<mask> }
<mask>
<mask> renderChildren() {
<mask> const newChildren = [];
<mask> const childrenArray = React.Children.toArray(this.props.children);
<mask>
</s> floating and stacked label with icons </s> remove floatUp(e) {
Animated.timing(this.state.topAnim, {
toValue: e || -22,
duration: 150,
}).start();
Animated.timing(this.state.opacAnim, {
toValue: 0.7,
duration: 150,
}).start();
}
</s> add floatUp(e) {
Animated.timing(this.state.topAnim, {
toValue: e || -22,
duration: 150
}).start();
Animated.timing(this.state.opacAnim, {
toValue: 0.7,
duration: 150
}).start();
} </s> remove renderChildren() {
const newChildren = [];
const childrenArray = React.Children.toArray(this.props.children);
</s> add renderChildren() {
const newChildren = [];
let left = [];
let right = [];
const childrenArray = React.Children.toArray(this.props.children);
console.log(
"childrenArray",
React.Children.toArray(this.props.children)
); </s> remove let label = [];
let labelProps = {};
label = _.remove(childrenArray, item => {
if (item.type === Label) {
labelProps = item.props;
return item;
}
});
</s> add let i = 0;
for (i = 0; childrenArray[i].type !== Label; i++) {
left[i] = childrenArray[i];
} </s> remove let icon = [];
let iconProps = {};
icon = _.remove(childrenArray, item => {
if (item.type === Icon) {
iconProps = item.props;
return item;
}
});
if (this.props.floatingLabel && icon.length) {
newChildren.push(<Icon key="i1" {...iconProps} />);
newChildren.push(
<Animated.View
key="float"
style={{
position: "absolute",
left: this.props.last ? 22 : 22,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop: Platform.OS === "ios" ? undefined : undefined,
paddingBottom: Platform.OS === "ios" ? undefined : 12,
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
);
newChildren.push(
<Input
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true,
})
: !this.state.text.length && this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText && inputProps.onChangeText(text);
}}
/>
);
} else if (this.props.floatingLabel) {
newChildren.push(
<Animated.View
key="float"
style={{
position: "absolute",
left: this.props.last ? 15 : 0,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop: Platform.OS === "ios" ? undefined : undefined,
paddingBottom: Platform.OS === "ios" ? undefined : 12,
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
);
newChildren.push(
<Input
ref={c => (this._inputRef = c)}
value={this.state.text}
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true,
})
: !this.state.text.length && this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText && inputProps.onChangeText(text);
}}
/>
);
} else if (this.props.stackedLabel && icon.length) {
newChildren.push(
<View
key="s"
style={{
flexDirection: "row",
flex: 1,
width: variables.deviceWidth - 15,
}}
>
<Icon key="s1" {...iconProps} />
<View style={{ flexDirection: "column" }}>
<Label key="s2" {...labelProps} />
<Input key="s3" {...inputProps} style={{ width: variables.deviceWidth - 40 }} />
</View>
</View>
);
} else {
return this.props.children;
}
return newChildren;
}
getInitialStyle() {
return {
roundedInputGroup: {
borderWidth: this.props.rounded ? variables.borderWidth * 2 : undefined,
borderRadius: this.props.rounded ? variables.inputGroupRoundedBorderRadius : undefined,
},
};
}
</s> add // console.log("label childrenArray", label); </s> remove constructor(props) {
super(props);
this.state = {
text: "",
topAnim: new Animated.Value(18),
opacAnim: new Animated.Value(1),
};
}
componentDidMount() {
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
}
}
componentWillReceiveProps(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type.displayName === "Styled(Input)") {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
}
}
</s> add constructor(props) {
super(props);
this.state = {
text: "",
topAnim: new Animated.Value(18),
opacAnim: new Animated.Value(1)
};
}
componentDidMount() {
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
}
componentWillReceiveProps(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type.displayName === "Styled(Input)") {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
}
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/8368ee0627076abfc66e08706bfc3274257ea849
|
src/basic/Item.js
|
renderChildren() {
const newChildren = [];
let left = [];
let right = [];
const childrenArray = React.Children.toArray(this.props.children);
console.log(
"childrenArray",
React.Children.toArray(this.props.children)
);
|
<mask> }
<mask> return newLabel;
<mask> }
<mask>
<mask> renderChildren() {
<mask> const newChildren = [];
<mask> const childrenArray = React.Children.toArray(this.props.children);
<mask>
<mask> let label = [];
<mask> let labelProps = {};
<mask> label = _.remove(childrenArray, item => {
<mask> if (item.type === Label) {
</s> floating and stacked label with icons </s> remove let label = [];
let labelProps = {};
label = _.remove(childrenArray, item => {
if (item.type === Label) {
labelProps = item.props;
return item;
}
});
</s> add let i = 0;
for (i = 0; childrenArray[i].type !== Label; i++) {
left[i] = childrenArray[i];
} </s> remove let input = [];
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type === Input) {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
</s> add i += 2;
for (j = i, k = 0; j < childrenArray.length; j++, k++) {
right[k] = childrenArray[j];
}
// console.log("left", left);
// console.log("right", right);
let label = [];
let labelProps = {};
label = _.remove(childrenArray, item => {
if (item.type === Label) {
labelProps = item.props;
return item;
}
}); </s> remove renderLabel(label, labelProps) {
const newLabel = [];
if (this.props.floatingLabel) {
if (this.state.isFocused) {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newFLabel",
float: true,
style: {
fontSize: 15,
lineHeight: 30,
...labelProps.style,
},
})
);
this.floatUp();
} else {
newLabel.push(label);
this.floatBack();
}
} else {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newLabel",
})
);
}
return newLabel;
}
</s> add renderLabel(label, labelProps) {
const newLabel = [];
if (this.props.floatingLabel) {
if (this.state.isFocused) {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newFLabel",
float: true,
style: {
fontSize: 15,
lineHeight: 30,
...labelProps.style
}
})
);
this.floatUp();
} else {
newLabel.push(label);
this.floatBack();
}
} else {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newLabel"
})
);
}
return newLabel;
} </s> remove prepareRootProps() {
const defaultProps = {
style: this.getInitialStyle().roundedInputGroup,
};
</s> add let input = [];
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type === Input) {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
}); </s> remove constructor(props) {
super(props);
this.state = {
text: "",
topAnim: new Animated.Value(18),
opacAnim: new Animated.Value(1),
};
}
componentDidMount() {
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
}
}
componentWillReceiveProps(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type.displayName === "Styled(Input)") {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
}
}
</s> add constructor(props) {
super(props);
this.state = {
text: "",
topAnim: new Animated.Value(18),
opacAnim: new Animated.Value(1)
};
}
componentDidMount() {
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
}
componentWillReceiveProps(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type.displayName === "Styled(Input)") {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
}
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/8368ee0627076abfc66e08706bfc3274257ea849
|
src/basic/Item.js
|
let i = 0;
for (i = 0; childrenArray[i].type !== Label; i++) {
left[i] = childrenArray[i];
}
|
<mask> renderChildren() {
<mask> const newChildren = [];
<mask> const childrenArray = React.Children.toArray(this.props.children);
<mask>
<mask> let label = [];
<mask> let labelProps = {};
<mask> label = _.remove(childrenArray, item => {
<mask> if (item.type === Label) {
<mask> labelProps = item.props;
<mask> return item;
<mask> }
<mask> });
<mask>
<mask> let input = [];
<mask> let inputProps = {};
<mask> input = _.remove(childrenArray, item => {
<mask> if (item.type === Input) {
</s> floating and stacked label with icons </s> remove renderChildren() {
const newChildren = [];
const childrenArray = React.Children.toArray(this.props.children);
</s> add renderChildren() {
const newChildren = [];
let left = [];
let right = [];
const childrenArray = React.Children.toArray(this.props.children);
console.log(
"childrenArray",
React.Children.toArray(this.props.children)
); </s> remove let input = [];
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type === Input) {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
</s> add i += 2;
for (j = i, k = 0; j < childrenArray.length; j++, k++) {
right[k] = childrenArray[j];
}
// console.log("left", left);
// console.log("right", right);
let label = [];
let labelProps = {};
label = _.remove(childrenArray, item => {
if (item.type === Label) {
labelProps = item.props;
return item;
}
}); </s> remove prepareRootProps() {
const defaultProps = {
style: this.getInitialStyle().roundedInputGroup,
};
</s> add let input = [];
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type === Input) {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
}); </s> remove constructor(props) {
super(props);
this.state = {
text: "",
topAnim: new Animated.Value(18),
opacAnim: new Animated.Value(1),
};
}
componentDidMount() {
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
}
}
componentWillReceiveProps(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type.displayName === "Styled(Input)") {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
}
}
</s> add constructor(props) {
super(props);
this.state = {
text: "",
topAnim: new Animated.Value(18),
opacAnim: new Animated.Value(1)
};
}
componentDidMount() {
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
}
componentWillReceiveProps(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type.displayName === "Styled(Input)") {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
} </s> remove renderLabel(label, labelProps) {
const newLabel = [];
if (this.props.floatingLabel) {
if (this.state.isFocused) {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newFLabel",
float: true,
style: {
fontSize: 15,
lineHeight: 30,
...labelProps.style,
},
})
);
this.floatUp();
} else {
newLabel.push(label);
this.floatBack();
}
} else {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newLabel",
})
);
}
return newLabel;
}
</s> add renderLabel(label, labelProps) {
const newLabel = [];
if (this.props.floatingLabel) {
if (this.state.isFocused) {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newFLabel",
float: true,
style: {
fontSize: 15,
lineHeight: 30,
...labelProps.style
}
})
);
this.floatUp();
} else {
newLabel.push(label);
this.floatBack();
}
} else {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newLabel"
})
);
}
return newLabel;
}
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/8368ee0627076abfc66e08706bfc3274257ea849
|
src/basic/Item.js
|
i += 2;
for (j = i, k = 0; j < childrenArray.length; j++, k++) {
right[k] = childrenArray[j];
}
// console.log("left", left);
// console.log("right", right);
let label = [];
let labelProps = {};
label = _.remove(childrenArray, item => {
if (item.type === Label) {
labelProps = item.props;
return item;
}
});
|
<mask> return item;
<mask> }
<mask> });
<mask>
<mask> let input = [];
<mask> let inputProps = {};
<mask> input = _.remove(childrenArray, item => {
<mask> if (item.type === Input) {
<mask> inputProps = item.props;
<mask> this.inputProps = item.props;
<mask> return item;
<mask> }
<mask> });
<mask>
<mask> let icon = [];
<mask> let iconProps = {};
<mask> icon = _.remove(childrenArray, item => {
<mask> if (item.type === Icon) {
</s> floating and stacked label with icons </s> remove prepareRootProps() {
const defaultProps = {
style: this.getInitialStyle().roundedInputGroup,
};
</s> add let input = [];
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type === Input) {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
}); </s> remove let label = [];
let labelProps = {};
label = _.remove(childrenArray, item => {
if (item.type === Label) {
labelProps = item.props;
return item;
}
});
</s> add let i = 0;
for (i = 0; childrenArray[i].type !== Label; i++) {
left[i] = childrenArray[i];
} </s> remove constructor(props) {
super(props);
this.state = {
text: "",
topAnim: new Animated.Value(18),
opacAnim: new Animated.Value(1),
};
}
componentDidMount() {
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
}
}
componentWillReceiveProps(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type.displayName === "Styled(Input)") {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
}
}
</s> add constructor(props) {
super(props);
this.state = {
text: "",
topAnim: new Animated.Value(18),
opacAnim: new Animated.Value(1)
};
}
componentDidMount() {
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
}
componentWillReceiveProps(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type.displayName === "Styled(Input)") {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
} </s> remove renderChildren() {
const newChildren = [];
const childrenArray = React.Children.toArray(this.props.children);
</s> add renderChildren() {
const newChildren = [];
let left = [];
let right = [];
const childrenArray = React.Children.toArray(this.props.children);
console.log(
"childrenArray",
React.Children.toArray(this.props.children)
); </s> remove return computeProps(this.props, defaultProps);
}
render() {
return (
<TouchableOpacity ref={c => (this._root = c)} {...this.prepareRootProps()} activeOpacity={1}>
{this.renderChildren()}
</TouchableOpacity>
);
}
</s> add let icon = [];
let iconProps = {};
icon = _.remove(childrenArray, item => {
if (item.type === Icon) {
iconProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
newChildren.push(
<View key="v1" style={{ flexDirection: "row" }}>
{_.remove(left, item => {
return item;
})}
</View>
);
/*newChildren.push(
<Animated.View
key="float"
style={{
flexGrow: 1,
position: "absolute",
left: this.props.last ? 15 : 0,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop:
Platform.OS === "ios" ? undefined : undefined,
paddingBottom: Platform.OS === "ios" ? undefined : 12
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
);*/
newChildren.push(
<View key="pa1" style={{ flex: 1 }}>
<Animated.View
key="float"
style={{
flex: 1,
position: "absolute",
left: this.props.last ? 15 : 0,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop:
Platform.OS === "ios" ? undefined : undefined,
paddingBottom:
Platform.OS === "ios" ? undefined : 12
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
<Input
ref={c => (this._inputRef = c)}
value={this.state.text}
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true
})
: !this.state.text.length &&
this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText &&
inputProps.onChangeText(text);
}}
/>
</View>
);
/*newChildren.push(
<Input
ref={c => (this._inputRef = c)}
value={this.state.text}
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true
})
: !this.state.text.length &&
this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText &&
inputProps.onChangeText(text);
}}
/>
);*/
newChildren.push(
<View key="v2" style={{ flexDirection: "row" }}>
{_.remove(right, item => {
return item;
})}
</View>
);
} else if (this.props.stackedLabel && icon.length) {
newChildren.push(
<View
key="s"
style={{
flexDirection: "row",
flex: 1,
width: variables.deviceWidth - 15
}}
>
<View key="v3" style={{ flexDirection: "row" }}>
{_.remove(left, item => {
return item;
})}
</View>
<View style={{ flex: 1, flexDirection: "column" }}>
<Label key="s2" {...labelProps} />
<Input key="s3" {...inputProps} />
</View>
<View key="v4" style={{ flexDirection: "row" }}>
{_.remove(right, item => {
return item;
})}
</View>
</View>
);
} else {
return this.props.children;
}
return newChildren;
}
getInitialStyle() {
return {
roundedInputGroup: {
borderWidth: this.props.rounded
? variables.borderWidth * 2
: undefined,
borderRadius: this.props.rounded
? variables.inputGroupRoundedBorderRadius
: undefined
}
};
}
prepareRootProps() {
const defaultProps = {
style: this.getInitialStyle().roundedInputGroup
};
return computeProps(this.props, defaultProps);
}
render() {
return (
<TouchableOpacity
ref={c => (this._root = c)}
{...this.prepareRootProps()}
activeOpacity={1}
>
{this.renderChildren()}
</TouchableOpacity>
);
}
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/8368ee0627076abfc66e08706bfc3274257ea849
|
src/basic/Item.js
|
// console.log("label childrenArray", label);
|
<mask> return item;
<mask> }
<mask> });
<mask>
<mask> let icon = [];
<mask> let iconProps = {};
<mask> icon = _.remove(childrenArray, item => {
<mask> if (item.type === Icon) {
<mask> iconProps = item.props;
<mask> return item;
<mask> }
<mask> });
<mask> if (this.props.floatingLabel && icon.length) {
<mask> newChildren.push(<Icon key="i1" {...iconProps} />);
<mask> newChildren.push(
<mask> <Animated.View
<mask> key="float"
<mask> style={{
<mask> position: "absolute",
<mask> left: this.props.last ? 22 : 22,
<mask> right: 0,
<mask> top: this.state.topAnim,
<mask> opacity: this.state.opacAnim,
<mask> paddingTop: Platform.OS === "ios" ? undefined : undefined,
<mask> paddingBottom: Platform.OS === "ios" ? undefined : 12,
<mask> }}
<mask> >
<mask> <Label {...labelProps}>
<mask> {this.renderLabel(label, labelProps)}
<mask> </Label>
<mask> </Animated.View>
<mask> );
<mask> newChildren.push(
<mask> <Input
<mask> key="l2"
<mask> {...inputProps}
<mask> onFocus={() => {
<mask> this.setState({ isFocused: true });
<mask> inputProps.onFocus && inputProps.onFocus();
<mask> }}
<mask> onBlur={() => {
<mask> inputProps.value
<mask> ? this.setState({
<mask> isFocused: true,
<mask> })
<mask> : !this.state.text.length && this.setState({ isFocused: false });
<mask> inputProps.onBlur && inputProps.onBlur();
<mask> }}
<mask> onChangeText={text => {
<mask> this.setState({ text });
<mask> inputProps.onChangeText && inputProps.onChangeText(text);
<mask> }}
<mask> />
<mask> );
<mask> } else if (this.props.floatingLabel) {
<mask> newChildren.push(
<mask> <Animated.View
<mask> key="float"
<mask> style={{
<mask> position: "absolute",
<mask> left: this.props.last ? 15 : 0,
<mask> right: 0,
<mask> top: this.state.topAnim,
<mask> opacity: this.state.opacAnim,
<mask> paddingTop: Platform.OS === "ios" ? undefined : undefined,
<mask> paddingBottom: Platform.OS === "ios" ? undefined : 12,
<mask> }}
<mask> >
<mask> <Label {...labelProps}>
<mask> {this.renderLabel(label, labelProps)}
<mask> </Label>
<mask> </Animated.View>
<mask> );
<mask> newChildren.push(
<mask> <Input
<mask> ref={c => (this._inputRef = c)}
<mask> value={this.state.text}
<mask> key="l2"
<mask> {...inputProps}
<mask> onFocus={() => {
<mask> this.setState({ isFocused: true });
<mask> inputProps.onFocus && inputProps.onFocus();
<mask> }}
<mask> onBlur={() => {
<mask> inputProps.value
<mask> ? this.setState({
<mask> isFocused: true,
<mask> })
<mask> : !this.state.text.length && this.setState({ isFocused: false });
<mask> inputProps.onBlur && inputProps.onBlur();
<mask> }}
<mask> onChangeText={text => {
<mask> this.setState({ text });
<mask> inputProps.onChangeText && inputProps.onChangeText(text);
<mask> }}
<mask> />
<mask> );
<mask> } else if (this.props.stackedLabel && icon.length) {
<mask> newChildren.push(
<mask> <View
<mask> key="s"
<mask> style={{
<mask> flexDirection: "row",
<mask> flex: 1,
<mask> width: variables.deviceWidth - 15,
<mask> }}
<mask> >
<mask> <Icon key="s1" {...iconProps} />
<mask> <View style={{ flexDirection: "column" }}>
<mask> <Label key="s2" {...labelProps} />
<mask> <Input key="s3" {...inputProps} style={{ width: variables.deviceWidth - 40 }} />
<mask> </View>
<mask> </View>
<mask> );
<mask> } else {
<mask> return this.props.children;
<mask> }
<mask> return newChildren;
<mask> }
<mask> getInitialStyle() {
<mask> return {
<mask> roundedInputGroup: {
<mask> borderWidth: this.props.rounded ? variables.borderWidth * 2 : undefined,
<mask> borderRadius: this.props.rounded ? variables.inputGroupRoundedBorderRadius : undefined,
<mask> },
<mask> };
<mask> }
<mask>
<mask> prepareRootProps() {
<mask> const defaultProps = {
<mask> style: this.getInitialStyle().roundedInputGroup,
<mask> };
</s> floating and stacked label with icons </s> remove return computeProps(this.props, defaultProps);
}
render() {
return (
<TouchableOpacity ref={c => (this._root = c)} {...this.prepareRootProps()} activeOpacity={1}>
{this.renderChildren()}
</TouchableOpacity>
);
}
</s> add let icon = [];
let iconProps = {};
icon = _.remove(childrenArray, item => {
if (item.type === Icon) {
iconProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
newChildren.push(
<View key="v1" style={{ flexDirection: "row" }}>
{_.remove(left, item => {
return item;
})}
</View>
);
/*newChildren.push(
<Animated.View
key="float"
style={{
flexGrow: 1,
position: "absolute",
left: this.props.last ? 15 : 0,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop:
Platform.OS === "ios" ? undefined : undefined,
paddingBottom: Platform.OS === "ios" ? undefined : 12
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
);*/
newChildren.push(
<View key="pa1" style={{ flex: 1 }}>
<Animated.View
key="float"
style={{
flex: 1,
position: "absolute",
left: this.props.last ? 15 : 0,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop:
Platform.OS === "ios" ? undefined : undefined,
paddingBottom:
Platform.OS === "ios" ? undefined : 12
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
<Input
ref={c => (this._inputRef = c)}
value={this.state.text}
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true
})
: !this.state.text.length &&
this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText &&
inputProps.onChangeText(text);
}}
/>
</View>
);
/*newChildren.push(
<Input
ref={c => (this._inputRef = c)}
value={this.state.text}
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true
})
: !this.state.text.length &&
this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText &&
inputProps.onChangeText(text);
}}
/>
);*/
newChildren.push(
<View key="v2" style={{ flexDirection: "row" }}>
{_.remove(right, item => {
return item;
})}
</View>
);
} else if (this.props.stackedLabel && icon.length) {
newChildren.push(
<View
key="s"
style={{
flexDirection: "row",
flex: 1,
width: variables.deviceWidth - 15
}}
>
<View key="v3" style={{ flexDirection: "row" }}>
{_.remove(left, item => {
return item;
})}
</View>
<View style={{ flex: 1, flexDirection: "column" }}>
<Label key="s2" {...labelProps} />
<Input key="s3" {...inputProps} />
</View>
<View key="v4" style={{ flexDirection: "row" }}>
{_.remove(right, item => {
return item;
})}
</View>
</View>
);
} else {
return this.props.children;
}
return newChildren;
}
getInitialStyle() {
return {
roundedInputGroup: {
borderWidth: this.props.rounded
? variables.borderWidth * 2
: undefined,
borderRadius: this.props.rounded
? variables.inputGroupRoundedBorderRadius
: undefined
}
};
}
prepareRootProps() {
const defaultProps = {
style: this.getInitialStyle().roundedInputGroup
};
return computeProps(this.props, defaultProps);
}
render() {
return (
<TouchableOpacity
ref={c => (this._root = c)}
{...this.prepareRootProps()}
activeOpacity={1}
>
{this.renderChildren()}
</TouchableOpacity>
);
} </s> remove constructor(props) {
super(props);
this.state = {
text: "",
topAnim: new Animated.Value(18),
opacAnim: new Animated.Value(1),
};
}
componentDidMount() {
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
}
}
componentWillReceiveProps(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type.displayName === "Styled(Input)") {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
}
}
</s> add constructor(props) {
super(props);
this.state = {
text: "",
topAnim: new Animated.Value(18),
opacAnim: new Animated.Value(1)
};
}
componentDidMount() {
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
}
componentWillReceiveProps(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type.displayName === "Styled(Input)") {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
} </s> remove let input = [];
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type === Input) {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
</s> add i += 2;
for (j = i, k = 0; j < childrenArray.length; j++, k++) {
right[k] = childrenArray[j];
}
// console.log("left", left);
// console.log("right", right);
let label = [];
let labelProps = {};
label = _.remove(childrenArray, item => {
if (item.type === Label) {
labelProps = item.props;
return item;
}
}); </s> remove prepareRootProps() {
const defaultProps = {
style: this.getInitialStyle().roundedInputGroup,
};
</s> add let input = [];
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type === Input) {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
}); </s> remove renderLabel(label, labelProps) {
const newLabel = [];
if (this.props.floatingLabel) {
if (this.state.isFocused) {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newFLabel",
float: true,
style: {
fontSize: 15,
lineHeight: 30,
...labelProps.style,
},
})
);
this.floatUp();
} else {
newLabel.push(label);
this.floatBack();
}
} else {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newLabel",
})
);
}
return newLabel;
}
</s> add renderLabel(label, labelProps) {
const newLabel = [];
if (this.props.floatingLabel) {
if (this.state.isFocused) {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newFLabel",
float: true,
style: {
fontSize: 15,
lineHeight: 30,
...labelProps.style
}
})
);
this.floatUp();
} else {
newLabel.push(label);
this.floatBack();
}
} else {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newLabel"
})
);
}
return newLabel;
}
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/8368ee0627076abfc66e08706bfc3274257ea849
|
src/basic/Item.js
|
let input = [];
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type === Input) {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
|
<mask> },
<mask> };
<mask> }
<mask>
<mask> prepareRootProps() {
<mask> const defaultProps = {
<mask> style: this.getInitialStyle().roundedInputGroup,
<mask> };
<mask>
<mask> return computeProps(this.props, defaultProps);
<mask> }
<mask> render() {
<mask> return (
</s> floating and stacked label with icons </s> remove return computeProps(this.props, defaultProps);
}
render() {
return (
<TouchableOpacity ref={c => (this._root = c)} {...this.prepareRootProps()} activeOpacity={1}>
{this.renderChildren()}
</TouchableOpacity>
);
}
</s> add let icon = [];
let iconProps = {};
icon = _.remove(childrenArray, item => {
if (item.type === Icon) {
iconProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
newChildren.push(
<View key="v1" style={{ flexDirection: "row" }}>
{_.remove(left, item => {
return item;
})}
</View>
);
/*newChildren.push(
<Animated.View
key="float"
style={{
flexGrow: 1,
position: "absolute",
left: this.props.last ? 15 : 0,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop:
Platform.OS === "ios" ? undefined : undefined,
paddingBottom: Platform.OS === "ios" ? undefined : 12
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
);*/
newChildren.push(
<View key="pa1" style={{ flex: 1 }}>
<Animated.View
key="float"
style={{
flex: 1,
position: "absolute",
left: this.props.last ? 15 : 0,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop:
Platform.OS === "ios" ? undefined : undefined,
paddingBottom:
Platform.OS === "ios" ? undefined : 12
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
<Input
ref={c => (this._inputRef = c)}
value={this.state.text}
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true
})
: !this.state.text.length &&
this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText &&
inputProps.onChangeText(text);
}}
/>
</View>
);
/*newChildren.push(
<Input
ref={c => (this._inputRef = c)}
value={this.state.text}
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true
})
: !this.state.text.length &&
this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText &&
inputProps.onChangeText(text);
}}
/>
);*/
newChildren.push(
<View key="v2" style={{ flexDirection: "row" }}>
{_.remove(right, item => {
return item;
})}
</View>
);
} else if (this.props.stackedLabel && icon.length) {
newChildren.push(
<View
key="s"
style={{
flexDirection: "row",
flex: 1,
width: variables.deviceWidth - 15
}}
>
<View key="v3" style={{ flexDirection: "row" }}>
{_.remove(left, item => {
return item;
})}
</View>
<View style={{ flex: 1, flexDirection: "column" }}>
<Label key="s2" {...labelProps} />
<Input key="s3" {...inputProps} />
</View>
<View key="v4" style={{ flexDirection: "row" }}>
{_.remove(right, item => {
return item;
})}
</View>
</View>
);
} else {
return this.props.children;
}
return newChildren;
}
getInitialStyle() {
return {
roundedInputGroup: {
borderWidth: this.props.rounded
? variables.borderWidth * 2
: undefined,
borderRadius: this.props.rounded
? variables.inputGroupRoundedBorderRadius
: undefined
}
};
}
prepareRootProps() {
const defaultProps = {
style: this.getInitialStyle().roundedInputGroup
};
return computeProps(this.props, defaultProps);
}
render() {
return (
<TouchableOpacity
ref={c => (this._root = c)}
{...this.prepareRootProps()}
activeOpacity={1}
>
{this.renderChildren()}
</TouchableOpacity>
);
} </s> remove let icon = [];
let iconProps = {};
icon = _.remove(childrenArray, item => {
if (item.type === Icon) {
iconProps = item.props;
return item;
}
});
if (this.props.floatingLabel && icon.length) {
newChildren.push(<Icon key="i1" {...iconProps} />);
newChildren.push(
<Animated.View
key="float"
style={{
position: "absolute",
left: this.props.last ? 22 : 22,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop: Platform.OS === "ios" ? undefined : undefined,
paddingBottom: Platform.OS === "ios" ? undefined : 12,
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
);
newChildren.push(
<Input
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true,
})
: !this.state.text.length && this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText && inputProps.onChangeText(text);
}}
/>
);
} else if (this.props.floatingLabel) {
newChildren.push(
<Animated.View
key="float"
style={{
position: "absolute",
left: this.props.last ? 15 : 0,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop: Platform.OS === "ios" ? undefined : undefined,
paddingBottom: Platform.OS === "ios" ? undefined : 12,
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
);
newChildren.push(
<Input
ref={c => (this._inputRef = c)}
value={this.state.text}
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true,
})
: !this.state.text.length && this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText && inputProps.onChangeText(text);
}}
/>
);
} else if (this.props.stackedLabel && icon.length) {
newChildren.push(
<View
key="s"
style={{
flexDirection: "row",
flex: 1,
width: variables.deviceWidth - 15,
}}
>
<Icon key="s1" {...iconProps} />
<View style={{ flexDirection: "column" }}>
<Label key="s2" {...labelProps} />
<Input key="s3" {...inputProps} style={{ width: variables.deviceWidth - 40 }} />
</View>
</View>
);
} else {
return this.props.children;
}
return newChildren;
}
getInitialStyle() {
return {
roundedInputGroup: {
borderWidth: this.props.rounded ? variables.borderWidth * 2 : undefined,
borderRadius: this.props.rounded ? variables.inputGroupRoundedBorderRadius : undefined,
},
};
}
</s> add // console.log("label childrenArray", label); </s> remove let error;
const prop = props[propName];
if (!props.children.length) {
error = new Error(`${component} should have both Label and Input components`);
} else if (
props.children[0].type.displayName !== "Styled(Label)" ||
props.children[1].type.displayName !== "Styled(Input)"
) {
error = new Error(`${component} should have Label and Input components only`);
}
return error;
</s> add let error;
const prop = props[propName];
if (!props.children.length) {
error = new Error(
`${component} should have both Label and Input components`
);
} else if (
props.children[0].type.displayName !== "Styled(Label)" ||
props.children[1].type.displayName !== "Styled(Input)"
) {
error = new Error(
`${component} should have Label and Input components only`
);
}
return error; </s> remove renderLabel(label, labelProps) {
const newLabel = [];
if (this.props.floatingLabel) {
if (this.state.isFocused) {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newFLabel",
float: true,
style: {
fontSize: 15,
lineHeight: 30,
...labelProps.style,
},
})
);
this.floatUp();
} else {
newLabel.push(label);
this.floatBack();
}
} else {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newLabel",
})
);
}
return newLabel;
}
</s> add renderLabel(label, labelProps) {
const newLabel = [];
if (this.props.floatingLabel) {
if (this.state.isFocused) {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newFLabel",
float: true,
style: {
fontSize: 15,
lineHeight: 30,
...labelProps.style
}
})
);
this.floatUp();
} else {
newLabel.push(label);
this.floatBack();
}
} else {
newLabel.push(
React.createElement(Label, {
...labelProps,
key: "newLabel"
})
);
}
return newLabel;
} </s> remove constructor(props) {
super(props);
this.state = {
text: "",
topAnim: new Animated.Value(18),
opacAnim: new Animated.Value(1),
};
}
componentDidMount() {
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
}
}
componentWillReceiveProps(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type.displayName === "Styled(Input)") {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
}
}
</s> add constructor(props) {
super(props);
this.state = {
text: "",
topAnim: new Animated.Value(18),
opacAnim: new Animated.Value(1)
};
}
componentDidMount() {
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
}
componentWillReceiveProps(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type.displayName === "Styled(Input)") {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
}
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/8368ee0627076abfc66e08706bfc3274257ea849
|
src/basic/Item.js
|
let icon = [];
let iconProps = {};
icon = _.remove(childrenArray, item => {
if (item.type === Icon) {
iconProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
newChildren.push(
<View key="v1" style={{ flexDirection: "row" }}>
{_.remove(left, item => {
return item;
})}
</View>
);
/*newChildren.push(
<Animated.View
key="float"
style={{
flexGrow: 1,
position: "absolute",
left: this.props.last ? 15 : 0,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop:
Platform.OS === "ios" ? undefined : undefined,
paddingBottom: Platform.OS === "ios" ? undefined : 12
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
);*/
newChildren.push(
<View key="pa1" style={{ flex: 1 }}>
<Animated.View
key="float"
style={{
flex: 1,
position: "absolute",
left: this.props.last ? 15 : 0,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop:
Platform.OS === "ios" ? undefined : undefined,
paddingBottom:
Platform.OS === "ios" ? undefined : 12
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
<Input
ref={c => (this._inputRef = c)}
value={this.state.text}
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true
})
: !this.state.text.length &&
this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText &&
inputProps.onChangeText(text);
}}
/>
</View>
);
/*newChildren.push(
<Input
ref={c => (this._inputRef = c)}
value={this.state.text}
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true
})
: !this.state.text.length &&
this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText &&
inputProps.onChangeText(text);
}}
/>
);*/
newChildren.push(
<View key="v2" style={{ flexDirection: "row" }}>
{_.remove(right, item => {
return item;
})}
</View>
);
} else if (this.props.stackedLabel && icon.length) {
newChildren.push(
<View
key="s"
style={{
flexDirection: "row",
flex: 1,
width: variables.deviceWidth - 15
}}
>
<View key="v3" style={{ flexDirection: "row" }}>
{_.remove(left, item => {
return item;
})}
</View>
<View style={{ flex: 1, flexDirection: "column" }}>
<Label key="s2" {...labelProps} />
<Input key="s3" {...inputProps} />
</View>
<View key="v4" style={{ flexDirection: "row" }}>
{_.remove(right, item => {
return item;
})}
</View>
</View>
);
} else {
return this.props.children;
}
return newChildren;
}
getInitialStyle() {
return {
roundedInputGroup: {
borderWidth: this.props.rounded
? variables.borderWidth * 2
: undefined,
borderRadius: this.props.rounded
? variables.inputGroupRoundedBorderRadius
: undefined
}
};
}
prepareRootProps() {
const defaultProps = {
style: this.getInitialStyle().roundedInputGroup
};
return computeProps(this.props, defaultProps);
}
render() {
return (
<TouchableOpacity
ref={c => (this._root = c)}
{...this.prepareRootProps()}
activeOpacity={1}
>
{this.renderChildren()}
</TouchableOpacity>
);
}
|
<mask> const defaultProps = {
<mask> style: this.getInitialStyle().roundedInputGroup,
<mask> };
<mask>
<mask> return computeProps(this.props, defaultProps);
<mask> }
<mask> render() {
<mask> return (
<mask> <TouchableOpacity ref={c => (this._root = c)} {...this.prepareRootProps()} activeOpacity={1}>
<mask> {this.renderChildren()}
<mask> </TouchableOpacity>
<mask> );
<mask> }
<mask> }
<mask>
<mask> const childrenType = function(props, propName, component) {
<mask> let error;
<mask> const prop = props[propName];
</s> floating and stacked label with icons </s> remove let error;
const prop = props[propName];
if (!props.children.length) {
error = new Error(`${component} should have both Label and Input components`);
} else if (
props.children[0].type.displayName !== "Styled(Label)" ||
props.children[1].type.displayName !== "Styled(Input)"
) {
error = new Error(`${component} should have Label and Input components only`);
}
return error;
</s> add let error;
const prop = props[propName];
if (!props.children.length) {
error = new Error(
`${component} should have both Label and Input components`
);
} else if (
props.children[0].type.displayName !== "Styled(Label)" ||
props.children[1].type.displayName !== "Styled(Input)"
) {
error = new Error(
`${component} should have Label and Input components only`
);
}
return error; </s> remove prepareRootProps() {
const defaultProps = {
style: this.getInitialStyle().roundedInputGroup,
};
</s> add let input = [];
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type === Input) {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
}); </s> remove let icon = [];
let iconProps = {};
icon = _.remove(childrenArray, item => {
if (item.type === Icon) {
iconProps = item.props;
return item;
}
});
if (this.props.floatingLabel && icon.length) {
newChildren.push(<Icon key="i1" {...iconProps} />);
newChildren.push(
<Animated.View
key="float"
style={{
position: "absolute",
left: this.props.last ? 22 : 22,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop: Platform.OS === "ios" ? undefined : undefined,
paddingBottom: Platform.OS === "ios" ? undefined : 12,
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
);
newChildren.push(
<Input
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true,
})
: !this.state.text.length && this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText && inputProps.onChangeText(text);
}}
/>
);
} else if (this.props.floatingLabel) {
newChildren.push(
<Animated.View
key="float"
style={{
position: "absolute",
left: this.props.last ? 15 : 0,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop: Platform.OS === "ios" ? undefined : undefined,
paddingBottom: Platform.OS === "ios" ? undefined : 12,
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
);
newChildren.push(
<Input
ref={c => (this._inputRef = c)}
value={this.state.text}
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true,
})
: !this.state.text.length && this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText && inputProps.onChangeText(text);
}}
/>
);
} else if (this.props.stackedLabel && icon.length) {
newChildren.push(
<View
key="s"
style={{
flexDirection: "row",
flex: 1,
width: variables.deviceWidth - 15,
}}
>
<Icon key="s1" {...iconProps} />
<View style={{ flexDirection: "column" }}>
<Label key="s2" {...labelProps} />
<Input key="s3" {...inputProps} style={{ width: variables.deviceWidth - 40 }} />
</View>
</View>
);
} else {
return this.props.children;
}
return newChildren;
}
getInitialStyle() {
return {
roundedInputGroup: {
borderWidth: this.props.rounded ? variables.borderWidth * 2 : undefined,
borderRadius: this.props.rounded ? variables.inputGroupRoundedBorderRadius : undefined,
},
};
}
</s> add // console.log("label childrenArray", label); </s> remove renderChildren() {
const newChildren = [];
const childrenArray = React.Children.toArray(this.props.children);
</s> add renderChildren() {
const newChildren = [];
let left = [];
let right = [];
const childrenArray = React.Children.toArray(this.props.children);
console.log(
"childrenArray",
React.Children.toArray(this.props.children)
); </s> remove let label = [];
let labelProps = {};
label = _.remove(childrenArray, item => {
if (item.type === Label) {
labelProps = item.props;
return item;
}
});
</s> add let i = 0;
for (i = 0; childrenArray[i].type !== Label; i++) {
left[i] = childrenArray[i];
}
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/8368ee0627076abfc66e08706bfc3274257ea849
|
src/basic/Item.js
|
let error;
const prop = props[propName];
if (!props.children.length) {
error = new Error(
`${component} should have both Label and Input components`
);
} else if (
props.children[0].type.displayName !== "Styled(Label)" ||
props.children[1].type.displayName !== "Styled(Input)"
) {
error = new Error(
`${component} should have Label and Input components only`
);
}
return error;
|
<mask> }
<mask> }
<mask>
<mask> const childrenType = function(props, propName, component) {
<mask> let error;
<mask> const prop = props[propName];
<mask> if (!props.children.length) {
<mask> error = new Error(`${component} should have both Label and Input components`);
<mask> } else if (
<mask> props.children[0].type.displayName !== "Styled(Label)" ||
<mask> props.children[1].type.displayName !== "Styled(Input)"
<mask> ) {
<mask> error = new Error(`${component} should have Label and Input components only`);
<mask> }
<mask> return error;
<mask> };
<mask>
<mask> Item.propTypes = {
<mask> ...TouchableOpacity.propTypes,
<mask> style: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
</s> floating and stacked label with icons </s> remove ...TouchableOpacity.propTypes,
style: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
inlineLabel: PropTypes.bool,
floatingLabel: PropTypes.bool,
stackedLabel: PropTypes.bool,
fixedLabel: PropTypes.bool,
success: PropTypes.bool,
error: PropTypes.bool,
</s> add ...TouchableOpacity.propTypes,
style: PropTypes.oneOfType([
PropTypes.object,
PropTypes.number,
PropTypes.array
]),
inlineLabel: PropTypes.bool,
floatingLabel: PropTypes.bool,
stackedLabel: PropTypes.bool,
fixedLabel: PropTypes.bool,
success: PropTypes.bool,
error: PropTypes.bool </s> remove return computeProps(this.props, defaultProps);
}
render() {
return (
<TouchableOpacity ref={c => (this._root = c)} {...this.prepareRootProps()} activeOpacity={1}>
{this.renderChildren()}
</TouchableOpacity>
);
}
</s> add let icon = [];
let iconProps = {};
icon = _.remove(childrenArray, item => {
if (item.type === Icon) {
iconProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
newChildren.push(
<View key="v1" style={{ flexDirection: "row" }}>
{_.remove(left, item => {
return item;
})}
</View>
);
/*newChildren.push(
<Animated.View
key="float"
style={{
flexGrow: 1,
position: "absolute",
left: this.props.last ? 15 : 0,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop:
Platform.OS === "ios" ? undefined : undefined,
paddingBottom: Platform.OS === "ios" ? undefined : 12
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
);*/
newChildren.push(
<View key="pa1" style={{ flex: 1 }}>
<Animated.View
key="float"
style={{
flex: 1,
position: "absolute",
left: this.props.last ? 15 : 0,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop:
Platform.OS === "ios" ? undefined : undefined,
paddingBottom:
Platform.OS === "ios" ? undefined : 12
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
<Input
ref={c => (this._inputRef = c)}
value={this.state.text}
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true
})
: !this.state.text.length &&
this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText &&
inputProps.onChangeText(text);
}}
/>
</View>
);
/*newChildren.push(
<Input
ref={c => (this._inputRef = c)}
value={this.state.text}
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true
})
: !this.state.text.length &&
this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText &&
inputProps.onChangeText(text);
}}
/>
);*/
newChildren.push(
<View key="v2" style={{ flexDirection: "row" }}>
{_.remove(right, item => {
return item;
})}
</View>
);
} else if (this.props.stackedLabel && icon.length) {
newChildren.push(
<View
key="s"
style={{
flexDirection: "row",
flex: 1,
width: variables.deviceWidth - 15
}}
>
<View key="v3" style={{ flexDirection: "row" }}>
{_.remove(left, item => {
return item;
})}
</View>
<View style={{ flex: 1, flexDirection: "column" }}>
<Label key="s2" {...labelProps} />
<Input key="s3" {...inputProps} />
</View>
<View key="v4" style={{ flexDirection: "row" }}>
{_.remove(right, item => {
return item;
})}
</View>
</View>
);
} else {
return this.props.children;
}
return newChildren;
}
getInitialStyle() {
return {
roundedInputGroup: {
borderWidth: this.props.rounded
? variables.borderWidth * 2
: undefined,
borderRadius: this.props.rounded
? variables.inputGroupRoundedBorderRadius
: undefined
}
};
}
prepareRootProps() {
const defaultProps = {
style: this.getInitialStyle().roundedInputGroup
};
return computeProps(this.props, defaultProps);
}
render() {
return (
<TouchableOpacity
ref={c => (this._root = c)}
{...this.prepareRootProps()}
activeOpacity={1}
>
{this.renderChildren()}
</TouchableOpacity>
);
} </s> remove constructor(props) {
super(props);
this.state = {
text: "",
topAnim: new Animated.Value(18),
opacAnim: new Animated.Value(1),
};
}
componentDidMount() {
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
}
}
componentWillReceiveProps(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type.displayName === "Styled(Input)") {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
}
}
</s> add constructor(props) {
super(props);
this.state = {
text: "",
topAnim: new Animated.Value(18),
opacAnim: new Animated.Value(1)
};
}
componentDidMount() {
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
}
componentWillReceiveProps(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type.displayName === "Styled(Input)") {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
} </s> remove let label = [];
let labelProps = {};
label = _.remove(childrenArray, item => {
if (item.type === Label) {
labelProps = item.props;
return item;
}
});
</s> add let i = 0;
for (i = 0; childrenArray[i].type !== Label; i++) {
left[i] = childrenArray[i];
} </s> remove prepareRootProps() {
const defaultProps = {
style: this.getInitialStyle().roundedInputGroup,
};
</s> add let input = [];
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type === Input) {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/8368ee0627076abfc66e08706bfc3274257ea849
|
src/basic/Item.js
|
...TouchableOpacity.propTypes,
style: PropTypes.oneOfType([
PropTypes.object,
PropTypes.number,
PropTypes.array
]),
inlineLabel: PropTypes.bool,
floatingLabel: PropTypes.bool,
stackedLabel: PropTypes.bool,
fixedLabel: PropTypes.bool,
success: PropTypes.bool,
error: PropTypes.bool
|
<mask> return error;
<mask> };
<mask>
<mask> Item.propTypes = {
<mask> ...TouchableOpacity.propTypes,
<mask> style: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
<mask> inlineLabel: PropTypes.bool,
<mask> floatingLabel: PropTypes.bool,
<mask> stackedLabel: PropTypes.bool,
<mask> fixedLabel: PropTypes.bool,
<mask> success: PropTypes.bool,
<mask> error: PropTypes.bool,
<mask> };
<mask>
<mask> const StyledItem = connectStyle("NativeBase.Item", {}, mapPropsToStyleNames)(Item);
<mask>
<mask> export { StyledItem as Item };
</s> floating and stacked label with icons </s> remove const StyledItem = connectStyle("NativeBase.Item", {}, mapPropsToStyleNames)(Item);
</s> add const StyledItem = connectStyle("NativeBase.Item", {}, mapPropsToStyleNames)(
Item
); </s> remove let error;
const prop = props[propName];
if (!props.children.length) {
error = new Error(`${component} should have both Label and Input components`);
} else if (
props.children[0].type.displayName !== "Styled(Label)" ||
props.children[1].type.displayName !== "Styled(Input)"
) {
error = new Error(`${component} should have Label and Input components only`);
}
return error;
</s> add let error;
const prop = props[propName];
if (!props.children.length) {
error = new Error(
`${component} should have both Label and Input components`
);
} else if (
props.children[0].type.displayName !== "Styled(Label)" ||
props.children[1].type.displayName !== "Styled(Input)"
) {
error = new Error(
`${component} should have Label and Input components only`
);
}
return error; </s> remove prepareRootProps() {
const defaultProps = {
style: this.getInitialStyle().roundedInputGroup,
};
</s> add let input = [];
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type === Input) {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
}); </s> remove constructor(props) {
super(props);
this.state = {
text: "",
topAnim: new Animated.Value(18),
opacAnim: new Animated.Value(1),
};
}
componentDidMount() {
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
}
}
componentWillReceiveProps(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type.displayName === "Styled(Input)") {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
}
}
</s> add constructor(props) {
super(props);
this.state = {
text: "",
topAnim: new Animated.Value(18),
opacAnim: new Animated.Value(1)
};
}
componentDidMount() {
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
}
componentWillReceiveProps(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type.displayName === "Styled(Input)") {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
} </s> remove return computeProps(this.props, defaultProps);
}
render() {
return (
<TouchableOpacity ref={c => (this._root = c)} {...this.prepareRootProps()} activeOpacity={1}>
{this.renderChildren()}
</TouchableOpacity>
);
}
</s> add let icon = [];
let iconProps = {};
icon = _.remove(childrenArray, item => {
if (item.type === Icon) {
iconProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
newChildren.push(
<View key="v1" style={{ flexDirection: "row" }}>
{_.remove(left, item => {
return item;
})}
</View>
);
/*newChildren.push(
<Animated.View
key="float"
style={{
flexGrow: 1,
position: "absolute",
left: this.props.last ? 15 : 0,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop:
Platform.OS === "ios" ? undefined : undefined,
paddingBottom: Platform.OS === "ios" ? undefined : 12
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
);*/
newChildren.push(
<View key="pa1" style={{ flex: 1 }}>
<Animated.View
key="float"
style={{
flex: 1,
position: "absolute",
left: this.props.last ? 15 : 0,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop:
Platform.OS === "ios" ? undefined : undefined,
paddingBottom:
Platform.OS === "ios" ? undefined : 12
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
<Input
ref={c => (this._inputRef = c)}
value={this.state.text}
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true
})
: !this.state.text.length &&
this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText &&
inputProps.onChangeText(text);
}}
/>
</View>
);
/*newChildren.push(
<Input
ref={c => (this._inputRef = c)}
value={this.state.text}
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true
})
: !this.state.text.length &&
this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText &&
inputProps.onChangeText(text);
}}
/>
);*/
newChildren.push(
<View key="v2" style={{ flexDirection: "row" }}>
{_.remove(right, item => {
return item;
})}
</View>
);
} else if (this.props.stackedLabel && icon.length) {
newChildren.push(
<View
key="s"
style={{
flexDirection: "row",
flex: 1,
width: variables.deviceWidth - 15
}}
>
<View key="v3" style={{ flexDirection: "row" }}>
{_.remove(left, item => {
return item;
})}
</View>
<View style={{ flex: 1, flexDirection: "column" }}>
<Label key="s2" {...labelProps} />
<Input key="s3" {...inputProps} />
</View>
<View key="v4" style={{ flexDirection: "row" }}>
{_.remove(right, item => {
return item;
})}
</View>
</View>
);
} else {
return this.props.children;
}
return newChildren;
}
getInitialStyle() {
return {
roundedInputGroup: {
borderWidth: this.props.rounded
? variables.borderWidth * 2
: undefined,
borderRadius: this.props.rounded
? variables.inputGroupRoundedBorderRadius
: undefined
}
};
}
prepareRootProps() {
const defaultProps = {
style: this.getInitialStyle().roundedInputGroup
};
return computeProps(this.props, defaultProps);
}
render() {
return (
<TouchableOpacity
ref={c => (this._root = c)}
{...this.prepareRootProps()}
activeOpacity={1}
>
{this.renderChildren()}
</TouchableOpacity>
);
}
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/8368ee0627076abfc66e08706bfc3274257ea849
|
src/basic/Item.js
|
const StyledItem = connectStyle("NativeBase.Item", {}, mapPropsToStyleNames)(
Item
);
|
<mask> success: PropTypes.bool,
<mask> error: PropTypes.bool,
<mask> };
<mask>
<mask> const StyledItem = connectStyle("NativeBase.Item", {}, mapPropsToStyleNames)(Item);
<mask>
<mask> export { StyledItem as Item };
</s> floating and stacked label with icons </s> remove ...TouchableOpacity.propTypes,
style: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
inlineLabel: PropTypes.bool,
floatingLabel: PropTypes.bool,
stackedLabel: PropTypes.bool,
fixedLabel: PropTypes.bool,
success: PropTypes.bool,
error: PropTypes.bool,
</s> add ...TouchableOpacity.propTypes,
style: PropTypes.oneOfType([
PropTypes.object,
PropTypes.number,
PropTypes.array
]),
inlineLabel: PropTypes.bool,
floatingLabel: PropTypes.bool,
stackedLabel: PropTypes.bool,
fixedLabel: PropTypes.bool,
success: PropTypes.bool,
error: PropTypes.bool </s> remove constructor(props) {
super(props);
this.state = {
text: "",
topAnim: new Animated.Value(18),
opacAnim: new Animated.Value(1),
};
}
componentDidMount() {
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
}
}
componentWillReceiveProps(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type.displayName === "Styled(Input)") {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef) this.inputProps.getRef(this._inputRef);
}
}
</s> add constructor(props) {
super(props);
this.state = {
text: "",
topAnim: new Animated.Value(18),
opacAnim: new Animated.Value(1)
};
}
componentDidMount() {
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
}
componentWillReceiveProps(nextProps) {
const childrenArray = React.Children.toArray(nextProps.children);
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type.displayName === "Styled(Input)") {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
if (this.inputProps && this.inputProps.value) {
this.setState({ isFocused: true });
this.floatUp(-16);
}
if (this.inputProps && this.inputProps.getRef)
this.inputProps.getRef(this._inputRef);
}
} </s> remove prepareRootProps() {
const defaultProps = {
style: this.getInitialStyle().roundedInputGroup,
};
</s> add let input = [];
let inputProps = {};
input = _.remove(childrenArray, item => {
if (item.type === Input) {
inputProps = item.props;
this.inputProps = item.props;
return item;
}
}); </s> remove let error;
const prop = props[propName];
if (!props.children.length) {
error = new Error(`${component} should have both Label and Input components`);
} else if (
props.children[0].type.displayName !== "Styled(Label)" ||
props.children[1].type.displayName !== "Styled(Input)"
) {
error = new Error(`${component} should have Label and Input components only`);
}
return error;
</s> add let error;
const prop = props[propName];
if (!props.children.length) {
error = new Error(
`${component} should have both Label and Input components`
);
} else if (
props.children[0].type.displayName !== "Styled(Label)" ||
props.children[1].type.displayName !== "Styled(Input)"
) {
error = new Error(
`${component} should have Label and Input components only`
);
}
return error; </s> remove return computeProps(this.props, defaultProps);
}
render() {
return (
<TouchableOpacity ref={c => (this._root = c)} {...this.prepareRootProps()} activeOpacity={1}>
{this.renderChildren()}
</TouchableOpacity>
);
}
</s> add let icon = [];
let iconProps = {};
icon = _.remove(childrenArray, item => {
if (item.type === Icon) {
iconProps = item.props;
return item;
}
});
if (this.props.floatingLabel) {
newChildren.push(
<View key="v1" style={{ flexDirection: "row" }}>
{_.remove(left, item => {
return item;
})}
</View>
);
/*newChildren.push(
<Animated.View
key="float"
style={{
flexGrow: 1,
position: "absolute",
left: this.props.last ? 15 : 0,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop:
Platform.OS === "ios" ? undefined : undefined,
paddingBottom: Platform.OS === "ios" ? undefined : 12
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
);*/
newChildren.push(
<View key="pa1" style={{ flex: 1 }}>
<Animated.View
key="float"
style={{
flex: 1,
position: "absolute",
left: this.props.last ? 15 : 0,
right: 0,
top: this.state.topAnim,
opacity: this.state.opacAnim,
paddingTop:
Platform.OS === "ios" ? undefined : undefined,
paddingBottom:
Platform.OS === "ios" ? undefined : 12
}}
>
<Label {...labelProps}>
{this.renderLabel(label, labelProps)}
</Label>
</Animated.View>
<Input
ref={c => (this._inputRef = c)}
value={this.state.text}
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true
})
: !this.state.text.length &&
this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText &&
inputProps.onChangeText(text);
}}
/>
</View>
);
/*newChildren.push(
<Input
ref={c => (this._inputRef = c)}
value={this.state.text}
key="l2"
{...inputProps}
onFocus={() => {
this.setState({ isFocused: true });
inputProps.onFocus && inputProps.onFocus();
}}
onBlur={() => {
inputProps.value
? this.setState({
isFocused: true
})
: !this.state.text.length &&
this.setState({ isFocused: false });
inputProps.onBlur && inputProps.onBlur();
}}
onChangeText={text => {
this.setState({ text });
inputProps.onChangeText &&
inputProps.onChangeText(text);
}}
/>
);*/
newChildren.push(
<View key="v2" style={{ flexDirection: "row" }}>
{_.remove(right, item => {
return item;
})}
</View>
);
} else if (this.props.stackedLabel && icon.length) {
newChildren.push(
<View
key="s"
style={{
flexDirection: "row",
flex: 1,
width: variables.deviceWidth - 15
}}
>
<View key="v3" style={{ flexDirection: "row" }}>
{_.remove(left, item => {
return item;
})}
</View>
<View style={{ flex: 1, flexDirection: "column" }}>
<Label key="s2" {...labelProps} />
<Input key="s3" {...inputProps} />
</View>
<View key="v4" style={{ flexDirection: "row" }}>
{_.remove(right, item => {
return item;
})}
</View>
</View>
);
} else {
return this.props.children;
}
return newChildren;
}
getInitialStyle() {
return {
roundedInputGroup: {
borderWidth: this.props.rounded
? variables.borderWidth * 2
: undefined,
borderRadius: this.props.rounded
? variables.inputGroupRoundedBorderRadius
: undefined
}
};
}
prepareRootProps() {
const defaultProps = {
style: this.getInitialStyle().roundedInputGroup
};
return computeProps(this.props, defaultProps);
}
render() {
return (
<TouchableOpacity
ref={c => (this._root = c)}
{...this.prepareRootProps()}
activeOpacity={1}
>
{this.renderChildren()}
</TouchableOpacity>
);
}
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/8368ee0627076abfc66e08706bfc3274257ea849
|
src/basic/Item.js
|
import { PanResponder, Platform } from 'react-native';
|
<mask> import React from 'react';
<mask> import { PanResponder, View, Platform } from 'react-native';
<mask> import {
<mask> FormControlContext,
<mask> IFormControlContext,
<mask> } from '../../composites/FormControl';
<mask> import Box from '../Box';
</s> fix: moved a11y props to Box </s> remove <Box
position="relative"
display="flex"
my={3}
justifyContent="center"
alignItems="center"
minHeight={3}
minWidth="100%"
{...this.props}
onLayout={this.onBarLayout}
opacity={this.props.isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web' && this.props.isDisabled
? {
disabled: this.props.isDisabled,
cursor: this.props.isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
{this.state.barSize && this.props.children}
</Box>
</SliderContext.Provider>
</View>
</s> add {this.state.barSize && this.props.children}
</Box>
</SliderContext.Provider> </s> remove accessibilityHint={this.props.accessibilityHint}
accessibilityActions={[
{
name: 'increment',
label: 'Increment',
},
{
name: 'decrement',
label: 'Decrement',
},
]}
onAccessibilityAction={this.onAccessibilityAction}
</s> add </s> remove <SliderContext.Provider
value={{
sliderOffset,
trackColor: this.props.trackColor,
colorScheme: this.props.activeColor,
barSize: this.state.barSize,
panResponder: this.panResponder,
isReversed: this.props.isReversed,
thumbSize: this.props.thumbSize,
sliderSize: this.props.sliderSize,
orientation: this.props.orientation,
isDisabled: this.props.isDisabled,
value: this.state.value,
</s> add <Box
position="relative"
display="flex"
my={3}
justifyContent="center"
alignItems="center"
minHeight={3}
minWidth="100%"
{...this.props}
onLayout={this.onBarLayout}
opacity={this.props.isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web' && this.props.isDisabled
? {
disabled: this.props.isDisabled,
cursor: this.props.isDisabled ? 'not-allowed' : 'auto',
}
: {})}
//A11y props
accessible
accessibilityRole="adjustable"
accessibilityLabel={this.props.accessibilityLabel ?? 'Slider'}
accessibilityValue={{
min,
max,
now: value, </s> remove <View
accessible
accessibilityRole="adjustable"
accessibilityLabel={this.props.accessibilityLabel ?? 'Slider'}
accessibilityValue={{
min,
max,
now: value,
</s> add <SliderContext.Provider
value={{
sliderOffset,
trackColor: this.props.trackColor,
colorScheme: this.props.activeColor,
barSize: this.state.barSize,
panResponder: this.panResponder,
isReversed: this.props.isReversed,
thumbSize: this.props.thumbSize,
sliderSize: this.props.sliderSize,
orientation: this.props.orientation,
isDisabled: this.props.isDisabled,
value: this.state.value,
|
[
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/83b08f134e652a7a60e4c60cc9bdec1a90c2dabd
|
src/components/primitives/Slider/Slider.tsx
|
<SliderContext.Provider
value={{
sliderOffset,
trackColor: this.props.trackColor,
colorScheme: this.props.activeColor,
barSize: this.state.barSize,
panResponder: this.panResponder,
isReversed: this.props.isReversed,
thumbSize: this.props.thumbSize,
sliderSize: this.props.sliderSize,
orientation: this.props.orientation,
isDisabled: this.props.isDisabled,
value: this.state.value,
|
<mask> barSize
<mask> );
<mask>
<mask> return (
<mask> <View
<mask> accessible
<mask> accessibilityRole="adjustable"
<mask> accessibilityLabel={this.props.accessibilityLabel ?? 'Slider'}
<mask> accessibilityValue={{
<mask> min,
<mask> max,
<mask> now: value,
<mask> }}
<mask> accessibilityHint={this.props.accessibilityHint}
<mask> accessibilityActions={[
<mask> {
<mask> name: 'increment',
</s> fix: moved a11y props to Box </s> remove <SliderContext.Provider
value={{
sliderOffset,
trackColor: this.props.trackColor,
colorScheme: this.props.activeColor,
barSize: this.state.barSize,
panResponder: this.panResponder,
isReversed: this.props.isReversed,
thumbSize: this.props.thumbSize,
sliderSize: this.props.sliderSize,
orientation: this.props.orientation,
isDisabled: this.props.isDisabled,
value: this.state.value,
</s> add <Box
position="relative"
display="flex"
my={3}
justifyContent="center"
alignItems="center"
minHeight={3}
minWidth="100%"
{...this.props}
onLayout={this.onBarLayout}
opacity={this.props.isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web' && this.props.isDisabled
? {
disabled: this.props.isDisabled,
cursor: this.props.isDisabled ? 'not-allowed' : 'auto',
}
: {})}
//A11y props
accessible
accessibilityRole="adjustable"
accessibilityLabel={this.props.accessibilityLabel ?? 'Slider'}
accessibilityValue={{
min,
max,
now: value, </s> remove accessibilityHint={this.props.accessibilityHint}
accessibilityActions={[
{
name: 'increment',
label: 'Increment',
},
{
name: 'decrement',
label: 'Decrement',
},
]}
onAccessibilityAction={this.onAccessibilityAction}
</s> add </s> remove <Box
position="relative"
display="flex"
my={3}
justifyContent="center"
alignItems="center"
minHeight={3}
minWidth="100%"
{...this.props}
onLayout={this.onBarLayout}
opacity={this.props.isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web' && this.props.isDisabled
? {
disabled: this.props.isDisabled,
cursor: this.props.isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
{this.state.barSize && this.props.children}
</Box>
</SliderContext.Provider>
</View>
</s> add {this.state.barSize && this.props.children}
</Box>
</SliderContext.Provider> </s> remove import { PanResponder, View, Platform } from 'react-native';
</s> add import { PanResponder, Platform } from 'react-native';
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/83b08f134e652a7a60e4c60cc9bdec1a90c2dabd
|
src/components/primitives/Slider/Slider.tsx
|
<mask> min,
<mask> max,
<mask> now: value,
<mask> }}
<mask> accessibilityHint={this.props.accessibilityHint}
<mask> accessibilityActions={[
<mask> {
<mask> name: 'increment',
<mask> label: 'Increment',
<mask> },
<mask> {
<mask> name: 'decrement',
<mask> label: 'Decrement',
<mask> },
<mask> ]}
<mask> onAccessibilityAction={this.onAccessibilityAction}
<mask> >
<mask> <SliderContext.Provider
<mask> value={{
<mask> sliderOffset,
<mask> trackColor: this.props.trackColor,
</s> fix: moved a11y props to Box </s> remove <View
accessible
accessibilityRole="adjustable"
accessibilityLabel={this.props.accessibilityLabel ?? 'Slider'}
accessibilityValue={{
min,
max,
now: value,
</s> add <SliderContext.Provider
value={{
sliderOffset,
trackColor: this.props.trackColor,
colorScheme: this.props.activeColor,
barSize: this.state.barSize,
panResponder: this.panResponder,
isReversed: this.props.isReversed,
thumbSize: this.props.thumbSize,
sliderSize: this.props.sliderSize,
orientation: this.props.orientation,
isDisabled: this.props.isDisabled,
value: this.state.value, </s> remove <SliderContext.Provider
value={{
sliderOffset,
trackColor: this.props.trackColor,
colorScheme: this.props.activeColor,
barSize: this.state.barSize,
panResponder: this.panResponder,
isReversed: this.props.isReversed,
thumbSize: this.props.thumbSize,
sliderSize: this.props.sliderSize,
orientation: this.props.orientation,
isDisabled: this.props.isDisabled,
value: this.state.value,
</s> add <Box
position="relative"
display="flex"
my={3}
justifyContent="center"
alignItems="center"
minHeight={3}
minWidth="100%"
{...this.props}
onLayout={this.onBarLayout}
opacity={this.props.isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web' && this.props.isDisabled
? {
disabled: this.props.isDisabled,
cursor: this.props.isDisabled ? 'not-allowed' : 'auto',
}
: {})}
//A11y props
accessible
accessibilityRole="adjustable"
accessibilityLabel={this.props.accessibilityLabel ?? 'Slider'}
accessibilityValue={{
min,
max,
now: value, </s> remove <Box
position="relative"
display="flex"
my={3}
justifyContent="center"
alignItems="center"
minHeight={3}
minWidth="100%"
{...this.props}
onLayout={this.onBarLayout}
opacity={this.props.isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web' && this.props.isDisabled
? {
disabled: this.props.isDisabled,
cursor: this.props.isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
{this.state.barSize && this.props.children}
</Box>
</SliderContext.Provider>
</View>
</s> add {this.state.barSize && this.props.children}
</Box>
</SliderContext.Provider> </s> remove import { PanResponder, View, Platform } from 'react-native';
</s> add import { PanResponder, Platform } from 'react-native';
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/83b08f134e652a7a60e4c60cc9bdec1a90c2dabd
|
src/components/primitives/Slider/Slider.tsx
|
|
<Box
position="relative"
display="flex"
my={3}
justifyContent="center"
alignItems="center"
minHeight={3}
minWidth="100%"
{...this.props}
onLayout={this.onBarLayout}
opacity={this.props.isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web' && this.props.isDisabled
? {
disabled: this.props.isDisabled,
cursor: this.props.isDisabled ? 'not-allowed' : 'auto',
}
: {})}
//A11y props
accessible
accessibilityRole="adjustable"
accessibilityLabel={this.props.accessibilityLabel ?? 'Slider'}
accessibilityValue={{
min,
max,
now: value,
|
<mask> },
<mask> ]}
<mask> onAccessibilityAction={this.onAccessibilityAction}
<mask> >
<mask> <SliderContext.Provider
<mask> value={{
<mask> sliderOffset,
<mask> trackColor: this.props.trackColor,
<mask> colorScheme: this.props.activeColor,
<mask> barSize: this.state.barSize,
<mask> panResponder: this.panResponder,
<mask> isReversed: this.props.isReversed,
<mask> thumbSize: this.props.thumbSize,
<mask> sliderSize: this.props.sliderSize,
<mask> orientation: this.props.orientation,
<mask> isDisabled: this.props.isDisabled,
<mask> value: this.state.value,
<mask> }}
<mask> >
<mask> <Box
<mask> position="relative"
<mask> display="flex"
</s> fix: moved a11y props to Box </s> remove <View
accessible
accessibilityRole="adjustable"
accessibilityLabel={this.props.accessibilityLabel ?? 'Slider'}
accessibilityValue={{
min,
max,
now: value,
</s> add <SliderContext.Provider
value={{
sliderOffset,
trackColor: this.props.trackColor,
colorScheme: this.props.activeColor,
barSize: this.state.barSize,
panResponder: this.panResponder,
isReversed: this.props.isReversed,
thumbSize: this.props.thumbSize,
sliderSize: this.props.sliderSize,
orientation: this.props.orientation,
isDisabled: this.props.isDisabled,
value: this.state.value, </s> remove <Box
position="relative"
display="flex"
my={3}
justifyContent="center"
alignItems="center"
minHeight={3}
minWidth="100%"
{...this.props}
onLayout={this.onBarLayout}
opacity={this.props.isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web' && this.props.isDisabled
? {
disabled: this.props.isDisabled,
cursor: this.props.isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
{this.state.barSize && this.props.children}
</Box>
</SliderContext.Provider>
</View>
</s> add {this.state.barSize && this.props.children}
</Box>
</SliderContext.Provider> </s> remove accessibilityHint={this.props.accessibilityHint}
accessibilityActions={[
{
name: 'increment',
label: 'Increment',
},
{
name: 'decrement',
label: 'Decrement',
},
]}
onAccessibilityAction={this.onAccessibilityAction}
</s> add </s> remove import { PanResponder, View, Platform } from 'react-native';
</s> add import { PanResponder, Platform } from 'react-native';
|
[
"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/83b08f134e652a7a60e4c60cc9bdec1a90c2dabd
|
src/components/primitives/Slider/Slider.tsx
|
accessibilityHint={this.props.accessibilityHint}
accessibilityActions={[
{
name: 'increment',
label: 'Increment',
},
{
name: 'decrement',
label: 'Decrement',
},
]}
onAccessibilityAction={this.onAccessibilityAction}
|
<mask> min,
<mask> max,
<mask> now: value,
<mask> }}
<mask> >
<mask> {this.state.barSize && this.props.children}
<mask> </Box>
<mask> </SliderContext.Provider>
<mask> );
<mask> }
</s> fix: moved a11y props to Box </s> remove <Box
position="relative"
display="flex"
my={3}
justifyContent="center"
alignItems="center"
minHeight={3}
minWidth="100%"
{...this.props}
onLayout={this.onBarLayout}
opacity={this.props.isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web' && this.props.isDisabled
? {
disabled: this.props.isDisabled,
cursor: this.props.isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
{this.state.barSize && this.props.children}
</Box>
</SliderContext.Provider>
</View>
</s> add {this.state.barSize && this.props.children}
</Box>
</SliderContext.Provider> </s> remove accessibilityHint={this.props.accessibilityHint}
accessibilityActions={[
{
name: 'increment',
label: 'Increment',
},
{
name: 'decrement',
label: 'Decrement',
},
]}
onAccessibilityAction={this.onAccessibilityAction}
</s> add </s> remove <SliderContext.Provider
value={{
sliderOffset,
trackColor: this.props.trackColor,
colorScheme: this.props.activeColor,
barSize: this.state.barSize,
panResponder: this.panResponder,
isReversed: this.props.isReversed,
thumbSize: this.props.thumbSize,
sliderSize: this.props.sliderSize,
orientation: this.props.orientation,
isDisabled: this.props.isDisabled,
value: this.state.value,
</s> add <Box
position="relative"
display="flex"
my={3}
justifyContent="center"
alignItems="center"
minHeight={3}
minWidth="100%"
{...this.props}
onLayout={this.onBarLayout}
opacity={this.props.isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web' && this.props.isDisabled
? {
disabled: this.props.isDisabled,
cursor: this.props.isDisabled ? 'not-allowed' : 'auto',
}
: {})}
//A11y props
accessible
accessibilityRole="adjustable"
accessibilityLabel={this.props.accessibilityLabel ?? 'Slider'}
accessibilityValue={{
min,
max,
now: value, </s> remove <View
accessible
accessibilityRole="adjustable"
accessibilityLabel={this.props.accessibilityLabel ?? 'Slider'}
accessibilityValue={{
min,
max,
now: value,
</s> add <SliderContext.Provider
value={{
sliderOffset,
trackColor: this.props.trackColor,
colorScheme: this.props.activeColor,
barSize: this.state.barSize,
panResponder: this.panResponder,
isReversed: this.props.isReversed,
thumbSize: this.props.thumbSize,
sliderSize: this.props.sliderSize,
orientation: this.props.orientation,
isDisabled: this.props.isDisabled,
value: this.state.value, </s> remove import { PanResponder, View, Platform } from 'react-native';
</s> add import { PanResponder, Platform } from 'react-native';
|
[
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/83b08f134e652a7a60e4c60cc9bdec1a90c2dabd
|
src/components/primitives/Slider/Slider.tsx
|
{this.state.barSize && this.props.children}
</Box>
</SliderContext.Provider>
|
<mask> isDisabled: this.props.isDisabled,
<mask> value: this.state.value,
<mask> }}
<mask> >
<mask> <Box
<mask> position="relative"
<mask> display="flex"
<mask> my={3}
<mask> justifyContent="center"
<mask> alignItems="center"
<mask> minHeight={3}
<mask> minWidth="100%"
<mask> {...this.props}
<mask> onLayout={this.onBarLayout}
<mask> opacity={this.props.isDisabled ? 0.4 : 1}
<mask> {...(Platform.OS === 'web' && this.props.isDisabled
<mask> ? {
<mask> disabled: this.props.isDisabled,
<mask> cursor: this.props.isDisabled ? 'not-allowed' : 'auto',
<mask> }
<mask> : {})}
<mask> >
<mask> {this.state.barSize && this.props.children}
<mask> </Box>
<mask> </SliderContext.Provider>
<mask> </View>
<mask> );
<mask> }
<mask> }
<mask>
<mask> const Slider = ({ ...props }: ISliderProps) => {
</s> fix: moved a11y props to Box </s> remove <SliderContext.Provider
value={{
sliderOffset,
trackColor: this.props.trackColor,
colorScheme: this.props.activeColor,
barSize: this.state.barSize,
panResponder: this.panResponder,
isReversed: this.props.isReversed,
thumbSize: this.props.thumbSize,
sliderSize: this.props.sliderSize,
orientation: this.props.orientation,
isDisabled: this.props.isDisabled,
value: this.state.value,
</s> add <Box
position="relative"
display="flex"
my={3}
justifyContent="center"
alignItems="center"
minHeight={3}
minWidth="100%"
{...this.props}
onLayout={this.onBarLayout}
opacity={this.props.isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web' && this.props.isDisabled
? {
disabled: this.props.isDisabled,
cursor: this.props.isDisabled ? 'not-allowed' : 'auto',
}
: {})}
//A11y props
accessible
accessibilityRole="adjustable"
accessibilityLabel={this.props.accessibilityLabel ?? 'Slider'}
accessibilityValue={{
min,
max,
now: value, </s> remove import { PanResponder, View, Platform } from 'react-native';
</s> add import { PanResponder, Platform } from 'react-native'; </s> remove accessibilityHint={this.props.accessibilityHint}
accessibilityActions={[
{
name: 'increment',
label: 'Increment',
},
{
name: 'decrement',
label: 'Decrement',
},
]}
onAccessibilityAction={this.onAccessibilityAction}
</s> add </s> remove <View
accessible
accessibilityRole="adjustable"
accessibilityLabel={this.props.accessibilityLabel ?? 'Slider'}
accessibilityValue={{
min,
max,
now: value,
</s> add <SliderContext.Provider
value={{
sliderOffset,
trackColor: this.props.trackColor,
colorScheme: this.props.activeColor,
barSize: this.state.barSize,
panResponder: this.panResponder,
isReversed: this.props.isReversed,
thumbSize: this.props.thumbSize,
sliderSize: this.props.sliderSize,
orientation: this.props.orientation,
isDisabled: this.props.isDisabled,
value: this.state.value,
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/83b08f134e652a7a60e4c60cc9bdec1a90c2dabd
|
src/components/primitives/Slider/Slider.tsx
|
function flattenChildren(
children: React.ReactNode,
keys: (string | number)[] = []
): ReactChildArray {
|
<mask>
<mask> // Thanks @gregberge for code and @nandorojo for suggestion.
<mask> // Original source: https://github.com/gregberge/react-flatten-children
<mask> type ReactChildArray = ReturnType<typeof React.Children.toArray>;
<mask> function flattenChildren(children: React.ReactNode): ReactChildArray {
<mask> const childrenArray = React.Children.toArray(children);
<mask> return childrenArray.reduce((flatChildren: ReactChildArray, child) => {
<mask> if ((child as React.ReactElement<any>).type === React.Fragment) {
<mask> return flatChildren.concat(
<mask> flattenChildren((child as React.ReactElement<any>).props.children)
</s> fix: fixed same key for multiple children error due to stack flattening </s> remove flatChildren.push(child);
</s> add if (React.isValidElement(child)) {
flatChildren.push(
React.cloneElement(child, {
key: keys.concat(String(child.key || index)).join('.')
})
);
} else {
flatChildren.push(child);
} </s> remove flattenChildren((child as React.ReactElement<any>).props.children)
</s> add flattenChildren(
(child as React.ReactElement<any>).props.children,
keys.concat(child.key || index)
) </s> remove return childrenArray.reduce((flatChildren: ReactChildArray, child) => {
</s> add return childrenArray.reduce((flatChildren: ReactChildArray, child, index: number) => {
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/849e1bee8803d6740e8e55668d1470a5ddf79c6f
|
src/utils/getSpacedChildren.tsx
|
return childrenArray.reduce((flatChildren: ReactChildArray, child, index: number) => {
|
<mask> // Original source: https://github.com/gregberge/react-flatten-children
<mask> type ReactChildArray = ReturnType<typeof React.Children.toArray>;
<mask> function flattenChildren(children: React.ReactNode): ReactChildArray {
<mask> const childrenArray = React.Children.toArray(children);
<mask> return childrenArray.reduce((flatChildren: ReactChildArray, child) => {
<mask> if ((child as React.ReactElement<any>).type === React.Fragment) {
<mask> return flatChildren.concat(
<mask> flattenChildren((child as React.ReactElement<any>).props.children)
<mask> );
<mask> }
</s> fix: fixed same key for multiple children error due to stack flattening </s> remove flatChildren.push(child);
</s> add if (React.isValidElement(child)) {
flatChildren.push(
React.cloneElement(child, {
key: keys.concat(String(child.key || index)).join('.')
})
);
} else {
flatChildren.push(child);
} </s> remove function flattenChildren(children: React.ReactNode): ReactChildArray {
</s> add function flattenChildren(
children: React.ReactNode,
keys: (string | number)[] = []
): ReactChildArray { </s> remove flattenChildren((child as React.ReactElement<any>).props.children)
</s> add flattenChildren(
(child as React.ReactElement<any>).props.children,
keys.concat(child.key || index)
)
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/849e1bee8803d6740e8e55668d1470a5ddf79c6f
|
src/utils/getSpacedChildren.tsx
|
flattenChildren(
(child as React.ReactElement<any>).props.children,
keys.concat(child.key || index)
)
|
<mask> const childrenArray = React.Children.toArray(children);
<mask> return childrenArray.reduce((flatChildren: ReactChildArray, child) => {
<mask> if ((child as React.ReactElement<any>).type === React.Fragment) {
<mask> return flatChildren.concat(
<mask> flattenChildren((child as React.ReactElement<any>).props.children)
<mask> );
<mask> }
<mask> flatChildren.push(child);
<mask> return flatChildren;
<mask> }, []);
</s> fix: fixed same key for multiple children error due to stack flattening </s> remove flatChildren.push(child);
</s> add if (React.isValidElement(child)) {
flatChildren.push(
React.cloneElement(child, {
key: keys.concat(String(child.key || index)).join('.')
})
);
} else {
flatChildren.push(child);
} </s> remove function flattenChildren(children: React.ReactNode): ReactChildArray {
</s> add function flattenChildren(
children: React.ReactNode,
keys: (string | number)[] = []
): ReactChildArray { </s> remove return childrenArray.reduce((flatChildren: ReactChildArray, child) => {
</s> add return childrenArray.reduce((flatChildren: ReactChildArray, child, index: number) => {
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/849e1bee8803d6740e8e55668d1470a5ddf79c6f
|
src/utils/getSpacedChildren.tsx
|
if (React.isValidElement(child)) {
flatChildren.push(
React.cloneElement(child, {
key: keys.concat(String(child.key || index)).join('.')
})
);
} else {
flatChildren.push(child);
}
|
<mask> return flatChildren.concat(
<mask> flattenChildren((child as React.ReactElement<any>).props.children)
<mask> );
<mask> }
<mask> flatChildren.push(child);
<mask> return flatChildren;
<mask> }, []);
<mask> }
<mask>
<mask> const getSpacedChildren = (
</s> fix: fixed same key for multiple children error due to stack flattening </s> remove function flattenChildren(children: React.ReactNode): ReactChildArray {
</s> add function flattenChildren(
children: React.ReactNode,
keys: (string | number)[] = []
): ReactChildArray { </s> remove return childrenArray.reduce((flatChildren: ReactChildArray, child) => {
</s> add return childrenArray.reduce((flatChildren: ReactChildArray, child, index: number) => { </s> remove flattenChildren((child as React.ReactElement<any>).props.children)
</s> add flattenChildren(
(child as React.ReactElement<any>).props.children,
keys.concat(child.key || index)
)
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/849e1bee8803d6740e8e55668d1470a5ddf79c6f
|
src/utils/getSpacedChildren.tsx
|
"test": "node_modules/.bin/jest",
|
<mask> "navbar",
<mask> "packager"
<mask> ],
<mask> "scripts": {
<mask> "test": "jest",
<mask> "typescript": "tsc --noEmit",
<mask> "lint": "eslint \"**/*.{js,ts,tsx}\"",
<mask> "prepare": "bob build",
<mask> "release": "release-it",
<mask> "example": "yarn --cwd example",
</s> Added testing setup for hooks </s> remove "lib": [
"esnext",
"dom"
],
</s> add "lib": ["esnext", "dom"], </s> remove "native-base": [
"./src/index"
]
</s> add "native-base": ["./src/index"]
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/84faae2b2e6f208de14a2ce0ed7c9ad217ba7217
|
package.json
|
"@testing-library/react-hooks": "^4.0.0",
|
<mask> "@expo/vector-icons": "^12.0.2",
<mask> "@react-native-community/bob": "^0.16.2",
<mask> "@react-native-community/eslint-config": "^2.0.0",
<mask> "@release-it/conventional-changelog": "^1.1.4",
<mask> "@types/jest": "^26.0.0",
<mask> "@types/lodash": "^4.14.162",
<mask> "@types/react": "^16.9.19",
<mask> "@types/react-native": "0.62.13",
<mask> "@types/react-native-vector-icons": "^6.4.6",
<mask> "@types/styled-system": "^5.1.9",
</s> Added testing setup for hooks </s> remove } </s> add </s> remove "lib": [
"esnext",
"dom"
],
</s> add "lib": ["esnext", "dom"], </s> remove "native-base": [
"./src/index"
]
</s> add "native-base": ["./src/index"]
|
[
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/84faae2b2e6f208de14a2ce0ed7c9ad217ba7217
|
package.json
|
"jest-expo": "^40.0.1",
|
<mask> "husky": "^4.2.5",
<mask> "jest": "^26.0.1",
<mask> "metro-react-native-babel-preset": "^0.64.0",
<mask> "pod-install": "^0.1.0",
<mask> "prettier": "^2.0.5",
<mask> "react": "16.11.0",
<mask> "react-native": "0.62.2",
</s> Added testing setup for hooks </s> remove "preset": "react-native",
</s> add "preset": "jest-expo",
|
[
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/84faae2b2e6f208de14a2ce0ed7c9ad217ba7217
|
package.json
|
"react-test-renderer": "^16.9.0",
|
<mask> "react": "16.11.0",
<mask> "react-native": "0.62.2",
<mask> "react-native-svg": "^12.1.0",
<mask> "react-native-vector-icons": "^7.1.0",
<mask> "release-it": "^13.5.8",
<mask> "rollup": "^2.34.1",
<mask> "rollup-plugin-flow": "^1.1.1",
<mask> "styled-components": "^5.2.1",
<mask> "typescript": "^3.8.3",
<mask> "visualize-bundle": "^1.4.0"
</s> Added testing setup for hooks </s> remove "preset": "react-native",
</s> add "preset": "jest-expo", </s> remove "test": "jest",
</s> add "test": "node_modules/.bin/jest",
|
[
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/84faae2b2e6f208de14a2ce0ed7c9ad217ba7217
|
package.json
|
"styled-components": "^5.2.1",
|
<mask> "rollup": "^2.34.1",
<mask> "rollup-plugin-flow": "^1.1.1",
<mask> "typescript": "^3.8.3",
<mask> "visualize-bundle": "^1.4.0"
<mask> },
<mask> "peerDependencies": {
<mask> "@expo/vector-icons": "^12.0.2",
<mask> "react": "16.11.0",
</s> Added testing setup for hooks </s> remove "preset": "react-native",
</s> add "preset": "jest-expo", </s> remove "native-base": [
"./src/index"
]
</s> add "native-base": ["./src/index"]
|
[
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/84faae2b2e6f208de14a2ce0ed7c9ad217ba7217
|
package.json
|
"preset": "jest-expo",
|
<mask> "styled-components": "^5.2.1",
<mask> "styled-system": "*"
<mask> },
<mask> "jest": {
<mask> "preset": "react-native",
<mask> "modulePathIgnorePatterns": [
<mask> "<rootDir>/example/node_modules",
<mask> "<rootDir>/lib/"
<mask> ]
<mask> },
</s> Added testing setup for hooks </s> remove "native-base": [
"./src/index"
]
</s> add "native-base": ["./src/index"]
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/84faae2b2e6f208de14a2ce0ed7c9ad217ba7217
|
package.json
|
],
"transformIgnorePatterns": [
"node_modules/(?!(react-native|styled-components|expo-constants|@unimodules|react-native-unimodules|expo-font|react-native-svg|@expo/vector-icons|styled-system|react-native-vector-icons)/)"
],
"setupFiles": [
"<rootDir>/src/jest/mock.ts"
|
<mask> "modulePathIgnorePatterns": [
<mask> "<rootDir>/example/node_modules",
<mask> "<rootDir>/lib/"
<mask> ]
<mask> },
<mask> "husky": {
<mask> "hooks": {
<mask> "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
<mask> "pre-commit": "yarn lint && yarn typescript"
</s> Added testing setup for hooks </s> remove "preset": "react-native",
</s> add "preset": "jest-expo", </s> remove "native-base": [
"./src/index"
]
</s> add "native-base": ["./src/index"] </s> remove "test": "jest",
</s> add "test": "node_modules/.bin/jest",
|
[
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/84faae2b2e6f208de14a2ce0ed7c9ad217ba7217
|
package.json
|
export function useCalculateProps(
|
<mask> extractInObject,
<mask> } from './../theme/tools/';
<mask> import { filterShadowProps } from './../utils/filterShadowProps';
<mask>
<mask> function useCalculateProps(
<mask> theme: any,
<mask> colorModeProps: any,
<mask> componentTheme: any,
<mask> propsReceived: any
<mask> ) {
</s> Added testing setup for hooks </s> remove omit(theme, ['component']),
</s> add omit(theme, ['components']), </s> remove omit(theme, ['component']),
</s> add omit(theme, ['components']), </s> remove } </s> add </s> remove "native-base": [
"./src/index"
]
</s> add "native-base": ["./src/index"]
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/84faae2b2e6f208de14a2ce0ed7c9ad217ba7217
|
src/hooks/usePropsConfig.ts
|
omit(theme, ['components']),
|
<mask> propsReceived: any
<mask> ) {
<mask> const { theme, ...colorModeProps } = useNativeBase();
<mask> return useCalculateProps(
<mask> omit(theme, ['component']),
<mask> colorModeProps,
<mask> localTheme,
<mask> propsReceived
<mask> );
<mask> }
</s> Added testing setup for hooks </s> remove omit(theme, ['component']),
</s> add omit(theme, ['components']), </s> remove function useCalculateProps(
</s> add export function useCalculateProps( </s> remove } </s> add </s> remove "native-base": [
"./src/index"
]
</s> add "native-base": ["./src/index"]
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/84faae2b2e6f208de14a2ce0ed7c9ad217ba7217
|
src/hooks/usePropsConfig.ts
|
omit(theme, ['components']),
|
<mask> export function usePropsConfig(component: string, propsReceived: any) {
<mask> const { theme, ...colorModeProps } = useNativeBase();
<mask> const componentTheme = get(theme, `components.${component}`);
<mask> return useCalculateProps(
<mask> omit(theme, ['component']),
<mask> colorModeProps,
<mask> componentTheme,
<mask> propsReceived
<mask> );
<mask> }
</s> Added testing setup for hooks </s> remove omit(theme, ['component']),
</s> add omit(theme, ['components']), </s> remove function useCalculateProps(
</s> add export function useCalculateProps( </s> remove } </s> add </s> remove "native-base": [
"./src/index"
]
</s> add "native-base": ["./src/index"]
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/84faae2b2e6f208de14a2ce0ed7c9ad217ba7217
|
src/hooks/usePropsConfig.ts
|
"native-base": ["./src/index"]
|
<mask> {
<mask> "compilerOptions": {
<mask> "baseUrl": ".",
<mask> "paths": {
<mask> "native-base": [
<mask> "./src/index"
<mask> ]
<mask> },
<mask> "allowUnreachableCode": false,
<mask> "allowUnusedLabels": false,
<mask> "esModuleInterop": true,
<mask> "importsNotUsedAsValues": "error",
</s> Added testing setup for hooks </s> remove "lib": [
"esnext",
"dom"
],
</s> add "lib": ["esnext", "dom"], </s> remove "preset": "react-native",
</s> add "preset": "jest-expo", </s> remove omit(theme, ['component']),
</s> add omit(theme, ['components']),
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/84faae2b2e6f208de14a2ce0ed7c9ad217ba7217
|
tsconfig.json
|
"lib": ["esnext", "dom"],
|
<mask> "esModuleInterop": true,
<mask> "importsNotUsedAsValues": "error",
<mask> "forceConsistentCasingInFileNames": true,
<mask> "jsx": "react",
<mask> "lib": [
<mask> "esnext",
<mask> "dom"
<mask> ],
<mask> "module": "esnext",
<mask> "moduleResolution": "node",
<mask> "noFallthroughCasesInSwitch": true,
<mask> "noImplicitReturns": true,
<mask> "noImplicitUseStrict": false,
</s> Added testing setup for hooks </s> remove "native-base": [
"./src/index"
]
</s> add "native-base": ["./src/index"] </s> remove } </s> add </s> remove "test": "jest",
</s> add "test": "node_modules/.bin/jest",
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/84faae2b2e6f208de14a2ce0ed7c9ad217ba7217
|
tsconfig.json
|
<mask> "skipLibCheck": true,
<mask> "strict": true,
<mask> "target": "esnext"
<mask> }
<mask> } </s> Added testing setup for hooks </s> remove "lib": [
"esnext",
"dom"
],
</s> add "lib": ["esnext", "dom"], </s> remove "native-base": [
"./src/index"
]
</s> add "native-base": ["./src/index"] </s> remove omit(theme, ['component']),
</s> add omit(theme, ['components']), </s> remove function useCalculateProps(
</s> add export function useCalculateProps(
|
[
"keep",
"keep",
"keep",
"keep",
"replace"
] |
https://github.com/GeekyAnts/NativeBase/commit/84faae2b2e6f208de14a2ce0ed7c9ad217ba7217
|
tsconfig.json
|
|
}
|
<mask> "strict": true,
<mask> "target": "esnext"
<mask> }
<mask> }
</s> Added testing setup for hooks </s> remove } </s> add </s> remove omit(theme, ['component']),
</s> add omit(theme, ['components']), </s> remove "lib": [
"esnext",
"dom"
],
</s> add "lib": ["esnext", "dom"], </s> remove function useCalculateProps(
</s> add export function useCalculateProps( </s> remove omit(theme, ['component']),
</s> add omit(theme, ['components']),
|
[
"keep",
"keep",
"keep",
"add"
] |
https://github.com/GeekyAnts/NativeBase/commit/84faae2b2e6f208de14a2ce0ed7c9ad217ba7217
|
tsconfig.json
|
({ children, state, ...props }: P & FactoryComponentProps, ref: any) => {
|
<mask> Component: React.ComponentType<P>,
<mask> componentTheme?: ComponentTheme
<mask> ) {
<mask> return React.forwardRef(
<mask> ({ children, ...props }: P & FactoryComponentProps, ref: any) => {
<mask> const StyledComponent = useMemo(() => makeStyledComponent(Component), []);
<mask> const calculatedProps = usePropsWithComponentTheme(
<mask> componentTheme ?? {},
<mask> props
<mask> );
</s> feat: factory with state props </s> remove props
</s> add props,
state </s> remove propsReceived: any
</s> add propsReceived: any,
state: IStateProps </s> remove return usePropsResolutionWithComponentTheme(localTheme, propsReceived);
</s> add return usePropsResolutionWithComponentTheme(localTheme, propsReceived, state);
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/85883238aa7a63246ce5192ca6679f75859d8a1b
|
src/factory/component.tsx
|
props,
state
|
<mask> ({ children, ...props }: P & FactoryComponentProps, ref: any) => {
<mask> const StyledComponent = useMemo(() => makeStyledComponent(Component), []);
<mask> const calculatedProps = usePropsWithComponentTheme(
<mask> componentTheme ?? {},
<mask> props
<mask> );
<mask> return (
<mask> <StyledComponent {...(calculatedProps as P)} ref={ref}>
<mask> {children}
<mask> </StyledComponent>
</s> feat: factory with state props </s> remove ({ children, ...props }: P & FactoryComponentProps, ref: any) => {
</s> add ({ children, state, ...props }: P & FactoryComponentProps, ref: any) => { </s> remove return usePropsResolutionWithComponentTheme(localTheme, propsReceived);
</s> add return usePropsResolutionWithComponentTheme(localTheme, propsReceived, state); </s> remove propsReceived: any
</s> add propsReceived: any,
state: IStateProps
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/85883238aa7a63246ce5192ca6679f75859d8a1b
|
src/factory/component.tsx
|
import type { IStateProps } from '../hooks/useThemeProps/propsFlattener';
|
<mask> import type { PlatformProps } from '../components/types';
<mask> import type { StyledProps } from '../theme/types';
<mask>
<mask> export type FactoryComponentProps = StyledProps &
<mask> PlatformProps<StyledProps> & {
<mask> children?: string | JSX.Element | JSX.Element[];
</s> feat: factory with state props </s> remove propsReceived: any
</s> add propsReceived: any,
state: IStateProps </s> remove ({ children, ...props }: P & FactoryComponentProps, ref: any) => {
</s> add ({ children, state, ...props }: P & FactoryComponentProps, ref: any) => { </s> remove return usePropsResolutionWithComponentTheme(localTheme, propsReceived);
</s> add return usePropsResolutionWithComponentTheme(localTheme, propsReceived, state);
|
[
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/85883238aa7a63246ce5192ca6679f75859d8a1b
|
src/factory/types.ts
|
state: IStateProps;
|
<mask>
<mask> export type FactoryComponentProps = StyledProps &
<mask> PlatformProps<StyledProps> & {
<mask> children?: string | JSX.Element | JSX.Element[];
<mask> };
</s> feat: factory with state props </s> remove ({ children, ...props }: P & FactoryComponentProps, ref: any) => {
</s> add ({ children, state, ...props }: P & FactoryComponentProps, ref: any) => { </s> remove props
</s> add props,
state </s> remove propsReceived: any
</s> add propsReceived: any,
state: IStateProps
|
[
"keep",
"keep",
"keep",
"add",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/85883238aa7a63246ce5192ca6679f75859d8a1b
|
src/factory/types.ts
|
import type { IStateProps } from './propsFlattener';
|
<mask> import { usePropsResolutionWithComponentTheme } from './usePropsResolution';
<mask> import type { ComponentTheme } from '../../theme';
<mask>
<mask> export function usePropsWithComponentTheme(
<mask> localTheme: ComponentTheme,
<mask> propsReceived: any,
</s> feat: factory with state props </s> remove propsReceived: any
</s> add propsReceived: any,
state: IStateProps </s> remove return usePropsResolutionWithComponentTheme(localTheme, propsReceived);
</s> add return usePropsResolutionWithComponentTheme(localTheme, propsReceived, state); </s> remove ({ children, ...props }: P & FactoryComponentProps, ref: any) => {
</s> add ({ children, state, ...props }: P & FactoryComponentProps, ref: any) => {
|
[
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/85883238aa7a63246ce5192ca6679f75859d8a1b
|
src/hooks/useThemeProps/usePropsWithComponentTheme.ts
|
propsReceived: any,
state: IStateProps
|
<mask> import type { ComponentTheme } from '../../theme';
<mask>
<mask> export function usePropsWithComponentTheme(
<mask> localTheme: ComponentTheme,
<mask> propsReceived: any
<mask> ) {
<mask> return usePropsResolutionWithComponentTheme(localTheme, propsReceived);
<mask> }
</s> feat: factory with state props </s> remove return usePropsResolutionWithComponentTheme(localTheme, propsReceived);
</s> add return usePropsResolutionWithComponentTheme(localTheme, propsReceived, state); </s> remove ({ children, ...props }: P & FactoryComponentProps, ref: any) => {
</s> add ({ children, state, ...props }: P & FactoryComponentProps, ref: any) => {
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/85883238aa7a63246ce5192ca6679f75859d8a1b
|
src/hooks/useThemeProps/usePropsWithComponentTheme.ts
|
return usePropsResolutionWithComponentTheme(localTheme, propsReceived, state);
|
<mask> export function usePropsWithComponentTheme(
<mask> localTheme: ComponentTheme,
<mask> propsReceived: any
<mask> ) {
<mask> return usePropsResolutionWithComponentTheme(localTheme, propsReceived);
<mask> }
</s> feat: factory with state props </s> remove propsReceived: any
</s> add propsReceived: any,
state: IStateProps </s> remove ({ children, ...props }: P & FactoryComponentProps, ref: any) => {
</s> add ({ children, state, ...props }: P & FactoryComponentProps, ref: any) => { </s> remove props
</s> add props,
state
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/85883238aa7a63246ce5192ca6679f75859d8a1b
|
src/hooks/useThemeProps/usePropsWithComponentTheme.ts
|
<mask> import { useHover } from '@react-native-aria/interactions';
<mask> import { mergeRefs } from '../../../utils/mergeRefs';
<mask> import { makeStyledComponent } from '../../../utils/styled';
<mask> import { useResolvedFontFamily } from '../../../hooks/useResolvedFontFamily';
<mask> import { useToken } from '../../../hooks/useToken';
<mask> const StyledText = makeStyledComponent(NativeText);
<mask>
<mask> const Text = ({ children, ...props }: ITextProps, ref: any) => {
<mask> const {
<mask> isTruncated,
</s> fix: revert em conversion tokens </s> remove import Text from '../../components/primitives/Text';
</s> add </s> remove it('tests lineHeight from token in text ', () => {
const { getByTestId } = render(
<Provider>
<Text lineHeight="md" testID="test">
This is a text
</Text>
</Provider>
);
const text = getByTestId('test');
expect(text.props.style.lineHeight).toBe(22);
});
it('tests absolute lineHeight in text ', () => {
const { getByTestId } = render(
<Provider>
<Text lineHeight={5} testID="test">
This is a text
</Text>
</Provider>
);
const text = getByTestId('test');
expect(text.props.style.lineHeight).toBe(80);
});
it('tests letterSpacing from token in text ', () => {
const { getByTestId } = render(
<Provider>
<Text letterSpacing="2xl" testID="test">
This is a text
</Text>
</Provider>
);
const text = getByTestId('test');
expect(text.props.style.letterSpacing).toBe(6.4);
});
</s> add </s> remove
const [lineHeightValue] = useToken('lineHeights', [lineHeight]);
const [fontSizeValue] = useToken('fontSizes', [fontSize]);
const [letterSpacingValue] = useToken('letterSpacings', [letterSpacing]);
const calculatedLineHeightWithUnits = React.useMemo(() => {
//lineheight calculations
let calculatedLineHeight =
parseFloat(lineHeightValue) * parseFloat(fontSizeValue);
return typeof fontSizeValue === 'string'
? fontSizeValue.includes('rem')
? calculatedLineHeight + 'rem'
: fontSizeValue.includes('px')
? calculatedLineHeight + 'px'
: calculatedLineHeight
: calculatedLineHeight;
}, [fontSizeValue, lineHeightValue]);
const calculatedLetterSpacingWithUnits = React.useMemo(() => {
//letter-spacing calculations
let calculatedLetterSpacing =
parseFloat(letterSpacingValue) * parseFloat(fontSizeValue);
return typeof fontSizeValue === 'string'
? fontSizeValue.includes('rem')
? calculatedLetterSpacing + 'rem'
: fontSizeValue.includes('px')
? calculatedLetterSpacing + 'px'
: calculatedLetterSpacing
: calculatedLetterSpacing;
}, [fontSizeValue, letterSpacingValue]);
</s> add </s> remove lineHeight = '2xs',
letterSpacing = 'sm',
</s> add </s> remove '2xs': 1,
'xs': 1.125,
'sm': 1.25,
'md': 1.375,
'lg': 1.5,
'xl': 1.75,
'2xl': 2,
'3xl': 2.5,
'4xl': 3,
'5xl': 4,
</s> add '2xs': 16,
'xs': 18,
'sm': 20,
'md': 22,
'lg': 24,
'xl': 28,
'2xl': 32,
'3xl': 40,
'4xl': 48,
'5xl': 64,
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/859dec46f6e71eb9e0955ce257f07b4fe9f83150
|
src/components/primitives/Text/index.tsx
|
|
<mask> fontWeight: propFontWeight,
<mask> fontStyle: propFontStyle,
<mask> _hover,
<mask> fontSize = 'md',
<mask> lineHeight = '2xs',
<mask> letterSpacing = 'sm',
<mask> ...reslovedProps
<mask> } = usePropsResolution('Text', props);
<mask>
<mask> const _ref = useRef(null);
<mask>
</s> fix: revert em conversion tokens </s> remove
const [lineHeightValue] = useToken('lineHeights', [lineHeight]);
const [fontSizeValue] = useToken('fontSizes', [fontSize]);
const [letterSpacingValue] = useToken('letterSpacings', [letterSpacing]);
const calculatedLineHeightWithUnits = React.useMemo(() => {
//lineheight calculations
let calculatedLineHeight =
parseFloat(lineHeightValue) * parseFloat(fontSizeValue);
return typeof fontSizeValue === 'string'
? fontSizeValue.includes('rem')
? calculatedLineHeight + 'rem'
: fontSizeValue.includes('px')
? calculatedLineHeight + 'px'
: calculatedLineHeight
: calculatedLineHeight;
}, [fontSizeValue, lineHeightValue]);
const calculatedLetterSpacingWithUnits = React.useMemo(() => {
//letter-spacing calculations
let calculatedLetterSpacing =
parseFloat(letterSpacingValue) * parseFloat(fontSizeValue);
return typeof fontSizeValue === 'string'
? fontSizeValue.includes('rem')
? calculatedLetterSpacing + 'rem'
: fontSizeValue.includes('px')
? calculatedLetterSpacing + 'px'
: calculatedLetterSpacing
: calculatedLetterSpacing;
}, [fontSizeValue, letterSpacingValue]);
</s> add </s> remove it('tests lineHeight from token in text ', () => {
const { getByTestId } = render(
<Provider>
<Text lineHeight="md" testID="test">
This is a text
</Text>
</Provider>
);
const text = getByTestId('test');
expect(text.props.style.lineHeight).toBe(22);
});
it('tests absolute lineHeight in text ', () => {
const { getByTestId } = render(
<Provider>
<Text lineHeight={5} testID="test">
This is a text
</Text>
</Provider>
);
const text = getByTestId('test');
expect(text.props.style.lineHeight).toBe(80);
});
it('tests letterSpacing from token in text ', () => {
const { getByTestId } = render(
<Provider>
<Text letterSpacing="2xl" testID="test">
This is a text
</Text>
</Provider>
);
const text = getByTestId('test');
expect(text.props.style.letterSpacing).toBe(6.4);
});
</s> add </s> remove import { useToken } from '../../../hooks/useToken';
</s> add </s> remove import Text from '../../components/primitives/Text';
</s> add </s> remove '2xs': 1,
'xs': 1.125,
'sm': 1.25,
'md': 1.375,
'lg': 1.5,
'xl': 1.75,
'2xl': 2,
'3xl': 2.5,
'4xl': 3,
'5xl': 4,
</s> add '2xs': 16,
'xs': 18,
'sm': 20,
'md': 22,
'lg': 24,
'xl': 28,
'2xl': 32,
'3xl': 40,
'4xl': 48,
'5xl': 64,
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/859dec46f6e71eb9e0955ce257f07b4fe9f83150
|
src/components/primitives/Text/index.tsx
|
|
<mask> ...reslovedProps
<mask> } = usePropsResolution('Text', props);
<mask>
<mask> const _ref = useRef(null);
<mask>
<mask> const [lineHeightValue] = useToken('lineHeights', [lineHeight]);
<mask> const [fontSizeValue] = useToken('fontSizes', [fontSize]);
<mask> const [letterSpacingValue] = useToken('letterSpacings', [letterSpacing]);
<mask>
<mask> const calculatedLineHeightWithUnits = React.useMemo(() => {
<mask> //lineheight calculations
<mask> let calculatedLineHeight =
<mask> parseFloat(lineHeightValue) * parseFloat(fontSizeValue);
<mask> return typeof fontSizeValue === 'string'
<mask> ? fontSizeValue.includes('rem')
<mask> ? calculatedLineHeight + 'rem'
<mask> : fontSizeValue.includes('px')
<mask> ? calculatedLineHeight + 'px'
<mask> : calculatedLineHeight
<mask> : calculatedLineHeight;
<mask> }, [fontSizeValue, lineHeightValue]);
<mask>
<mask> const calculatedLetterSpacingWithUnits = React.useMemo(() => {
<mask> //letter-spacing calculations
<mask> let calculatedLetterSpacing =
<mask> parseFloat(letterSpacingValue) * parseFloat(fontSizeValue);
<mask> return typeof fontSizeValue === 'string'
<mask> ? fontSizeValue.includes('rem')
<mask> ? calculatedLetterSpacing + 'rem'
<mask> : fontSizeValue.includes('px')
<mask> ? calculatedLetterSpacing + 'px'
<mask> : calculatedLetterSpacing
<mask> : calculatedLetterSpacing;
<mask> }, [fontSizeValue, letterSpacingValue]);
<mask>
<mask> // TODO: might have to add this condition
<mask> const { isHovered } = useHover({}, _hover ? _ref : null);
<mask> // const { isHovered } = useHover({}, _ref);
<mask> let fontFamily = propFontFamily;
<mask> let fontStyle = italic ? 'italic' : propFontStyle;
</s> fix: revert em conversion tokens </s> remove lineHeight={calculatedLineHeightWithUnits}
letterSpacing={calculatedLetterSpacingWithUnits}
</s> add </s> remove lineHeight = '2xs',
letterSpacing = 'sm',
</s> add </s> remove it('tests lineHeight from token in text ', () => {
const { getByTestId } = render(
<Provider>
<Text lineHeight="md" testID="test">
This is a text
</Text>
</Provider>
);
const text = getByTestId('test');
expect(text.props.style.lineHeight).toBe(22);
});
it('tests absolute lineHeight in text ', () => {
const { getByTestId } = render(
<Provider>
<Text lineHeight={5} testID="test">
This is a text
</Text>
</Provider>
);
const text = getByTestId('test');
expect(text.props.style.lineHeight).toBe(80);
});
it('tests letterSpacing from token in text ', () => {
const { getByTestId } = render(
<Provider>
<Text letterSpacing="2xl" testID="test">
This is a text
</Text>
</Provider>
);
const text = getByTestId('test');
expect(text.props.style.letterSpacing).toBe(6.4);
});
</s> add </s> remove import { useToken } from '../../../hooks/useToken';
</s> add </s> remove import Text from '../../components/primitives/Text';
</s> add
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/859dec46f6e71eb9e0955ce257f07b4fe9f83150
|
src/components/primitives/Text/index.tsx
|
|
<mask> <StyledText
<mask> {...reslovedProps}
<mask> numberOfLines={noOfLines ? noOfLines : isTruncated ? 1 : undefined}
<mask> {...resolvedFontFamily}
<mask> lineHeight={calculatedLineHeightWithUnits}
<mask> letterSpacing={calculatedLetterSpacingWithUnits}
<mask> bg={highlight ? 'warning.200' : reslovedProps.bg}
<mask> textDecorationLine={
<mask> underline && strikeThrough
<mask> ? 'underline line-through'
<mask> : underline
</s> fix: revert em conversion tokens </s> remove
const [lineHeightValue] = useToken('lineHeights', [lineHeight]);
const [fontSizeValue] = useToken('fontSizes', [fontSize]);
const [letterSpacingValue] = useToken('letterSpacings', [letterSpacing]);
const calculatedLineHeightWithUnits = React.useMemo(() => {
//lineheight calculations
let calculatedLineHeight =
parseFloat(lineHeightValue) * parseFloat(fontSizeValue);
return typeof fontSizeValue === 'string'
? fontSizeValue.includes('rem')
? calculatedLineHeight + 'rem'
: fontSizeValue.includes('px')
? calculatedLineHeight + 'px'
: calculatedLineHeight
: calculatedLineHeight;
}, [fontSizeValue, lineHeightValue]);
const calculatedLetterSpacingWithUnits = React.useMemo(() => {
//letter-spacing calculations
let calculatedLetterSpacing =
parseFloat(letterSpacingValue) * parseFloat(fontSizeValue);
return typeof fontSizeValue === 'string'
? fontSizeValue.includes('rem')
? calculatedLetterSpacing + 'rem'
: fontSizeValue.includes('px')
? calculatedLetterSpacing + 'px'
: calculatedLetterSpacing
: calculatedLetterSpacing;
}, [fontSizeValue, letterSpacingValue]);
</s> add </s> remove '2xs': 1,
'xs': 1.125,
'sm': 1.25,
'md': 1.375,
'lg': 1.5,
'xl': 1.75,
'2xl': 2,
'3xl': 2.5,
'4xl': 3,
'5xl': 4,
</s> add '2xs': 16,
'xs': 18,
'sm': 20,
'md': 22,
'lg': 24,
'xl': 28,
'2xl': 32,
'3xl': 40,
'4xl': 48,
'5xl': 64, </s> remove it('tests lineHeight from token in text ', () => {
const { getByTestId } = render(
<Provider>
<Text lineHeight="md" testID="test">
This is a text
</Text>
</Provider>
);
const text = getByTestId('test');
expect(text.props.style.lineHeight).toBe(22);
});
it('tests absolute lineHeight in text ', () => {
const { getByTestId } = render(
<Provider>
<Text lineHeight={5} testID="test">
This is a text
</Text>
</Provider>
);
const text = getByTestId('test');
expect(text.props.style.lineHeight).toBe(80);
});
it('tests letterSpacing from token in text ', () => {
const { getByTestId } = render(
<Provider>
<Text letterSpacing="2xl" testID="test">
This is a text
</Text>
</Provider>
);
const text = getByTestId('test');
expect(text.props.style.letterSpacing).toBe(6.4);
});
</s> add </s> remove import Text from '../../components/primitives/Text';
</s> add </s> remove lineHeight = '2xs',
letterSpacing = 'sm',
</s> add
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/859dec46f6e71eb9e0955ce257f07b4fe9f83150
|
src/components/primitives/Text/index.tsx
|
|
<mask> import { NativeBaseProvider } from '../../core/NativeBaseProvider';
<mask> import Box from '../../components/primitives/Box';
<mask> import Image from '../../components/primitives/Image';
<mask> import Spinner from '../../components/primitives/Spinner';
<mask> import Text from '../../components/primitives/Text';
<mask> import { Platform } from 'react-native';
<mask> import { extendTheme } from '../../core/extendTheme';
<mask>
<mask> const inset = {
<mask> frame: { x: 0, y: 0, width: 0, height: 0 },
</s> fix: revert em conversion tokens </s> remove import { useToken } from '../../../hooks/useToken';
</s> add </s> remove it('tests lineHeight from token in text ', () => {
const { getByTestId } = render(
<Provider>
<Text lineHeight="md" testID="test">
This is a text
</Text>
</Provider>
);
const text = getByTestId('test');
expect(text.props.style.lineHeight).toBe(22);
});
it('tests absolute lineHeight in text ', () => {
const { getByTestId } = render(
<Provider>
<Text lineHeight={5} testID="test">
This is a text
</Text>
</Provider>
);
const text = getByTestId('test');
expect(text.props.style.lineHeight).toBe(80);
});
it('tests letterSpacing from token in text ', () => {
const { getByTestId } = render(
<Provider>
<Text letterSpacing="2xl" testID="test">
This is a text
</Text>
</Provider>
);
const text = getByTestId('test');
expect(text.props.style.letterSpacing).toBe(6.4);
});
</s> add </s> remove
const [lineHeightValue] = useToken('lineHeights', [lineHeight]);
const [fontSizeValue] = useToken('fontSizes', [fontSize]);
const [letterSpacingValue] = useToken('letterSpacings', [letterSpacing]);
const calculatedLineHeightWithUnits = React.useMemo(() => {
//lineheight calculations
let calculatedLineHeight =
parseFloat(lineHeightValue) * parseFloat(fontSizeValue);
return typeof fontSizeValue === 'string'
? fontSizeValue.includes('rem')
? calculatedLineHeight + 'rem'
: fontSizeValue.includes('px')
? calculatedLineHeight + 'px'
: calculatedLineHeight
: calculatedLineHeight;
}, [fontSizeValue, lineHeightValue]);
const calculatedLetterSpacingWithUnits = React.useMemo(() => {
//letter-spacing calculations
let calculatedLetterSpacing =
parseFloat(letterSpacingValue) * parseFloat(fontSizeValue);
return typeof fontSizeValue === 'string'
? fontSizeValue.includes('rem')
? calculatedLetterSpacing + 'rem'
: fontSizeValue.includes('px')
? calculatedLetterSpacing + 'px'
: calculatedLetterSpacing
: calculatedLetterSpacing;
}, [fontSizeValue, letterSpacingValue]);
</s> add </s> remove '2xs': 1,
'xs': 1.125,
'sm': 1.25,
'md': 1.375,
'lg': 1.5,
'xl': 1.75,
'2xl': 2,
'3xl': 2.5,
'4xl': 3,
'5xl': 4,
</s> add '2xs': 16,
'xs': 18,
'sm': 20,
'md': 22,
'lg': 24,
'xl': 28,
'2xl': 32,
'3xl': 40,
'4xl': 48,
'5xl': 64, </s> remove lineHeight = '2xs',
letterSpacing = 'sm',
</s> add
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/859dec46f6e71eb9e0955ce257f07b4fe9f83150
|
src/hooks/useThemeProps/usePropsResolution.test.tsx
|
|
<mask> );
<mask> const box = getByTestId('test');
<mask> expect(box.props.style).toEqual(defaultTheme.shadows[9]);
<mask> });
<mask> it('tests lineHeight from token in text ', () => {
<mask> const { getByTestId } = render(
<mask> <Provider>
<mask> <Text lineHeight="md" testID="test">
<mask> This is a text
<mask> </Text>
<mask> </Provider>
<mask> );
<mask> const text = getByTestId('test');
<mask> expect(text.props.style.lineHeight).toBe(22);
<mask> });
<mask>
<mask> it('tests absolute lineHeight in text ', () => {
<mask> const { getByTestId } = render(
<mask> <Provider>
<mask> <Text lineHeight={5} testID="test">
<mask> This is a text
<mask> </Text>
<mask> </Provider>
<mask> );
<mask> const text = getByTestId('test');
<mask> expect(text.props.style.lineHeight).toBe(80);
<mask> });
<mask>
<mask> it('tests letterSpacing from token in text ', () => {
<mask> const { getByTestId } = render(
<mask> <Provider>
<mask> <Text letterSpacing="2xl" testID="test">
<mask> This is a text
<mask> </Text>
<mask> </Provider>
<mask> );
<mask> const text = getByTestId('test');
<mask> expect(text.props.style.letterSpacing).toBe(6.4);
<mask> });
<mask> });
</s> fix: revert em conversion tokens </s> remove import { useToken } from '../../../hooks/useToken';
</s> add </s> remove
const [lineHeightValue] = useToken('lineHeights', [lineHeight]);
const [fontSizeValue] = useToken('fontSizes', [fontSize]);
const [letterSpacingValue] = useToken('letterSpacings', [letterSpacing]);
const calculatedLineHeightWithUnits = React.useMemo(() => {
//lineheight calculations
let calculatedLineHeight =
parseFloat(lineHeightValue) * parseFloat(fontSizeValue);
return typeof fontSizeValue === 'string'
? fontSizeValue.includes('rem')
? calculatedLineHeight + 'rem'
: fontSizeValue.includes('px')
? calculatedLineHeight + 'px'
: calculatedLineHeight
: calculatedLineHeight;
}, [fontSizeValue, lineHeightValue]);
const calculatedLetterSpacingWithUnits = React.useMemo(() => {
//letter-spacing calculations
let calculatedLetterSpacing =
parseFloat(letterSpacingValue) * parseFloat(fontSizeValue);
return typeof fontSizeValue === 'string'
? fontSizeValue.includes('rem')
? calculatedLetterSpacing + 'rem'
: fontSizeValue.includes('px')
? calculatedLetterSpacing + 'px'
: calculatedLetterSpacing
: calculatedLetterSpacing;
}, [fontSizeValue, letterSpacingValue]);
</s> add </s> remove lineHeight = '2xs',
letterSpacing = 'sm',
</s> add </s> remove import Text from '../../components/primitives/Text';
</s> add </s> remove '2xs': 1,
'xs': 1.125,
'sm': 1.25,
'md': 1.375,
'lg': 1.5,
'xl': 1.75,
'2xl': 2,
'3xl': 2.5,
'4xl': 3,
'5xl': 4,
</s> add '2xs': 16,
'xs': 18,
'sm': 20,
'md': 22,
'lg': 24,
'xl': 28,
'2xl': 32,
'3xl': 40,
'4xl': 48,
'5xl': 64,
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/859dec46f6e71eb9e0955ce257f07b4fe9f83150
|
src/hooks/useThemeProps/usePropsResolution.test.tsx
|
|
'2xs': 16,
'xs': 18,
'sm': 20,
'md': 22,
'lg': 24,
'xl': 28,
'2xl': 32,
'3xl': 40,
'4xl': 48,
'5xl': 64,
|
<mask> '4xl': 1.25,
<mask> '5xl': 1.5,
<mask> },
<mask> lineHeights: {
<mask> '2xs': 1,
<mask> 'xs': 1.125,
<mask> 'sm': 1.25,
<mask> 'md': 1.375,
<mask> 'lg': 1.5,
<mask> 'xl': 1.75,
<mask> '2xl': 2,
<mask> '3xl': 2.5,
<mask> '4xl': 3,
<mask> '5xl': 4,
<mask> },
<mask> // fontConfig: {
<mask> // Roboto: {
<mask> // 100: {
<mask> // normal: 'Roboto-Light',
</s> fix: revert em conversion tokens </s> remove
const [lineHeightValue] = useToken('lineHeights', [lineHeight]);
const [fontSizeValue] = useToken('fontSizes', [fontSize]);
const [letterSpacingValue] = useToken('letterSpacings', [letterSpacing]);
const calculatedLineHeightWithUnits = React.useMemo(() => {
//lineheight calculations
let calculatedLineHeight =
parseFloat(lineHeightValue) * parseFloat(fontSizeValue);
return typeof fontSizeValue === 'string'
? fontSizeValue.includes('rem')
? calculatedLineHeight + 'rem'
: fontSizeValue.includes('px')
? calculatedLineHeight + 'px'
: calculatedLineHeight
: calculatedLineHeight;
}, [fontSizeValue, lineHeightValue]);
const calculatedLetterSpacingWithUnits = React.useMemo(() => {
//letter-spacing calculations
let calculatedLetterSpacing =
parseFloat(letterSpacingValue) * parseFloat(fontSizeValue);
return typeof fontSizeValue === 'string'
? fontSizeValue.includes('rem')
? calculatedLetterSpacing + 'rem'
: fontSizeValue.includes('px')
? calculatedLetterSpacing + 'px'
: calculatedLetterSpacing
: calculatedLetterSpacing;
}, [fontSizeValue, letterSpacingValue]);
</s> add </s> remove import Text from '../../components/primitives/Text';
</s> add </s> remove import { useToken } from '../../../hooks/useToken';
</s> add </s> remove it('tests lineHeight from token in text ', () => {
const { getByTestId } = render(
<Provider>
<Text lineHeight="md" testID="test">
This is a text
</Text>
</Provider>
);
const text = getByTestId('test');
expect(text.props.style.lineHeight).toBe(22);
});
it('tests absolute lineHeight in text ', () => {
const { getByTestId } = render(
<Provider>
<Text lineHeight={5} testID="test">
This is a text
</Text>
</Provider>
);
const text = getByTestId('test');
expect(text.props.style.lineHeight).toBe(80);
});
it('tests letterSpacing from token in text ', () => {
const { getByTestId } = render(
<Provider>
<Text letterSpacing="2xl" testID="test">
This is a text
</Text>
</Provider>
);
const text = getByTestId('test');
expect(text.props.style.letterSpacing).toBe(6.4);
});
</s> add </s> remove lineHeight={calculatedLineHeightWithUnits}
letterSpacing={calculatedLetterSpacingWithUnits}
</s> add
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/859dec46f6e71eb9e0955ce257f07b4fe9f83150
|
src/theme/base/typography.ts
|
componentDidMount() {
|
<mask> lastCard: this.props.dataSource.length === 1
<mask> };
<mask> }
<mask>
<mask> componentWillMount() {
<mask> this._panResponder = PanResponder.create({
<mask> onMoveShouldSetResponderCapture: () => true,
<mask> onMoveShouldSetPanResponderCapture: (evt, gestureState) =>
<mask> Math.abs(gestureState.dx) > 5,
<mask>
</s> fix(): replaces deprecated lifecycle methods </s> remove componentWillMount() {
</s> add componentDidMount() { </s> remove componentWillMount() {
</s> add componentDidMount() { </s> remove import {
Animated,
PanResponder,
View
} from 'react-native';
</s> add import { Animated, PanResponder, View } from 'react-native'; </s> remove ) : (
<View style={[{ backgroundColor: '#FFF' }, this.props.style]}>
{this.props.body}
</View>
)}
</s> add ) : (
<View style={[{ backgroundColor: '#FFF' }, this.props.style]}>
{this.props.body}
</View>
)}
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/85a52b1e0ba09d4eb45c2aaaa0916199b4e3653d
|
src/basic/DeckSwiper.js
|
componentDidMount() {
|
<mask> static contextTypes = {
<mask> theme: PropTypes.object
<mask> };
<mask>
<mask> componentWillMount() {
<mask> this.setIcon(this.props.type);
<mask> }
<mask>
<mask> componentWillUpdate(nextProps) {
<mask> if (nextProps.type && this.props.type !== nextProps.type) {
</s> fix(): replaces deprecated lifecycle methods </s> remove componentWillMount() {
</s> add componentDidMount() { </s> remove componentWillMount() {
</s> add componentDidMount() { </s> remove import {
Animated,
PanResponder,
View
} from 'react-native';
</s> add import { Animated, PanResponder, View } from 'react-native'; </s> remove ) : (
<View style={[{ backgroundColor: '#FFF' }, this.props.style]}>
{this.props.body}
</View>
)}
</s> add ) : (
<View style={[{ backgroundColor: '#FFF' }, this.props.style]}>
{this.props.body}
</View>
)}
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/85a52b1e0ba09d4eb45c2aaaa0916199b4e3653d
|
src/basic/IconNB.js
|
import { Animated, PanResponder, View } from 'react-native';
|
<mask> import React, { Component } from 'react';
<mask> import PropTypes from 'prop-types';
<mask> import {
<mask> Animated,
<mask> PanResponder,
<mask> View
<mask> } from 'react-native';
<mask> import { connectStyle } from 'native-base-shoutem-theme';
<mask>
<mask> import mapPropsToStyleNames from '../utils/mapPropsToStyleNames';
<mask>
<mask> import { Left } from './Left';
</s> fix(): replaces deprecated lifecycle methods </s> remove componentWillMount() {
</s> add componentDidMount() { </s> remove componentWillMount() {
</s> add componentDidMount() { </s> remove componentWillMount() {
</s> add componentDidMount() { </s> remove ) : (
<View style={[{ backgroundColor: '#FFF' }, this.props.style]}>
{this.props.body}
</View>
)}
</s> add ) : (
<View style={[{ backgroundColor: '#FFF' }, this.props.style]}>
{this.props.body}
</View>
)}
|
[
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/85a52b1e0ba09d4eb45c2aaaa0916199b4e3653d
|
src/basic/SwipeRow.js
|
componentDidMount() {
|
<mask> };
<mask> this._translateX = new Animated.Value(0);
<mask> }
<mask>
<mask> componentWillMount() {
<mask> this._panResponder = PanResponder.create({
<mask> onMoveShouldSetPanResponder: (e, gs) =>
<mask> this.handleOnMoveShouldSetPanResponder(e, gs),
<mask> onPanResponderMove: (e, gs) => this.handlePanResponderMove(e, gs),
<mask> onPanResponderRelease: (e, gs) => this.handlePanResponderEnd(e, gs),
</s> fix(): replaces deprecated lifecycle methods </s> remove componentWillMount() {
</s> add componentDidMount() { </s> remove componentWillMount() {
</s> add componentDidMount() { </s> remove import {
Animated,
PanResponder,
View
} from 'react-native';
</s> add import { Animated, PanResponder, View } from 'react-native'; </s> remove ) : (
<View style={[{ backgroundColor: '#FFF' }, this.props.style]}>
{this.props.body}
</View>
)}
</s> add ) : (
<View style={[{ backgroundColor: '#FFF' }, this.props.style]}>
{this.props.body}
</View>
)}
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/85a52b1e0ba09d4eb45c2aaaa0916199b4e3653d
|
src/basic/SwipeRow.js
|
) : (
<View style={[{ backgroundColor: '#FFF' }, this.props.style]}>
{this.props.body}
</View>
)}
|
<mask> {!this.props.list ? (
<mask> <ListItem list style={this.props.style}>
<mask> {this.props.body}
<mask> </ListItem>
<mask> ) : (
<mask> <View style={[{ backgroundColor: '#FFF' }, this.props.style]}>
<mask> {this.props.body}
<mask> </View>
<mask> )}
<mask> </Animated.View>
<mask> );
<mask>
<mask> }
<mask>
</s> fix(): replaces deprecated lifecycle methods </s> remove import {
Animated,
PanResponder,
View
} from 'react-native';
</s> add import { Animated, PanResponder, View } from 'react-native'; </s> remove componentWillMount() {
</s> add componentDidMount() { </s> remove componentWillMount() {
</s> add componentDidMount() { </s> remove componentWillMount() {
</s> add componentDidMount() {
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/85a52b1e0ba09d4eb45c2aaaa0916199b4e3653d
|
src/basic/SwipeRow.js
|
headerStyle:"#edebed",
|
<mask> platformStyle:platformStyle,
<mask> platform:platform,
<mask>
<mask>
<mask> headerStyle:"#d8d3d8",
<mask> iconStyle:"#000",
<mask> contentStyle:"#F4F3F4",
<mask> expandedIconStyle:"#000",
<mask>
<mask>
</s> changed theme colors for Accordion </s> remove headerStyle:"#d8d3d8",
</s> add headerStyle:"#edebed", </s> remove headerStyle:"#d8d3d8",
</s> add headerStyle:"#edebed", </s> remove contentStyle: "#F4F3F4",
</s> add contentStyle: "#f5f4f5", </s> remove headerStyle: "#d8d3d8",
</s> add headerStyle: "#edebed", </s> remove contentStyle: "#F4F3F4",
</s> add contentStyle: "#f5f4f5",
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/864942330cb5b78d2c3c48feac2883be063900f6
|
dist/src/theme/variables/commonColor.js
|
contentStyle:"#f5f4f5",
|
<mask>
<mask>
<mask> headerStyle:"#d8d3d8",
<mask> iconStyle:"#000",
<mask> contentStyle:"#F4F3F4",
<mask> expandedIconStyle:"#000",
<mask>
<mask>
<mask> androidRipple:true,
<mask> androidRippleColor:"rgba(256, 256, 256, 0.3)",
</s> changed theme colors for Accordion </s> remove contentStyle:"#F4F3F4",
</s> add contentStyle:"#f5f4f5", </s> remove contentStyle:"#F4F3F4",
</s> add contentStyle:"#f5f4f5", </s> remove contentStyle: "#F4F3F4",
</s> add contentStyle: "#f5f4f5", </s> remove headerStyle: "#d8d3d8",
</s> add headerStyle: "#edebed", </s> remove contentStyle: "#F4F3F4",
</s> add contentStyle: "#f5f4f5",
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/864942330cb5b78d2c3c48feac2883be063900f6
|
dist/src/theme/variables/commonColor.js
|
headerStyle:"#edebed",
|
<mask> platformStyle:platformStyle,
<mask> platform:platform,
<mask>
<mask>
<mask> headerStyle:"#d8d3d8",
<mask> iconStyle:"#000",
<mask> contentStyle:"#F4F3F4",
<mask> expandedIconStyle:"#000",
<mask>
<mask>
</s> changed theme colors for Accordion
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/864942330cb5b78d2c3c48feac2883be063900f6
|
dist/src/theme/variables/material.js
|
contentStyle:"#f5f4f5",
|
<mask>
<mask>
<mask> headerStyle:"#d8d3d8",
<mask> iconStyle:"#000",
<mask> contentStyle:"#F4F3F4",
<mask> expandedIconStyle:"#000",
<mask>
<mask>
<mask> androidRipple:true,
<mask> androidRippleColor:"rgba(256, 256, 256, 0.3)",
</s> changed theme colors for Accordion
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/864942330cb5b78d2c3c48feac2883be063900f6
|
dist/src/theme/variables/material.js
|
headerStyle:"#edebed",
|
<mask> platformStyle:platformStyle,
<mask> platform:platform,
<mask>
<mask>
<mask> headerStyle:"#d8d3d8",
<mask> iconStyle:"#000",
<mask> contentStyle:"#F4F3F4",
<mask> expandedIconStyle:"#000",
<mask>
<mask>
</s> changed theme colors for Accordion
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/864942330cb5b78d2c3c48feac2883be063900f6
|
dist/src/theme/variables/platform.js
|
contentStyle:"#f5f4f5",
|
<mask>
<mask>
<mask> headerStyle:"#d8d3d8",
<mask> iconStyle:"#000",
<mask> contentStyle:"#F4F3F4",
<mask> expandedIconStyle:"#000",
<mask>
<mask>
<mask> androidRipple:true,
<mask> androidRippleColor:"rgba(256, 256, 256, 0.3)",
</s> changed theme colors for Accordion
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/864942330cb5b78d2c3c48feac2883be063900f6
|
dist/src/theme/variables/platform.js
|
headerStyle: "#edebed",
|
<mask> platformStyle,
<mask> platform,
<mask>
<mask> //Accordion
<mask> headerStyle: "#d8d3d8",
<mask> iconStyle: "#000",
<mask> contentStyle: "#F4F3F4",
<mask> expandedIconStyle: "#000",
<mask>
<mask> //Android
</s> changed theme colors for Accordion </s> remove headerStyle: "#d8d3d8",
</s> add headerStyle: "#edebed", </s> remove headerStyle: "#d8d3d8",
</s> add headerStyle: "#edebed", </s> remove contentStyle: "#F4F3F4",
</s> add contentStyle: "#f5f4f5", </s> remove contentStyle: "#F4F3F4",
</s> add contentStyle: "#f5f4f5", </s> remove contentStyle: "#F4F3F4",
</s> add contentStyle: "#f5f4f5",
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/864942330cb5b78d2c3c48feac2883be063900f6
|
src/theme/variables/commonColor.js
|
contentStyle: "#f5f4f5",
|
<mask>
<mask> //Accordion
<mask> headerStyle: "#d8d3d8",
<mask> iconStyle: "#000",
<mask> contentStyle: "#F4F3F4",
<mask> expandedIconStyle: "#000",
<mask>
<mask> //Android
<mask> androidRipple: true,
<mask> androidRippleColor: "rgba(256, 256, 256, 0.3)",
</s> changed theme colors for Accordion </s> remove contentStyle: "#F4F3F4",
</s> add contentStyle: "#f5f4f5", </s> remove contentStyle: "#F4F3F4",
</s> add contentStyle: "#f5f4f5", </s> remove headerStyle: "#d8d3d8",
</s> add headerStyle: "#edebed", </s> remove headerStyle: "#d8d3d8",
</s> add headerStyle: "#edebed", </s> remove headerStyle: "#d8d3d8",
</s> add headerStyle: "#edebed",
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/864942330cb5b78d2c3c48feac2883be063900f6
|
src/theme/variables/commonColor.js
|
headerStyle: "#edebed",
|
<mask> platformStyle,
<mask> platform,
<mask>
<mask> //Accordion
<mask> headerStyle: "#d8d3d8",
<mask> iconStyle: "#000",
<mask> contentStyle: "#F4F3F4",
<mask> expandedIconStyle: "#000",
<mask>
<mask> // Android
</s> changed theme colors for Accordion </s> remove headerStyle: "#d8d3d8",
</s> add headerStyle: "#edebed", </s> remove headerStyle: "#d8d3d8",
</s> add headerStyle: "#edebed", </s> remove contentStyle: "#F4F3F4",
</s> add contentStyle: "#f5f4f5", </s> remove contentStyle: "#F4F3F4",
</s> add contentStyle: "#f5f4f5", </s> remove contentStyle: "#F4F3F4",
</s> add contentStyle: "#f5f4f5",
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/864942330cb5b78d2c3c48feac2883be063900f6
|
src/theme/variables/material.js
|
contentStyle: "#f5f4f5",
|
<mask>
<mask> //Accordion
<mask> headerStyle: "#d8d3d8",
<mask> iconStyle: "#000",
<mask> contentStyle: "#F4F3F4",
<mask> expandedIconStyle: "#000",
<mask>
<mask> // Android
<mask> androidRipple: true,
<mask> androidRippleColor: "rgba(256, 256, 256, 0.3)",
</s> changed theme colors for Accordion </s> remove contentStyle: "#F4F3F4",
</s> add contentStyle: "#f5f4f5", </s> remove contentStyle: "#F4F3F4",
</s> add contentStyle: "#f5f4f5", </s> remove headerStyle: "#d8d3d8",
</s> add headerStyle: "#edebed", </s> remove headerStyle: "#d8d3d8",
</s> add headerStyle: "#edebed", </s> remove headerStyle: "#d8d3d8",
</s> add headerStyle: "#edebed",
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/864942330cb5b78d2c3c48feac2883be063900f6
|
src/theme/variables/material.js
|
headerStyle: "#edebed",
|
<mask> platformStyle,
<mask> platform,
<mask>
<mask> //Accordion
<mask> headerStyle: "#d8d3d8",
<mask> iconStyle: "#000",
<mask> contentStyle: "#F4F3F4",
<mask> expandedIconStyle: "#000",
<mask>
<mask> // Android
</s> changed theme colors for Accordion
|
[
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] |
https://github.com/GeekyAnts/NativeBase/commit/864942330cb5b78d2c3c48feac2883be063900f6
|
src/theme/variables/platform.js
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.