Update modal width to 65vw (#638)

* update modal width to 65vw

* set the modal size to large

* update wp_enqueue_style arguments

Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com>

---------

Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com>
Co-authored-by: Jason Crist <jcrist@pbking.com>
Co-authored-by: Matias Benedetto <matias.benedetto@gmail.com>
This commit is contained in:
Madhu Dollu 2024-05-30 16:34:42 +05:30 committed by GitHub
parent 485f8937de
commit 2c63cdc4b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 45 additions and 11 deletions

View file

@ -28,6 +28,12 @@ class CBT_Editor_Tools {
$asset_file['dependencies'],
$asset_file['version']
);
wp_enqueue_style(
'create-block-theme-styles',
plugins_url( 'build/plugin-sidebar.css', dirname( __FILE__ ) ),
array(),
$asset_file['version']
);
wp_enqueue_script(
'create-block-theme-slot-fill',
);

View file

@ -33,13 +33,14 @@ const ThemeJsonEditorModal = ( { onRequestClose } ) => {

return (
<Modal
isFullScreen
size="large"
title={ sprintf(
// translators: %s: theme name.
__( 'theme.json for %s', 'create-block-theme' ),
themeName
) }
onRequestClose={ onRequestClose }
className="create-block-theme__theme-json-modal"
>
<CodeMirror
extensions={ [ json() ] }

View file

@ -133,13 +133,14 @@ export const ThemeMetadataEditorModal = ( { onRequestClose } ) => {

return (
<Modal
isFullScreen
size="large"
title={ sprintf(
// translators: %s: theme name.
__( 'Metadata for %s', 'create-block-theme' ),
theme?.name
) }
onRequestClose={ onRequestClose }
className="create-block-theme__metadata-editor-modal"
>
<VStack>
<Text>
@ -305,12 +306,7 @@ ${ __( 'Source', 'create-block-theme' ) }` }
<VStack alignment="left">
<img
src={ theme.screenshot }
style={ {
maxWidth: '200px',
height: 'auto',
aspectRatio: '4 / 3',
objectFit: 'cover',
} }
className="create-block-theme__metadata-editor-modal__screenshot"
alt=""
/>
<Button
@ -353,9 +349,14 @@ ${ __( 'Source', 'create-block-theme' ) }` }
/>
</VStack>
<Spacer />
<Button variant="primary" onClick={ handleUpdateClick }>
{ __( 'Update', 'create-block-theme' ) }
</Button>
<HStack
justify={ 'flex-end' }
className="create-block-theme__metadata-editor-modal__footer"
>
<Button variant="primary" onClick={ handleUpdateClick }>
{ __( 'Update', 'create-block-theme' ) }
</Button>
</HStack>
</Modal>
);
};

View file

@ -49,6 +49,7 @@ import { ThemeMetadataEditorModal } from './editor-sidebar/metadata-editor-modal
import ScreenHeader from './editor-sidebar/screen-header';
import { downloadExportedTheme } from './resolvers';
import downloadFile from './utils/download-file';
import './plugin-styles.scss';

const CreateBlockThemePlugin = () => {
const [ isEditorOpen, setIsEditorOpen ] = useState( false );

25
src/plugin-styles.scss Normal file
View file

@ -0,0 +1,25 @@
$plugin-prefix: "create-block-theme";
$modal-footer-height: 70px;

.#{$plugin-prefix} {
&__metadata-editor-modal {
padding-bottom: $modal-footer-height;

&__footer {
border-top: 1px solid #ddd;
background-color: #fff;
position: absolute;
bottom: 0;
margin: 0 -32px;
padding: 16px 32px;
height: $modal-footer-height;
}

&__screenshot {
max-width: 200px;
height: auto;
aspect-ratio: 4 / 3;
object-fit: cover;
}
}
}