-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(content-distribution): Block the editor for incoming posts (#181)
* feat(content-distribution): Blcok editor for incoming posts * Work in progress * Add buttons and a bunch more logic * phpcs and remove unused meta register * Better "wait" for sidebar open * Add busy state to button * Reload page on relink * Rename component and fix up CSS a bit
- Loading branch information
Showing
8 changed files
with
420 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/content-distribution/content-distribution-panel/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* WordPress dependencies. | ||
*/ | ||
import { __ } from '@wordpress/i18n'; | ||
import { PluginSidebar } from '@wordpress/editor'; | ||
import { Flex, Panel, PanelBody } from '@wordpress/components'; | ||
import { globe } from '@wordpress/icons'; | ||
|
||
/** | ||
* Internal dependencies. | ||
*/ | ||
import './style.scss'; | ||
|
||
const ContentDistributionPanel = ({ header, body, footer, buttons }) => { | ||
return ( | ||
<PluginSidebar | ||
name="newspack-network-content-distribution-panel" | ||
icon={ globe } | ||
title={ __( 'Distribute', 'newspack-network' ) } | ||
className="newspack-network-content-distribution-panel" | ||
> | ||
<Panel> | ||
<PanelBody className="content-distribution-panel-header"> | ||
{ header } | ||
</PanelBody> | ||
<PanelBody className="content-distribution-panel-body"> | ||
{ body } | ||
</PanelBody> | ||
<PanelBody className="content-distribution-panel-footer"> | ||
{ footer } | ||
<Flex direction="column" className="content-distribution-panel__button-column" gap={ 4 }> | ||
{ buttons } | ||
</Flex> | ||
</PanelBody> | ||
</Panel> | ||
</PluginSidebar> | ||
); | ||
}; | ||
|
||
export default ContentDistributionPanel; |
26 changes: 26 additions & 0 deletions
26
src/content-distribution/content-distribution-panel/style.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
.newspack-network-content-distribution-panel { | ||
height: calc(100% - 47px); | ||
|
||
.components-panel { | ||
height: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.components-panel__body { | ||
border: 0; | ||
} | ||
|
||
.content-distribution-panel-body { | ||
flex: 1 1 100%; | ||
overflow-y: auto; | ||
padding-top: 0; | ||
|
||
} | ||
|
||
.content-distribution-panel__button-column { | ||
.components-button { | ||
justify-content: center; | ||
} | ||
} | ||
} |
Oops, something went wrong.