Skip to content

Commit ff2bc65

Browse files
committed
[DDW-788] Restore develop
1 parent 82893ee commit ff2bc65

File tree

4 files changed

+268
-256
lines changed

4 files changed

+268
-256
lines changed

source/renderer/app/App.js

Lines changed: 32 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { SimpleDefaults } from 'react-polymorph/lib/themes/simple';
77
import DevTools from 'mobx-react-devtools';
88
import { Router } from 'react-router-dom';
99
import { IntlProvider } from 'react-intl';
10-
import { ChakraProvider, extendTheme } from '@chakra-ui/react';
1110
import { Routes } from './Routes';
1211
import { daedalusTheme } from './themes/daedalus';
1312
import { themeOverrides } from './themes/overrides';
@@ -22,29 +21,6 @@ import type { StoresMap } from './stores/index';
2221
import type { ActionsMap } from './actions/index';
2322
import NewsFeedContainer from './containers/news/NewsFeedContainer';
2423

25-
const theme = extendTheme({
26-
fonts: {
27-
body: 'NotoSans-Regular, NotoSansCJKjp-Regular',
28-
heading: 'NotoSans-Regular, NotoSansCJKjp-Regular',
29-
mono: 'NotoSans-Regular, NotoSansCJKjp-Regular',
30-
},
31-
components: {
32-
Text: {
33-
baseStyle: {
34-
fontFamily: 'NotoSans-Regular, NotoSansCJKjp-Regular',
35-
},
36-
},
37-
},
38-
colors: {
39-
stakePoolSaturation: {
40-
green: '--theme-staking-stake-pool-saturation-green-color',
41-
orange: '--theme-staking-stake-pool-saturation-orange-color',
42-
red: '--theme-staking-stake-pool-saturation-red-color',
43-
yellow: '--theme-staking-stake-pool-saturation-yellow-color',
44-
},
45-
},
46-
});
47-
4824
@observer
4925
export default class App extends Component<{
5026
stores: StoresMap,
@@ -72,46 +48,40 @@ export default class App extends Component<{
7248
!isNodeStopping && // Daedalus is not shutting down
7349
!isNodeStopped; // Daedalus is not shutting down
7450

75-
if (document.documentElement) {
76-
document.documentElement.lang = locale;
77-
}
78-
7951
return (
80-
<ChakraProvider theme={theme}>
81-
<Fragment>
82-
<ThemeManager variables={themeVars} />
83-
<Provider stores={stores} actions={actions}>
84-
<ThemeProvider
85-
theme={daedalusTheme}
86-
skins={SimpleSkins}
87-
variables={SimpleDefaults}
88-
themeOverrides={themeOverrides}
52+
<Fragment>
53+
<ThemeManager variables={themeVars} />
54+
<Provider stores={stores} actions={actions}>
55+
<ThemeProvider
56+
theme={daedalusTheme}
57+
skins={SimpleSkins}
58+
variables={SimpleDefaults}
59+
themeOverrides={themeOverrides}
60+
>
61+
<IntlProvider
62+
{...{ locale, key: locale, messages: translations[locale] }}
8963
>
90-
<IntlProvider
91-
{...{ locale, key: locale, messages: translations[locale] }}
92-
>
93-
<Fragment>
94-
<Router history={history}>
95-
<Routes />
96-
</Router>
97-
{mobxDevTools}
98-
{[
99-
isActiveDialog(ABOUT) && <AboutDialog key="aboutDialog" />,
100-
isActiveDialog(DAEDALUS_DIAGNOSTICS) && (
101-
<DaedalusDiagnosticsDialog key="daedalusDiagnosticsDialog" />
102-
),
103-
<NotificationsContainer key="notificationsContainer" />,
104-
]}
105-
{canShowNews && [
106-
<NewsFeedContainer key="newsFeedList" />,
107-
<NewsOverlayContainer key="newsFeedOverlay" />,
108-
]}
109-
</Fragment>
110-
</IntlProvider>
111-
</ThemeProvider>
112-
</Provider>
113-
</Fragment>
114-
</ChakraProvider>
64+
<Fragment>
65+
<Router history={history}>
66+
<Routes />
67+
</Router>
68+
{mobxDevTools}
69+
{[
70+
isActiveDialog(ABOUT) && <AboutDialog key="aboutDialog" />,
71+
isActiveDialog(DAEDALUS_DIAGNOSTICS) && (
72+
<DaedalusDiagnosticsDialog key="daedalusDiagnosticsDialog" />
73+
),
74+
<NotificationsContainer key="notificationsContainer" />,
75+
]}
76+
{canShowNews && [
77+
<NewsFeedContainer key="newsFeedList" />,
78+
<NewsOverlayContainer key="newsFeedOverlay" />,
79+
]}
80+
</Fragment>
81+
</IntlProvider>
82+
</ThemeProvider>
83+
</Provider>
84+
</Fragment>
11585
);
11686
}
11787
}

source/renderer/app/components/staking/widgets/ThumbPoolContent.js

Lines changed: 69 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,19 @@
22
import BigNumber from 'bignumber.js';
33
import React, { Component } from 'react';
44
import { observer } from 'mobx-react';
5-
import { Box, Center } from '@chakra-ui/react';
5+
import SVGInline from 'react-svg-inline';
6+
import classnames from 'classnames';
67
import clockIcon from '../../../assets/images/clock-corner.inline.svg';
78
import noDataDashBigImage from '../../../assets/images/no-data-dash-big.inline.svg';
9+
import styles from './ThumbPoolContent.scss';
810
import { getColorFromRange, getSaturationColor } from '../../../utils/colors';
911
import StakePool from '../../../domains/StakePool';
1012
import {
1113
IS_RANKING_DATA_AVAILABLE,
1214
IS_SATURATION_DATA_AVAILABLE,
1315
} from '../../../config/stakingConfig';
16+
import adaIcon from '../../../assets/images/ada-symbol.inline.svg';
1417
import { formattedWalletAmount } from '../../../utils/formatters';
15-
import {
16-
ClockIcon,
17-
NoDataDashIcon,
18-
Container,
19-
Ticker,
20-
Rewards,
21-
NoDataDash,
22-
Ranking,
23-
RankingStar,
24-
SaturationBar,
25-
Clock,
26-
ColorBand,
27-
GreyColorBand,
28-
} from './ThumbPoolContent.styles';
2918

3019
type Props = {
3120
stakePool: StakePool,
@@ -66,55 +55,74 @@ export default class ThumbPoolContent extends Component<Props> {
6655
} = stakePool;
6756
const color = getColorFromRange(ranking, numberOfRankedStakePools);
6857

58+
const componentClassnames = classnames([
59+
styles.component,
60+
!IS_SATURATION_DATA_AVAILABLE ? styles.hideSaturation : null,
61+
]);
62+
63+
const saturationClassnames = classnames([
64+
styles.saturationBar,
65+
styles[getSaturationColor(saturation)],
66+
]);
67+
6968
return (
70-
<Container>
71-
<Box h="full">
72-
<Ticker>{ticker}</Ticker>
73-
{isGridRewardsView &&
74-
(IS_RANKING_DATA_AVAILABLE && nonMyopicMemberRewards ? (
75-
<Rewards>{this.formattedRewards(potentialRewards)}</Rewards>
76-
) : (
77-
<NoDataDash />
78-
))}
79-
{!isGridRewardsView &&
80-
(IS_RANKING_DATA_AVAILABLE ? (
81-
<Ranking color={color}>
82-
{nonMyopicMemberRewards ? (
83-
ranking
84-
) : (
85-
<>
86-
{numberOfRankedStakePools + 1}
87-
<RankingStar>*</RankingStar>
88-
</>
89-
)}
90-
</Ranking>
91-
) : (
92-
<Center flex="1 1 auto">
93-
<NoDataDashIcon svg={noDataDashBigImage} />
94-
</Center>
95-
))}
96-
{IS_SATURATION_DATA_AVAILABLE && (
97-
<SaturationBar
98-
width={parseFloat(saturation).toFixed(2)}
99-
color={getSaturationColor(saturation)}
100-
/>
101-
)}
102-
</Box>
103-
<Box alignSelf="flex-end" w="full">
104-
{IS_RANKING_DATA_AVAILABLE ? (
105-
<>
106-
{retiring && (
107-
<Clock>
108-
<ClockIcon svg={clockIcon} />
109-
</Clock>
69+
<div className={componentClassnames}>
70+
<div className={styles.ticker}>{ticker}</div>
71+
{isGridRewardsView &&
72+
(IS_RANKING_DATA_AVAILABLE && nonMyopicMemberRewards ? (
73+
<div className={styles.rewards}>
74+
{this.formattedRewards(potentialRewards)}
75+
<SVGInline svg={adaIcon} className={styles.adaIcon} />
76+
</div>
77+
) : (
78+
<div className={styles.noDataDash}>
79+
<SVGInline svg={noDataDashBigImage} />
80+
</div>
81+
))}
82+
{!isGridRewardsView &&
83+
(IS_RANKING_DATA_AVAILABLE ? (
84+
<div className={styles.ranking} style={{ color }}>
85+
{nonMyopicMemberRewards ? (
86+
ranking
87+
) : (
88+
<>
89+
{numberOfRankedStakePools + 1}
90+
<sup>*</sup>
91+
</>
11092
)}
111-
<ColorBand color={color} />
112-
</>
93+
</div>
11394
) : (
114-
<GreyColorBand />
115-
)}
116-
</Box>
117-
</Container>
95+
<div className={styles.noDataDash}>
96+
<SVGInline svg={noDataDashBigImage} />
97+
</div>
98+
))}
99+
{IS_SATURATION_DATA_AVAILABLE && (
100+
<div className={saturationClassnames}>
101+
<span
102+
style={{
103+
width: `${parseFloat(saturation).toFixed(2)}%`,
104+
}}
105+
/>
106+
</div>
107+
)}
108+
{IS_RANKING_DATA_AVAILABLE ? (
109+
<>
110+
{retiring && (
111+
<div className={styles.clock}>
112+
<SVGInline svg={clockIcon} className={styles.clockIcon} />
113+
</div>
114+
)}
115+
<div
116+
className={styles.colorBand}
117+
style={{
118+
background: color,
119+
}}
120+
/>
121+
</>
122+
) : (
123+
<div className={styles.greyColorBand} />
124+
)}
125+
</div>
118126
);
119127
}
120128
}

0 commit comments

Comments
 (0)