From 984e5c673038692d77473c46c59ad3fb01dafcc5 Mon Sep 17 00:00:00 2001 From: Adam Butterworth Date: Fri, 22 Feb 2019 14:20:59 -0500 Subject: [PATCH] Update empty states to match UX recommendation --- .../UserProfile/elements/EmptyContent.jsx | 35 +++++++------------ 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/src/components/UserProfile/elements/EmptyContent.jsx b/src/components/UserProfile/elements/EmptyContent.jsx index a70f31a..3201247 100644 --- a/src/components/UserProfile/elements/EmptyContent.jsx +++ b/src/components/UserProfile/elements/EmptyContent.jsx @@ -1,19 +1,12 @@ import React from 'react'; import PropTypes from 'prop-types'; - +import { Button } from 'reactstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faPlus } from '@fortawesome/free-solid-svg-icons'; function EmptyContent({ children, onClick, showPlusIcon }) { const onKeyDown = (e) => { if (e.key === 'Enter') onClick(); }; - const commonProps = { - className: 'd-flex align-items-center p-3 bg-light rounded text-muted w-100', - style: { - cursor: onClick ? 'pointer' : null, - }, - }; - const interactiveProps = { onClick, onKeyDown, @@ -21,21 +14,19 @@ function EmptyContent({ children, onClick, showPlusIcon }) { tabIndex: 0, }; - let props; - - if (onClick) { - props = { - ...commonProps, - ...interactiveProps, - }; - } else { - props = commonProps; - } - return ( -
- {showPlusIcon ? : null} - {children} +
+ {onClick ? ( + + ) : children}
); }