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
*
* @typedef {HTMLElement} Modal
* @typedef {ReactElement|HTMLElement} Modal
*/
/**
@ -16,7 +16,7 @@
* @property {boolean} [customClassName=null] - '.ModalClass'
*/
const uiModalServicePublicApi = {
const uiModalServicePublicAPI = {
name: 'UIModalService',
hide,
show,
@ -28,14 +28,14 @@ const uiModalServiceImplementation = {
_show: () => console.warn('show() NOT IMPLEMENTED'),
};
function createUiModalService() {
return uiModalServicePublicApi;
function createUIModalService() {
return uiModalServicePublicAPI;
}
/**
* Show a new UI modal;
*
* @param {Modal} component
* @param {Modal} component React component
* @param {ModalProps} props { backdrop, keyboard, show, closeButton, title, customClassName }
*/
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]
*/
const uiNotificationServicePublicApi = {
const uiNotificationServicePublicAPI = {
name: 'UINotificationService',
hide,
show,
@ -23,7 +23,7 @@ const uiNotificationServiceImplementation = {
};
function createUINotificationService() {
return uiNotificationServicePublicApi;
return uiNotificationServicePublicAPI;
}
/**

View File

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