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';
// Components
import { Option, SingleValue } from './PickerOption';
import OptionGroup from './OptionGroup';
import { SelectOption, SingleValue } from './SelectOption';
import SelectOptionGroup from './SelectOptionGroup';
import IndicatorsContainer from './IndicatorsContainer';
import NoOptionsMessage from './NoOptionsMessage';
import resetSelectStyles from './resetSelectStyles';
@ -117,11 +117,11 @@ export class Select extends PureComponent<CommonProps & SelectProps> {
classNamePrefix="gf-form-select-box"
className={selectClassNames}
components={{
Option,
Option: SelectOption,
SingleValue,
IndicatorsContainer,
MenuList,
Group: OptionGroup,
Group: SelectOptionGroup,
}}
defaultValue={defaultValue}
value={value}

View File

@ -1,6 +1,6 @@
import React from 'react';
import renderer from 'react-test-renderer';
import PickerOption from './PickerOption';
import SelectOption from './SelectOption';
import { OptionProps } from 'react-select/lib/components/Option';
const model: OptionProps<any> = {
@ -31,11 +31,11 @@ const model: OptionProps<any> = {
className: 'class-for-user-picker',
};
describe('PickerOption', () => {
describe('SelectOption', () => {
it('renders correctly', () => {
const tree = renderer
.create(
<PickerOption
<SelectOption
{...model}
data={{
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;
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;
}
export default class OptionGroup extends PureComponent<ExtendedGroupProps, State> {
export default class SelectOptionGroup extends PureComponent<ExtendedGroupProps, State> {
state = {
expanded: false,
};

View File

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