diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/ComponentSelect/index.js b/packages/strapi-plugin-content-type-builder/admin/src/components/ComponentSelect/index.js index 966396e8af..db2a090ae6 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/components/ComponentSelect/index.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/components/ComponentSelect/index.js @@ -1,140 +1,87 @@ import React from 'react'; import Select from 'react-select'; import PropTypes from 'prop-types'; -import { SelectWrapper, SelectNav } from 'strapi-helper-plugin'; -import { ErrorMessage } from '@buffetjs/styles'; import useDataManager from '../../hooks/useDataManager'; -const ComponentSelect = ({ error, label, onChange, name }) => { - const { componentsGroupedByCategory, components } = useDataManager(); - console.log({ componentsGroupedByCategory }); - const styles = { - container: base => ({ - ...base, - 'z-index': 9999, - // padding: 0, - }), - control: (base, state) => ({ - ...base, - 'z-index': 9999, - border: state.isFocused - ? '1px solid #78caff !important' - : error - ? '1px solid red !important' - : '1px solid #E3E9F3 !important', - }), - menu: base => { - return { - ...base, +// const SingleValue = ({ children, ...props }) => { +// console.log({ propss: props }); +// return
{children}
; +// }; - border: '1px solid #78caff !important', - borderColor: '#78caff !important', - borderTopColor: '#E3E9F3 !important', - }; - }, +const ComponentSelect = ({ onChange, name, value, styles }) => { + const { componentsGroupedByCategory } = useDataManager(); + + const handleChange = (inputValue, actionMeta) => { + const { action } = actionMeta; + + if (action === 'clear') { + onChange({ target: { name, value: '' } }); + } }; + const Menu = props => { console.log({ props }); return ( -
-