Skip to content
116 changes: 0 additions & 116 deletions src/content-gate/access-rules.js

This file was deleted.

25 changes: 7 additions & 18 deletions src/content-gate/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { registerPlugin } from '@wordpress/plugins';
/**
* Internal dependencies
*/
import AccessRules from './access-rules';
import PositionControl from '../../packages/components/src/position-control';
import './editor.scss';

Expand Down Expand Up @@ -150,6 +149,8 @@ function GateEdit() {
</Button>
) ) }
</div>
</PluginDocumentSettingPanel>
<PluginDocumentSettingPanel name="content-gate-settings-panel" title={ __( 'Settings', 'newspack-plugin' ) }>
{ meta.style === 'inline' && (
<CheckboxControl
label={ __( 'Apply fade to last paragraph', 'newspack-plugin' ) }
Expand Down Expand Up @@ -180,15 +181,11 @@ function GateEdit() {
/>
</Fragment>
) }
</PluginDocumentSettingPanel>
<PluginDocumentSettingPanel name="content-gate-settings-panel" title={ __( 'Settings', 'newspack-plugin' ) }>
<TextControl
type="number"
min="1"
value={ meta.gate_priority }
label={ __( 'Priority', 'newspack-plugin' ) }
onChange={ value => editPost( { meta: { gate_priority: value } } ) }
help={ __( 'The order in which the gate and its access rules will be evaluated.', 'newspack-plugin' ) }
<CheckboxControl
label={ __( 'Use “More” tag to manually place content gate', 'newspack-plugin' ) }
checked={ meta.use_more_tag }
onChange={ value => editPost( { meta: { use_more_tag: value } } ) }
help={ __( 'Override the default paragraph count on pages where a “More” block has been placed.', 'newspack-plugin' ) }
/>
<TextControl
type="number"
Expand All @@ -198,15 +195,7 @@ function GateEdit() {
onChange={ value => editPost( { meta: { visible_paragraphs: value } } ) }
help={ __( 'Number of paragraphs that readers can see above the content gate.', 'newspack-plugin' ) }
/>
<hr />
<CheckboxControl
label={ __( 'Use “More” tag to manually place content gate', 'newspack-plugin' ) }
checked={ meta.use_more_tag }
onChange={ value => editPost( { meta: { use_more_tag: value } } ) }
help={ __( 'Override the default paragraph count on pages where a “More” block has been placed.', 'newspack-plugin' ) }
/>
</PluginDocumentSettingPanel>
<AccessRules rules={ meta.access_rules } editPost={ editPost } />
<PluginDocumentSettingPanel name="content-gate-metering-panel" title={ __( 'Metering', 'newspack-plugin' ) }>
<CheckboxControl
label={ __( 'Enable metering', 'newspack-plugin' ) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WordPress dependencies.
*/
import { Fragment, useState, useCallback } from '@wordpress/element';
import { SelectControl, CheckboxControl, TextControl, Button } from '@wordpress/components';
import { SelectControl, CheckboxControl, TextControl, Button, ExternalLink } from '@wordpress/components';
import { __ } from '@wordpress/i18n';

/**
Expand Down Expand Up @@ -116,6 +116,9 @@ export default function ContentGateSettings( { gate, onDelete, onSave }: Content
<Button isDestructive variant="secondary" onClick={ handleDelete }>
{ __( 'Delete', 'newspack-plugin' ) }
</Button>
<ExternalLink href={ `/wp-admin/post.php?post=${ gate.id }&action=edit` }>
{ __( 'Edit Appearance', 'newspack-plugin' ) }
</ExternalLink>
</div>
</Fragment>
);
Expand Down