react-modal-dialog icon indicating copy to clipboard operation
react-modal-dialog copied to clipboard

Is there a way to send a custom class to closeButton?

Open AlexandraKim opened this issue 8 years ago • 4 comments

AlexandraKim avatar Nov 07 '16 17:11 AlexandraKim

@AlexandraKim for now as I see - there is no ability to put custom class directly to closeButton. But I solve this by adding class: <ModalDialog className='custom-modal'> and then just use CSS(SCSS)

.custom-modal {

  /*override here container rules*/

  [class^='closeButton'] {
    display: none;
  }
}

@qimingweng but I reach this issue when I want to create a new one about adding prop for show/hide native close button. Maybe in some days after I create own PR.

m1n0s avatar Nov 10 '16 19:11 m1n0s

What's the use case here?

If you want no close button or a different close button, I would suggest copying the code from ModalDialog.js and creating a new type of Dialog!

qimingweng avatar Nov 10 '16 22:11 qimingweng

@qimingweng this way isn't ok for me personally. I install it by npm and I don't want to change sourсe code.

m1n0s avatar Nov 11 '16 09:11 m1n0s

I agree with @m1n0s. You should be able to just hide the Close button Copying it would mean having to npm install all

'classnames';
'dynamics.js';
'react-center-component';
'active-event-stack';
'keycode';
'narcissus';

Which I don't want because it would only pollute my project

tiaaaa123 avatar Mar 17 '17 18:03 tiaaaa123