CR Update: fix casing and add required proptypes to providers

This commit is contained in:
Igor 2019-11-14 11:16:35 -03:00
parent e684558783
commit 95c18b4986
3 changed files with 11 additions and 11 deletions

View File

@ -1,7 +1,7 @@
/** /**
* A UI Element * A UI Element
* *
* @typedef {HTMLElement} Modal * @typedef {ReactElement|HTMLElement} Modal
*/ */
/** /**
@ -16,7 +16,7 @@
* @property {boolean} [customClassName=null] - '.ModalClass' * @property {boolean} [customClassName=null] - '.ModalClass'
*/ */
const uiModalServicePublicApi = { const uiModalServicePublicAPI = {
name: 'UIModalService', name: 'UIModalService',
hide, hide,
show, show,
@ -28,14 +28,14 @@ const uiModalServiceImplementation = {
_show: () => console.warn('show() NOT IMPLEMENTED'), _show: () => console.warn('show() NOT IMPLEMENTED'),
}; };
function createUiModalService() { function createUIModalService() {
return uiModalServicePublicApi; return uiModalServicePublicAPI;
} }
/** /**
* Show a new UI modal; * Show a new UI modal;
* *
* @param {Modal} component * @param {Modal} component React component
* @param {ModalProps} props { backdrop, keyboard, show, closeButton, title, customClassName } * @param {ModalProps} props { backdrop, keyboard, show, closeButton, title, customClassName }
*/ */
function show(component, props) { function show(component, props) {
@ -86,4 +86,4 @@ function setServiceImplementation({
} }
} }
export default createUiModalService; export default createUIModalService;

View File

@ -10,7 +10,7 @@
* @property {boolean} [autoClose=true] * @property {boolean} [autoClose=true]
*/ */
const uiNotificationServicePublicApi = { const uiNotificationServicePublicAPI = {
name: 'UINotificationService', name: 'UINotificationService',
hide, hide,
show, show,
@ -23,7 +23,7 @@ const uiNotificationServiceImplementation = {
}; };
function createUINotificationService() { function createUINotificationService() {
return uiNotificationServicePublicApi; return uiNotificationServicePublicAPI;
} }
/** /**

View File

@ -80,11 +80,11 @@ const ModalProvider = ({ children, modal: Modal, service }) => {
}; };
ModalProvider.propTypes = { ModalProvider.propTypes = {
children: PropTypes.node, children: PropTypes.node.isRequired,
modal: PropTypes.node, modal: PropTypes.node.isRequired,
service: PropTypes.shape({ service: PropTypes.shape({
setServiceImplementation: PropTypes.func, setServiceImplementation: PropTypes.func,
}), }).isRequired,
}; };
/** /**