From 72434456393a451cfc56d2d16e323da3f4af9892 Mon Sep 17 00:00:00 2001 From: prconcepcion Date: Wed, 20 Mar 2024 08:22:15 +0800 Subject: [PATCH] refactored location control implementation --- src/block/map/editor.scss | 9 ++----- src/block/map/location-control.js | 40 ++++++++++++++++--------------- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/block/map/editor.scss b/src/block/map/editor.scss index 6d80d5f6a..7cfd8d9f4 100644 --- a/src/block/map/editor.scss +++ b/src/block/map/editor.scss @@ -40,15 +40,10 @@ .stk-control__location-control { display: flex; - > :not(.stk--has-dynamic-content) { - .stk-dynamic-content-control__button { - margin-top: 23px; - } - } - .stk-control__reset-button { position: static; - margin-left: 2px; + margin-top: 2px; + margin-left: 60px; margin-right: 2px; } } diff --git a/src/block/map/location-control.js b/src/block/map/location-control.js index a1c6882db..54252b952 100644 --- a/src/block/map/location-control.js +++ b/src/block/map/location-control.js @@ -7,7 +7,7 @@ import { DynamicContentControl, useDynamicContentControlProps } from '~stackable /** * WordPress dependencies */ -import { TextControl } from '@wordpress/components' +import { TextControl, BaseControl as GutBaseControl } from '@wordpress/components' import { __ } from '@wordpress/i18n' import { useState, useEffect, useRef, @@ -63,30 +63,32 @@ const LocationControl = props => { }, [ ref.current, waitForGoogle ] ) return ( -
- - { - props.onTextChange( value ) - } } - /> - -
+ +
+ + { + props.onTextChange( value ) + } } + /> + +
+
) } LocationControl.defaultProps = { onChange: null, value: '', - hasPanelModifiedIndicator: true, } export default LocationControl