mirror of
https://fast.feibisi.com/https://github.com/lubusIN/visual-blueprint-builder.git
synced 2025-10-03 04:01:24 +08:00
chore(ui): apply review suggestions for modal labels and prop naming (#60)
This commit is contained in:
parent
44923ac46d
commit
459e58cc18
3 changed files with 8 additions and 8 deletions
|
@ -21,7 +21,7 @@ import {
|
|||
*/
|
||||
import { handleBlueprintData, useBlueprintData } from './utils';
|
||||
|
||||
function Gallery({ label = 'Gallery', icon = null, onClick }) {
|
||||
function Gallery({ label = 'Gallery', icon = null, handleClose }) {
|
||||
const { updateBlueprintConfig } = useBlueprintData();
|
||||
const { createNotice } = useDispatch(noticesStore);
|
||||
const [isModalOpen, setModalOpen] = useState(false);
|
||||
|
@ -146,7 +146,7 @@ function Gallery({ label = 'Gallery', icon = null, onClick }) {
|
|||
borderRadius: '4px',
|
||||
alignSelf: 'flex-end',
|
||||
}}
|
||||
onClick={() => { fetchBlueprintDetails(blueprintName), onClick(onClick) }}
|
||||
onClick={() => { fetchBlueprintDetails(blueprintName); handleClose(); }}
|
||||
>
|
||||
{__('Import', 'wp-playground-blueprint-editor')}
|
||||
</Button>
|
||||
|
|
|
@ -41,15 +41,15 @@ const OnboardingModal = () => {
|
|||
|
||||
return (
|
||||
<Modal
|
||||
title={__('Start Building Your Blueprint', 'wp-playground-blueprint-editor')}
|
||||
title={__('Start Blueprint From', 'wp-playground-blueprint-editor')}
|
||||
onRequestClose={handleClose}
|
||||
shouldCloseOnClickOutside
|
||||
shouldCloseOnEsc
|
||||
size="medium"
|
||||
>
|
||||
<Grid columns={3} spacing={4}>
|
||||
<OpenJson label='Json' icon={code} onClick={handleClose} />
|
||||
<Gallery label='Gallery' icon={gallery} onClick={handleClose} />
|
||||
<OpenJson label='JSON' icon={code} handleClose={handleClose} />
|
||||
<Gallery label='Gallery' icon={gallery} handleClose={handleClose} />
|
||||
<Button
|
||||
onClick={handleClose}
|
||||
icon={plus}
|
||||
|
@ -60,7 +60,7 @@ const OnboardingModal = () => {
|
|||
padding: '13px'
|
||||
}}
|
||||
>
|
||||
{__('Start Blank', 'wp-playground-blueprint-editor')}
|
||||
{__('Blank', 'wp-playground-blueprint-editor')}
|
||||
</Button>
|
||||
<Button variant="tertiary" onClick={handleClose}>
|
||||
{__('Skip', 'wp-playground-blueprint-editor')}
|
||||
|
|
|
@ -4,7 +4,7 @@ import { FormFileUpload, DropZone } from '@wordpress/components';
|
|||
import { store as noticesStore } from '@wordpress/notices';
|
||||
import { handleBlueprintData, useBlueprintData } from './utils'
|
||||
|
||||
const OpenJson = ({ label = 'Open', icon = null, onClick }) => {
|
||||
const OpenJson = ({ label = 'Open', icon = null, handleClose }) => {
|
||||
const { createNotice } = useDispatch(noticesStore);
|
||||
const { updateBlueprintConfig } = useBlueprintData();
|
||||
|
||||
|
@ -32,7 +32,7 @@ const OpenJson = ({ label = 'Open', icon = null, onClick }) => {
|
|||
const file = event.target.files[0];
|
||||
if (file) {
|
||||
processJsonFile(file);
|
||||
onClick(onClick);
|
||||
handleClose();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue