chore(ui): apply review suggestions for modal labels and prop naming (#60)

This commit is contained in:
Cy-Yaksh 2025-05-23 16:30:24 +05:30
parent 44923ac46d
commit 459e58cc18
3 changed files with 8 additions and 8 deletions

View file

@ -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>

View file

@ -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')}

View file

@ -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();
}
};