Renamed Select related components: Picker* to Select*, Option* to SelectOption*

This commit is contained in:
Dominik Prokop 2019-01-10 15:21:11 +01:00
parent 53f0f08efa
commit d322717f3e
5 changed files with 11 additions and 11 deletions

View File

@ -11,8 +11,8 @@ import { default as ReactAsyncSelect } from '@torkelo/react-select/lib/Async';
import { components } from '@torkelo/react-select'; import { components } from '@torkelo/react-select';
// Components // Components
import { Option, SingleValue } from './PickerOption'; import { SelectOption, SingleValue } from './SelectOption';
import OptionGroup from './OptionGroup'; import SelectOptionGroup from './SelectOptionGroup';
import IndicatorsContainer from './IndicatorsContainer'; import IndicatorsContainer from './IndicatorsContainer';
import NoOptionsMessage from './NoOptionsMessage'; import NoOptionsMessage from './NoOptionsMessage';
import resetSelectStyles from './resetSelectStyles'; import resetSelectStyles from './resetSelectStyles';
@ -117,11 +117,11 @@ export class Select extends PureComponent<CommonProps & SelectProps> {
classNamePrefix="gf-form-select-box" classNamePrefix="gf-form-select-box"
className={selectClassNames} className={selectClassNames}
components={{ components={{
Option, Option: SelectOption,
SingleValue, SingleValue,
IndicatorsContainer, IndicatorsContainer,
MenuList, MenuList,
Group: OptionGroup, Group: SelectOptionGroup,
}} }}
defaultValue={defaultValue} defaultValue={defaultValue}
value={value} value={value}

View File

@ -1,6 +1,6 @@
import React from 'react'; import React from 'react';
import renderer from 'react-test-renderer'; import renderer from 'react-test-renderer';
import PickerOption from './PickerOption'; import SelectOption from './SelectOption';
import { OptionProps } from 'react-select/lib/components/Option'; import { OptionProps } from 'react-select/lib/components/Option';
const model: OptionProps<any> = { const model: OptionProps<any> = {
@ -31,11 +31,11 @@ const model: OptionProps<any> = {
className: 'class-for-user-picker', className: 'class-for-user-picker',
}; };
describe('PickerOption', () => { describe('SelectOption', () => {
it('renders correctly', () => { it('renders correctly', () => {
const tree = renderer const tree = renderer
.create( .create(
<PickerOption <SelectOption
{...model} {...model}
data={{ data={{
imgUrl: 'url/to/avatar', imgUrl: 'url/to/avatar',

View File

@ -13,7 +13,7 @@ interface ExtendedOptionProps extends OptionProps<any> {
}; };
} }
export const Option = (props: ExtendedOptionProps) => { export const SelectOption = (props: ExtendedOptionProps) => {
const { children, isSelected, data } = props; const { children, isSelected, data } = props;
return ( return (
@ -44,4 +44,4 @@ export const SingleValue = (props: any) => {
); );
}; };
export default Option; export default SelectOption;

View File

@ -9,7 +9,7 @@ interface State {
expanded: boolean; expanded: boolean;
} }
export default class OptionGroup extends PureComponent<ExtendedGroupProps, State> { export default class SelectOptionGroup extends PureComponent<ExtendedGroupProps, State> {
state = { state = {
expanded: false, expanded: false,
}; };

View File

@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`PickerOption renders correctly 1`] = ` exports[`SelectOption renders correctly 1`] = `
<div <div
id="" id=""
onClick={[MockFunction]} onClick={[MockFunction]}