Skip to content

Commit

Permalink
rename components
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed May 15, 2023
1 parent 12e50cf commit 2517beb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
__experimentalVStack as VStack,
} from '@wordpress/components';

function AddCustomGenericTemplateModal( { onClose, createTemplate } ) {
function AddCustomGenericTemplateModalContent( { onClose, createTemplate } ) {
const [ title, setTitle ] = useState( '' );
const defaultTitle = __( 'Custom Template' );
const [ isBusy, setIsBusy ] = useState( false );
Expand Down Expand Up @@ -79,4 +79,4 @@ function AddCustomGenericTemplateModal( { onClose, createTemplate } ) {
);
}

export default AddCustomGenericTemplateModal;
export default AddCustomGenericTemplateModalContent;
Original file line number Diff line number Diff line change
Expand Up @@ -177,18 +177,18 @@ function SuggestionList( { entityForSuggestions, onSelect } ) {
);
}

function AddCustomTemplateModal( { onSelect, entityForSuggestions } ) {
function AddCustomTemplateModalContent( { onSelect, entityForSuggestions } ) {
const [ showSearchEntities, setShowSearchEntities ] = useState(
entityForSuggestions.hasGeneralTemplate
);
return (
<>
<VStack
spacing={ 4 }
className="edit-site-custom-template-modal__contents-wrapper"
alignment="left"
>
{ ! showSearchEntities && (
<VStack
spacing={ 4 }
className="edit-site-custom-template-modal__contents-wrapper"
alignment="left"
>
<>
<Text as="p">
{ __(
'Select whether to create a single template for all items or a specific one.'
Expand Down Expand Up @@ -259,14 +259,10 @@ function AddCustomTemplateModal( { onSelect, entityForSuggestions } ) {
</Text>
</FlexItem>
</Flex>
</VStack>
</>
) }
{ showSearchEntities && (
<VStack
spacing={ 4 }
className="edit-site-custom-template-modal__contents-wrapper"
alignment="left"
>
<>
<Text as="p">
{ __(
'This template will be used only for the specific item chosen.'
Expand All @@ -276,10 +272,10 @@ function AddCustomTemplateModal( { onSelect, entityForSuggestions } ) {
entityForSuggestions={ entityForSuggestions }
onSelect={ onSelect }
/>
</VStack>
</>
) }
</>
</VStack>
);
}

export default AddCustomTemplateModal;
export default AddCustomTemplateModalContent;
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
/**
* Internal dependencies
*/
import AddCustomTemplateModal from './add-custom-template-modal';
import AddCustomTemplateModalContent from './add-custom-template-modal-content';
import {
useExistingTemplates,
useDefaultTemplateTypes,
Expand All @@ -33,7 +33,7 @@ import {
useAuthorMenuItem,
usePostTypeArchiveMenuItems,
} from './utils';
import AddCustomGenericTemplateModal from './add-custom-generic-template-modal';
import AddCustomGenericTemplateModalContent from './add-custom-generic-template-modal-content';
import TemplateActionsLoadingScreen from './template-actions-loading-screen';
import { store as editSiteStore } from '../../store';
import { unlock } from '../../private-apis';
Expand Down Expand Up @@ -253,14 +253,14 @@ export default function NewTemplate( {
</Grid>
) }
{ modalContent === modalContentMap.customTemplate && (
<AddCustomTemplateModal
<AddCustomTemplateModalContent
onSelect={ createTemplate }
entityForSuggestions={ entityForSuggestions }
/>
) }
{ modalContent ===
modalContentMap.customGenericTemplate && (
<AddCustomGenericTemplateModal
<AddCustomGenericTemplateModalContent
onClose={ onModalClose }
createTemplate={ createTemplate }
/>
Expand Down

0 comments on commit 2517beb

Please sign in to comment.