Skip to content

Commit

Permalink
Add minimum version to additional metadata panel.
Browse files Browse the repository at this point in the history
  • Loading branch information
jffng committed Sep 18, 2024
1 parent b3b3386 commit 2f9225f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/editor-sidebar/create-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
__experimentalText as Text,
PanelBody,
Button,
SelectControl,
TextControl,
TextareaControl,
} from '@wordpress/components';
Expand All @@ -28,6 +29,9 @@ import {
createClonedTheme,
createChildTheme,
} from '../resolvers';
import { generateWpVersions } from '../utils/generate-versions';

const WP_MINIMUM_VERSIONS = generateWpVersions( WP_VERSION ); // eslint-disable-line no-undef

export const CreateThemePanel = ( { createType } ) => {
const { createErrorNotice } = useDispatch( noticesStore );
Expand All @@ -47,6 +51,7 @@ export const CreateThemePanel = ( { createType } ) => {
author: '',
author_uri: '',
tags_custom: '',
requires_wp: '',
subfolder,
} );

Expand Down Expand Up @@ -195,6 +200,20 @@ export const CreateThemePanel = ( { createType } ) => {
'create-block-theme'
) }
/>
<SelectControl
label={ __(
'Minimum WordPress version',
'create-block-theme'
) }
value={ theme.requires_wp }
options={ WP_MINIMUM_VERSIONS.map( ( version ) => ( {
label: version,
value: version,
} ) ) }
onChange={ ( value ) => {
setTheme( { ...theme, requires_wp: value } );
} }
/>
</details>
<br />
{ createType === 'createClone' && (
Expand Down

0 comments on commit 2f9225f

Please sign in to comment.