venice-ui 2.4.2 → 2.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,9 +8,12 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const Card_styles_1 = require("./Card.styles");
|
|
9
9
|
const ElementHeader_1 = require("../ElementHeader");
|
|
10
10
|
const Theme_1 = require("../../Theme");
|
|
11
|
-
const Card = ({ children, title, actionLabel, theme = Theme_1.mainTheme, iconColor = theme.textColor, iconHoverColor = theme.action, handleClick, handleBack, height, options, shadow = true, headerDivader = false, actionDisabled = false, }) => {
|
|
11
|
+
const Card = ({ children, title, actionLabel, theme = Theme_1.mainTheme, iconColor = theme.textColor, iconHoverColor = theme.action, handleClick, handleBack, height, options, shadow = true, headerDivader = false, actionDisabled = false, customHeader, }) => {
|
|
12
|
+
const hasHeader = !!title || !!actionLabel || !!customHeader;
|
|
12
13
|
return (react_1.default.createElement(Card_styles_1.CardElement, { height: height, shadow: shadow },
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
customHeader
|
|
15
|
+
? customHeader
|
|
16
|
+
: (title || actionLabel) && (react_1.default.createElement(ElementHeader_1.ElementHeader, { title: title, actionLabel: actionLabel, handleClick: handleClick, handleBack: handleBack, options: options, theme: theme, iconColor: iconColor, iconHoverColor: iconHoverColor, bottomDivader: headerDivader, actionDisabled: actionDisabled })),
|
|
17
|
+
react_1.default.createElement(Card_styles_1.CardContent, { soloMode: !hasHeader }, children)));
|
|
15
18
|
};
|
|
16
19
|
exports.Card = Card;
|
|
@@ -2,8 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import { CardContent, CardElement } from './Card.styles';
|
|
3
3
|
import { ElementHeader } from '../ElementHeader';
|
|
4
4
|
import { mainTheme } from '../../Theme';
|
|
5
|
-
export const Card = ({ children, title, actionLabel, theme = mainTheme, iconColor = theme.textColor, iconHoverColor = theme.action, handleClick, handleBack, height, options, shadow = true, headerDivader = false, actionDisabled = false, }) => {
|
|
5
|
+
export const Card = ({ children, title, actionLabel, theme = mainTheme, iconColor = theme.textColor, iconHoverColor = theme.action, handleClick, handleBack, height, options, shadow = true, headerDivader = false, actionDisabled = false, customHeader, }) => {
|
|
6
|
+
const hasHeader = !!title || !!actionLabel || !!customHeader;
|
|
6
7
|
return (React.createElement(CardElement, { height: height, shadow: shadow },
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
customHeader
|
|
9
|
+
? customHeader
|
|
10
|
+
: (title || actionLabel) && (React.createElement(ElementHeader, { title: title, actionLabel: actionLabel, handleClick: handleClick, handleBack: handleBack, options: options, theme: theme, iconColor: iconColor, iconHoverColor: iconHoverColor, bottomDivader: headerDivader, actionDisabled: actionDisabled })),
|
|
11
|
+
React.createElement(CardContent, { soloMode: !hasHeader }, children)));
|
|
9
12
|
};
|