Skip to content

Instantly share code, notes, and snippets.

@Circuit8
Created June 22, 2016 16:18
Show Gist options
  • Select an option

  • Save Circuit8/2bbf2cb278902e0cbbea0303fa6de5e1 to your computer and use it in GitHub Desktop.

Select an option

Save Circuit8/2bbf2cb278902e0cbbea0303fa6de5e1 to your computer and use it in GitHub Desktop.

Revisions

  1. Circuit8 created this gist Jun 22, 2016.
    22 changes: 22 additions & 0 deletions delete_button.es6.jsx
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    class DeleteButton extends React.Component {

    render () {
    if( this.props.active ){
    confirm = <confirmationModal />
    }
    return(
    <a href={this.props.url}
    data-method="delete"
    className="delete-button"
    onClick={this.handleClick} >
    <i className="fa fa-trash"/>
    {confirm}
    </a>
    );
    };

    handleClick = (e) =>{
    e.preventDefault
    this.props.active = true
    }
    }