diff --git a/packages/core/content-type-builder/admin/src/components/FormModal/CustomButton.js b/packages/core/content-type-builder/admin/src/components/FormModal/CustomButton.js deleted file mode 100644 index 5eeb18c43e..0000000000 --- a/packages/core/content-type-builder/admin/src/components/FormModal/CustomButton.js +++ /dev/null @@ -1,12 +0,0 @@ -import styled from 'styled-components'; -import { Button } from '@buffetjs/core'; - -const CustomButton = styled(Button)` - svg { - height: 11px; - width: 11px; - vertical-align: initial; - } -`; - -export default CustomButton; diff --git a/packages/core/content-type-builder/admin/src/components/FormModal/dynamicZone/form.js b/packages/core/content-type-builder/admin/src/components/FormModal/dynamicZone/form.js index a659efad7a..b2b1ab3921 100644 --- a/packages/core/content-type-builder/admin/src/components/FormModal/dynamicZone/form.js +++ b/packages/core/content-type-builder/admin/src/components/FormModal/dynamicZone/form.js @@ -26,7 +26,13 @@ const form = { sectionTitle: null, items: [ // FIXME - { type: 'pushRight', size: 6 }, + { + type: 'pushRight', + size: 6, + // FIXME + intlLabel: { id: '', defaultMessage: '' }, + name: 'pushRight', + }, { name: 'components', type: 'componentSelect', diff --git a/packages/core/content-type-builder/admin/src/components/FormModal/index.js b/packages/core/content-type-builder/admin/src/components/FormModal/index.js index 00aff7b663..6f6ddeffac 100644 --- a/packages/core/content-type-builder/admin/src/components/FormModal/index.js +++ b/packages/core/content-type-builder/admin/src/components/FormModal/index.js @@ -20,6 +20,7 @@ import { get, has, isEmpty, set, toLower } from 'lodash'; import upperFirst from 'lodash/upperFirst'; import toString from 'lodash/toString'; import { useSelector, useDispatch, shallowEqual } from 'react-redux'; +import AddIcon from '@strapi/icons/AddIcon'; import { Box } from '@strapi/parts/Box'; import { Button } from '@strapi/parts/Button'; import { Divider } from '@strapi/parts/Divider'; @@ -35,7 +36,6 @@ import useDataManager from '../../hooks/useDataManager'; import AttributeOptions from '../AttributeOptions'; import FormModalHeader from '../FormModalHeader'; -// import AttributeOption from '../AttributeOption'; // import BooleanBox from '../BooleanBox'; // import ComponentIconPicker from '../ComponentIconPicker'; // import CheckboxWithDescription from '../CheckboxWithDescription'; @@ -384,6 +384,7 @@ const FormModal = () => { const headers = createHeadersArray(state); + // FIXME rename this constant const isCreatingContentType = state.modalType === 'contentType'; const isCreatingComponent = state.modalType === 'component'; const isCreatingAttribute = state.modalType === 'attribute'; @@ -1378,6 +1379,110 @@ const FormModal = () => { + {(isCreatingContentType || isCreatingComponent) && !isCreating && ( + + )} + {isEditingCategory && ( + + )} + {isCreating && state.attributeType === 'dynamiczone' && ( + + )} + {state.attributeType !== 'dynamiczone' && ( + + )} + {isCreatingAttribute && !isInFirstComponentStep && ( + + )} + + } startActions={ // )} - // {(isCreatingContentType || isCreatingComponent) && !isCreating && ( - // - // )} - // {isEditingCategory && ( - // + // )} + // {isEditingCategory && ( + // - // )} - // {isCreating && state.attributeType === 'dynamiczone' && ( - // handleSubmit(e, true)} - // icon={ - // (isCreatingAttribute && - // !isCreatingComponentFromAView && - // state.step !== '1') || - // (state.modalType === 'addComponentToDynamicZone' && - // isCreatingComponentFromAView) || - // (isCreatingComponentFromAView && state.step === '2') - // } - // > - // {getButtonSubmitMessage()} - // - // )} - // {state.attributeType !== 'dynamiczone' && ( - // handleSubmit(e, true)} - // icon={ - // (isCreatingAttribute && - // !isCreatingComponentFromAView && - // state.step !== '1') || - // (state.modalType === 'addComponentToDynamicZone' && - // isCreatingComponentFromAView) || - // (isCreatingComponentFromAView && state.step === '2') - // } - // > - // {getButtonSubmitMessage()} - // - // )} + // deleteCategory(initialData.name); + // }} + // style={{ marginRight: '10px' }} + // > + // {formatMessage({ id: getTrad('form.button.delete') })} + // + // )} + // {isCreating && state.attributeType === 'dynamiczone' && ( + // handleSubmit(e, true)} + // icon={ + // (isCreatingAttribute && + // !isCreatingComponentFromAView && + // state.step !== '1') || + // (state.modalType === 'addComponentToDynamicZone' && + // isCreatingComponentFromAView) || + // (isCreatingComponentFromAView && state.step === '2') + // } + // > + // {getButtonSubmitMessage()} + // + // )} + // {state.attributeType !== 'dynamiczone' && ( + // handleSubmit(e, true)} + // icon={ + // (isCreatingAttribute && + // !isCreatingComponentFromAView && + // state.step !== '1') || + // (state.modalType === 'addComponentToDynamicZone' && + // isCreatingComponentFromAView) || + // (isCreatingComponentFromAView && state.step === '2') + // } + // > + // {getButtonSubmitMessage()} + // + // )} // // //