How to use the @amalto/helpers.isValidColorCode function in @amalto/helpers

To help you get started, we’ve selected a few @amalto/helpers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github amalto / platform6-ui-components / components / data-grid / components / HeaderItem.tsx View on Github external
private handleColorChange = ( color: string ): void => {

        const { wordings } = this.state
        const { columnHeader, templateChangeHandler } = this.props

        if ( isValidColorCode( color ) ) {

            let template: DisplayTemplate = {}
            template[columnHeader.id] = {
                color
            }

            templateChangeHandler( template )

            window.setTimeout( this.updateContextMenu, 250 )
        }
        else {
            this.props.displayNotification( {
                title: wordings['error'],
                message: wordings['invalidColorCode'],
                level: 'error'
            } )