mirror of
https://github.com/Telecominfraproject/wlan-cloud-ui.git
synced 2025-10-30 18:27:58 +00:00
30 lines
729 B
JavaScript
30 lines
729 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
import UserContext from 'contexts/UserContext';
|
|
|
|
const UserProvider = ({ children, id, email, role, customerId, updateUser, updateToken }) => (
|
|
<UserContext.Provider value={{ id, email, role, customerId, updateUser, updateToken }}>
|
|
{children}
|
|
</UserContext.Provider>
|
|
);
|
|
|
|
UserProvider.propTypes = {
|
|
children: PropTypes.node.isRequired,
|
|
updateUser: PropTypes.func.isRequired,
|
|
updateToken: PropTypes.func.isRequired,
|
|
id: PropTypes.number,
|
|
email: PropTypes.string,
|
|
role: PropTypes.string,
|
|
customerId: PropTypes.number,
|
|
};
|
|
|
|
UserProvider.defaultProps = {
|
|
id: null,
|
|
email: null,
|
|
role: null,
|
|
customerId: null,
|
|
};
|
|
|
|
export default UserProvider;
|