Skip to content

Commit

Permalink
Version revert
Browse files Browse the repository at this point in the history
  • Loading branch information
Chrillaz committed Nov 2, 2020
1 parent 182d6cf commit a47aee9
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 52 deletions.
2 changes: 1 addition & 1 deletion blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: Noor Blocks
* Description: Collection of custom blocks.
* Version: 1.1.2
* Version: 1.1.3
* Author: Noor Digital Agency
* Author URI: https://noordigital.com
* Text Domain: blocks
Expand Down
4 changes: 2 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors:
Tags: block
Requires at least: 5.3.2
Tested up to: 5.4.1
Stable tag: 1.1.2
Stable tag: 1.1.3
Requires PHP: 7.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -52,7 +52,7 @@ directory take precedence. For example, `/assets/screenshot-1.png` would win ove

1. Added location icon to core/button

* Patch 1.1.2
* Patch 1.1.3

1. Added global block control for media query display

Expand Down
33 changes: 0 additions & 33 deletions src/components/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { __ } from '@wordpress/i18n'
import { PanelBody, ToggleControl } from '@wordpress/components'
import { PanelColorSettings } from '@wordpress/block-editor'
import { RadioGroup } from '../components/radio-group'
import { Fragment } from '@wordpress/element'

export const SmallScreenControl = ({ setAttributes, attributes: { mediaControl }}) => (
<PanelBody
Expand Down Expand Up @@ -111,35 +110,3 @@ export const ButtonIconControl = ({ attributes: {useIcon, alignIcon, icon}, setA
</PanelBody>
);
}

export const ButtonAllControls = (props) => {

const { color, setColor, backgroundColor, setBackgroundColor, setAttributes } = props;

setAttributes({ className: color.class != undefined ? color.class + ' has-color' : '' });

setAttributes({ className: backgroundColor.class != undefined ? backgroundColor.class + ' has-background' : '' });

return (
<Fragment>
<PanelColorSettings
title={__('Color settings')}
initialOpen={false}
colorSettings={[
{
value: backgroundColor.color,
onChange: setBackgroundColor,
label: __( 'Button background color' )
},
{
value: color.color,
onChange: setColor,
label: __( 'Button text color' )
}
]}
/>

<ButtonIconControl {...props} />
</Fragment>
)
}
14 changes: 0 additions & 14 deletions src/filters/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,6 @@ export const attributes = (settings, name) => {
});
}

// wp-bootstrap-blocks plugin
if ( 'wp-bootstrap-blocks/button' === name ) {

Object.assign(settings.attributes, {
...inlineIconAttributes,
backgroundColor: {
type: 'string'
},
color: {
type: 'string'
}
})
}

if ( 'core/column' === name ) {

Object.assign(settings.attributes, {
Expand Down
3 changes: 1 addition & 2 deletions src/filters/blockEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from '../components/controls'

export const blockEdit = compose(
withColors({ backgroundColor: 'background-color', color: 'color' }),
withColors({ backgroundColor: 'background-color' }),
createHigherOrderComponent( BlockEdit => props => {

if ( ! props.name.includes( 'noor' ) ) {
Expand All @@ -24,7 +24,6 @@ export const blockEdit = compose(
<SmallScreenControl {...props} />
{props.name === 'core/column' && <ColumnBackgrounControl {...props} />}
{props.name === 'core/button' && <ButtonIconControl {...props} />}
{props.name === 'wp-bootstrap-blocks/button' && <ButtonAllControls {...props} />}
</InspectorControls>
</Fragment>
)
Expand Down

0 comments on commit a47aee9

Please sign in to comment.