UNPKG

@eightshift/frontend-libs

Version:

A collection of useful frontend utility modules. powered by Eightshift

33 lines (30 loc) 1.07 kB
import React from 'react'; import { __ } from '@wordpress/i18n'; import { PanelBody } from '@wordpress/components'; import { checkAttr, getAttrKey, getOption, props, OptionSelector } from '@eightshift/frontend-libs/scripts'; import { ParagraphOptions as ParagraphOptionsComponent } from '../../../components/paragraph/components/paragraph-options'; import manifest from '../manifest.json'; export const ParagraphOptions = ({ attributes, setAttributes }) => { const paragraphAlign = checkAttr('paragraphAlign', attributes, manifest); return ( <PanelBody title={__('Paragraph', '%g_textdomain%')}> <ParagraphOptionsComponent {...props('paragraph', attributes, { setAttributes, })} additionalControls={ <OptionSelector value={paragraphAlign} options={getOption('paragraphAlign', attributes, manifest)} onChange={(value) => setAttributes({ [getAttrKey('paragraphAlign', attributes, manifest)]: value })} noBottomSpacing iconOnly /> } noLabel noUseToggle noExpandButton /> </PanelBody> ); };