From 9c011c6ae214611f5aafeafdf73cfea838590aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Wrede?= Date: Mon, 6 Nov 2017 22:12:16 +0100 Subject: [PATCH] Add label elements to scheduler and visibility (#3317) * Change span to label elements. * Extract withAPIData function from export * Restore destroyed line --- editor/sidebar/post-schedule/index.js | 26 +++++++++++++++++-------- editor/sidebar/post-visibility/index.js | 26 +++++++++++++++++-------- 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/editor/sidebar/post-schedule/index.js b/editor/sidebar/post-schedule/index.js index 317184bbef4abf..ef35b175764e23 100644 --- a/editor/sidebar/post-schedule/index.js +++ b/editor/sidebar/post-schedule/index.js @@ -1,8 +1,13 @@ +/** + * External dependencies + */ +import { flowRight } from 'lodash'; + /** * WordPress dependencies */ import { __ } from '@wordpress/i18n'; -import { PanelRow, Dropdown, withAPIData } from '@wordpress/components'; +import { PanelRow, Dropdown, withAPIData, withInstanceId } from '@wordpress/components'; /** * Internal dependencies @@ -11,19 +16,21 @@ import './style.scss'; import PostScheduleLabel from '../../post-schedule/label'; import PostScheduleForm from '../../post-schedule'; -export function PostSchedule( { user } ) { +export function PostSchedule( { user, instanceId } ) { if ( ! user.data || ! user.data.capabilities.publish_posts ) { return null; } + const postScheduleSelectorId = 'post-schedule-selector-' + instanceId; return ( - { __( 'Publish' ) } + (