diff --git a/apps/full-site-editing/full-site-editing-plugin/full-site-editing/blocks/site-credit/edit.js b/apps/full-site-editing/full-site-editing-plugin/full-site-editing/blocks/site-credit/edit.js index 5ddf6060d14ad..15a39385dd58a 100644 --- a/apps/full-site-editing/full-site-editing-plugin/full-site-editing/blocks/site-credit/edit.js +++ b/apps/full-site-editing/full-site-editing-plugin/full-site-editing/blocks/site-credit/edit.js @@ -3,9 +3,9 @@ /** * WordPress dependencies */ -import { compose } from '@wordpress/compose'; +import { compose, withState } from '@wordpress/compose'; import { withSelect, withDispatch } from '@wordpress/data'; -import { Fragment } from '@wordpress/element'; +import { SelectControl } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; /** @@ -13,11 +13,23 @@ import { __ } from '@wordpress/i18n'; */ import useSiteOptions from '../useSiteOptions'; +// @TODO: These should probably come from the existing set of options on the backend. +// They already have translation variations which could be incorporated here. +const creditOptions = [ + { label: 'WordPress.com', value: 'com' }, + { label: 'WordPress.com Logo', value: 'svg' }, + { label: 'A WordPress.com Website', value: 'acom' }, + { label: 'Blog at WordPress.com', value: 'blog' }, + { label: 'Powered by WordPress.com', value: 'powered' }, +]; + function SiteCreditEdit( { createErrorNotice, isSelected, setAttributes, shouldUpdateSiteOption, + creditOption, + setState, } ) { const inititalDescription = __( 'Site credit loading…' ); @@ -32,15 +44,19 @@ function SiteCreditEdit( { const { option } = siteOptions; + const setOption = newOption => setState( { creditOption: newOption } ); + return ( - - { option } - , - +
+ { option } + , + +
); } export default compose( [ + withState( { creditOption: 'acom' } ), withSelect( ( select, { clientId } ) => { const { isSavingPost, isPublishingPost, isAutosavingPost, isCurrentPostPublished } = select( 'core/editor'