- Code refactor for maintainability - Allow users to adjust the order of the statistics via drag and drop Signed-off-by: Dave Richer <dave@imexsystems.ca>
33 lines
754 B
JavaScript
33 lines
754 B
JavaScript
import React from "react";
|
|
import { ProductFruits } from "react-product-fruits";
|
|
import PropTypes from "prop-types";
|
|
|
|
const ProductFruitsWrapper = React.memo(({ currentUser, workspaceCode }) => {
|
|
return (
|
|
workspaceCode &&
|
|
currentUser?.authorized === true &&
|
|
currentUser?.email && (
|
|
<ProductFruits
|
|
lifeCycle="unmount"
|
|
workspaceCode={workspaceCode}
|
|
debug
|
|
language="en"
|
|
user={{
|
|
email: currentUser.email,
|
|
username: currentUser.email
|
|
}}
|
|
/>
|
|
)
|
|
);
|
|
});
|
|
|
|
export default ProductFruitsWrapper;
|
|
|
|
ProductFruitsWrapper.propTypes = {
|
|
currentUser: PropTypes.shape({
|
|
authorized: PropTypes.bool,
|
|
email: PropTypes.string
|
|
}),
|
|
workspaceCode: PropTypes.string
|
|
};
|