1.0.5 • Published 6 years ago

library-modal-component v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

Modal Component

Modal component for React

Install and save component as a dependency

npm install --save library-modal-component

Install Bootstrap as a dependency

npm install --save bootstrap

Import component into your app

import ModalComponent from 'library-modal-component'

Import Bootstrap Javascript into your app

import 'bootstrap/dist/js/bootstrap.bundle.js'

Create the function that will handle the modal confirm

handleModalConfirm (event, modalId) {
	document.getElementById(modalId).click()
}

Render the component with the functions we created as well as any other props that are needed

render () {
	return (
		<ModalComponent
			modalTheme="light"
			modalId="modalId"
			modalTitle="Modal title"
			modalBody="Modal body"
      modalCloseText="Close"
			modalClose="closeModal"
      modalConfirmText="Confirm"
			handleModalConfirm={this.handleModalConfirm.bind(this)} />
	)
}
PropValues
modalThemelight or dark
modalIdString
modalTitleString
modalBodyString
modalCloseTextString
modalCloseString
modalConfirmTextString
modalConfirmhandleModalConfirm function
1.0.5

6 years ago

1.0.4

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago