Skip to content

Commit

Permalink
Hide redundant Post Visibility legend.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZebulanStanphill committed Oct 21, 2020
1 parent fffb561 commit e8e8c95
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function PostVisibility() {
) }
</span>
) }
{ canEdit && <PostVisibilityForm /> }
{ canEdit && <PostVisibilityForm showLegend={ false } /> }
</PanelBody>
) }
/>
Expand Down
15 changes: 11 additions & 4 deletions packages/editor/src/components/post-visibility/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ export class PostVisibility extends Component {
}

render() {
const { visibility, password, instanceId } = this.props;
const {
visibility,
password,
instanceId,
showLegend = true,
} = this.props;

const visibilityHandlers = {
public: {
Expand All @@ -88,9 +93,11 @@ export class PostVisibility extends Component {
key="visibility-selector"
className="editor-post-visibility__dialog-fieldset"
>
<legend className="editor-post-visibility__dialog-legend">
{ __( 'Post Visibility' ) }
</legend>
{ showLegend && (
<legend className="editor-post-visibility__dialog-legend">
{ __( 'Post Visibility' ) }
</legend>
) }
{ visibilityOptions.map( ( { value, label, info } ) => (
<div
key={ value }
Expand Down

0 comments on commit e8e8c95

Please sign in to comment.