Skip to content

Commit

Permalink
Expose custom gradient picker (#19480)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta authored Jan 9, 2020
1 parent 789dae3 commit 8fcbed7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/components/src/gradient-picker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ import { useCallback, useMemo } from '@wordpress/element';
* Internal dependencies
*/
import CircularOptionPicker from '../circular-option-picker';
import CustomGradientPicker from '../custom-gradient-picker';

export default function GradientPicker( {
className,
gradients,
onChange,
value,
clearable = true,
disableCustomGradients = false,
} ) {
const clearGradient = useCallback(
() => onChange( undefined ),
Expand Down Expand Up @@ -62,6 +64,13 @@ export default function GradientPicker( {
{ __( 'Clear' ) }
</CircularOptionPicker.ButtonAction>
) }
/>
>
{ ! disableCustomGradients && (
<CustomGradientPicker
value={ value }
onChange={ onChange }
/>
) }
</CircularOptionPicker>
);
}

0 comments on commit 8fcbed7

Please sign in to comment.