@ssa-ui-kit/widgets 0.0.20-alpha → 0.0.22-alpha
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.
- package/custom-shots/widgets-bots-table--no-control-orders--menu-opened_[w1920px].png +0 -0
- package/custom-shots/widgets-bots-table--no-control-orders--run-reason-modal_[w1920px].png +0 -0
- package/custom-shots/widgets-collapsiblenavbar-opened__[w1439px].png +0 -0
- package/custom-shots/widgets-collapsiblenavbar-opened__[w1439px]_statistics_submenu_popover.png +0 -0
- package/custom-shots/widgets-collapsiblenavbar-opened__[w1920px].png +0 -0
- package/custom-shots/widgets-collapsiblenavbar-opened__[w1920px]_side_menu_expanded.png +0 -0
- package/custom-shots/widgets-collapsiblenavbar-opened__[w1920px]_statistics_submenu_expanded.png +0 -0
- package/custom-shots/widgets-collapsiblenavbar-opened__[w1920px]_statistics_submenu_popover.png +0 -0
- package/custom-shots/widgets-collapsiblenavbar-opened__[w899px]_menu_opened.png +0 -0
- package/custom-shots/widgets-collapsiblenavbar-opened__[w899px]_statistics_submenu.png +0 -0
- package/custom-shots/widgets-filters--default__[w1920px].png +0 -0
- package/custom-shots/widgets-filters--more-button-items-selected__[w390px].png +0 -0
- package/custom-shots/widgets-linkstabbar--current-focus__[w1920px].png +0 -0
- package/custom-shots/widgets-meal-nutrients--hint-opened__[w1440px].png +0 -0
- package/custom-shots/widgets-meal-nutrients--hint-opened__[w1920px].png +0 -0
- package/custom-shots/widgets-meal-nutrients--hint-opened__[w900px].png +0 -0
- package/custom-shots/widgets-meal-nutrients--hint-opened__dropdown__[w390px].png +0 -0
- package/custom-shots/widgets-notification-menu--is-opened__[w1920px].png +0 -0
- package/custom-shots/widgets-notification-menu--is-opened__[w900px].png +0 -0
- package/custom-shots/widgets-searchbox--cross-icon__[w900px].png +0 -0
- package/custom-shots/widgets-searchbox--search-icon__[w900px].png +0 -0
- package/custom-shots/widgets-table-filters--opened__[w1920px].png +0 -0
- package/custom-shots/widgets-trading-info-card--hover__[w1920px].png +0 -0
- package/custom-shots/widgets-user-profile--is-opened__[w1920px].png +0 -0
- package/dist/components/CollapsibleNavBar/NavBarAccordionContent.d.ts +1 -1
- package/dist/components/TableFilters/TableFiltersAccordionContent.d.ts +1 -1
- package/dist/components/TradingInfoCard/TradingInfoCard.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/components/CollapsibleNavBar/NavBarPopover.tsx +2 -1
- package/src/components/TradingInfoCard/TradingInfoCard.stories.tsx +1 -1
- package/src/components/TradingInfoCard/TradingInfoCard.tsx +24 -18
- package/src/components/TradingScoreboard/helpers.tsx +1 -1
- package/tsbuildcache +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ssa-ui-kit/widgets",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22-alpha",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"private": false,
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"js-tokens": "^4.0.0",
|
|
30
30
|
"loose-envify": "^1.4.0",
|
|
31
31
|
"scheduler": "^0.23.0",
|
|
32
|
-
"@ssa-ui-kit/core": "^0.0.
|
|
33
|
-
"@ssa-ui-kit/
|
|
34
|
-
"@ssa-ui-kit/
|
|
32
|
+
"@ssa-ui-kit/core": "^0.0.22-alpha",
|
|
33
|
+
"@ssa-ui-kit/utils": "^0.0.1-alpha",
|
|
34
|
+
"@ssa-ui-kit/hooks": "^0.0.1-alpha"
|
|
35
35
|
},
|
|
36
36
|
"browserslist": [
|
|
37
37
|
">0.1%",
|
|
@@ -5,34 +5,24 @@ import TradingInfoCardTooltip from './TradingInfoCardTooltip';
|
|
|
5
5
|
import TradingInfoCardWrapper from './TradingInfoCardWrapper';
|
|
6
6
|
import { ITradingInfoCardProps } from './types';
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const TradingInfoCardView = ({
|
|
9
9
|
value,
|
|
10
10
|
unit,
|
|
11
11
|
title,
|
|
12
|
-
onClick,
|
|
13
12
|
icon,
|
|
14
13
|
link,
|
|
14
|
+
onClick,
|
|
15
15
|
}: ITradingInfoCardProps) => {
|
|
16
16
|
const number = Number(value);
|
|
17
|
-
const
|
|
18
|
-
|
|
17
|
+
const currentValue = Number.isNaN(number)
|
|
18
|
+
? value
|
|
19
|
+
: number.toFixed(1).includes('.0')
|
|
20
|
+
? Math.floor(number)
|
|
21
|
+
: number.toFixed(1);
|
|
19
22
|
|
|
20
23
|
return (
|
|
21
24
|
<TradingInfoCardWrapper onClick={onClick} link={link}>
|
|
22
|
-
{
|
|
23
|
-
<TradingInfoCardContent value={currentValue} unit={unit} icon={icon} />
|
|
24
|
-
) : (
|
|
25
|
-
<TradingInfoCardTooltip
|
|
26
|
-
trigger={
|
|
27
|
-
<TradingInfoCardContent
|
|
28
|
-
value={currentValue}
|
|
29
|
-
unit={unit}
|
|
30
|
-
icon={icon}
|
|
31
|
-
/>
|
|
32
|
-
}>
|
|
33
|
-
{value} {unit}
|
|
34
|
-
</TradingInfoCardTooltip>
|
|
35
|
-
)}
|
|
25
|
+
<TradingInfoCardContent value={currentValue} unit={unit} icon={icon} />
|
|
36
26
|
<CardContent>
|
|
37
27
|
<Typography css={{ fontSize: '12px' }}>{title}</Typography>
|
|
38
28
|
</CardContent>
|
|
@@ -40,4 +30,20 @@ const TradingInfoCard = ({
|
|
|
40
30
|
);
|
|
41
31
|
};
|
|
42
32
|
|
|
33
|
+
const TradingInfoCard = (props: ITradingInfoCardProps) => {
|
|
34
|
+
const { value, unit } = props;
|
|
35
|
+
const number = Number(value);
|
|
36
|
+
const isInteger = Number.isInteger(number);
|
|
37
|
+
|
|
38
|
+
if (isInteger || Number.isNaN(number)) {
|
|
39
|
+
return <TradingInfoCardView {...props} />;
|
|
40
|
+
} else {
|
|
41
|
+
return (
|
|
42
|
+
<TradingInfoCardTooltip trigger={<TradingInfoCardView {...props} />}>
|
|
43
|
+
{value} {unit}
|
|
44
|
+
</TradingInfoCardTooltip>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
43
49
|
export default TradingInfoCard;
|