Skip to content
Permalink
Browse files

Merge branch 'develop' into feature/ddw-658-ui-delegation-wizard-step…

…s-0-1
  • Loading branch information...
nikolaglumac committed Jun 16, 2019
2 parents 286fb79 + 567e457 commit 8becdc13bd849c81e922d8bc6c093d3fa7090622
Showing with 666 additions and 552 deletions.
  1. +1 −0 CHANGELOG.md
  2. +6 −10 installers/stack.yaml
  3. +5 −10 source/renderer/app/components/staking/stake-pools/StakePoolThumbnail.js
  4. +1 −2 source/renderer/app/components/staking/stake-pools/StakePoolThumbnail.scss
  5. +85 −77 source/renderer/app/components/staking/stake-pools/StakePoolTooltip.js
  6. +38 −14 source/renderer/app/components/staking/stake-pools/StakePoolTooltip.scss
  7. +177 −0 source/renderer/app/components/staking/stake-pools/StakePools.js
  8. +14 −0 source/renderer/app/components/staking/stake-pools/StakePools.scss
  9. +47 −281 source/renderer/app/components/staking/stake-pools/StakePoolsList.js
  10. +1 −72 source/renderer/app/components/staking/stake-pools/StakePoolsList.scss
  11. +116 −0 source/renderer/app/components/staking/stake-pools/StakePoolsSearch.js
  12. +60 −0 source/renderer/app/components/staking/stake-pools/StakePoolsSearch.scss
  13. +7 −7 source/renderer/app/config/stakingStakePools.dummy.json
  14. +2 −2 source/renderer/app/containers/staking/StakePoolsListPage.js
  15. +65 −32 source/renderer/app/i18n/locales/defaultMessages.json
  16. +1 −1 source/renderer/app/i18n/locales/en-US.json
  17. +1 −1 source/renderer/app/i18n/locales/ja-JP.json
  18. +2 −2 source/renderer/app/themes/daedalus/cardano.js
  19. +2 −2 source/renderer/app/themes/daedalus/dark-blue.js
  20. +2 −2 source/renderer/app/themes/daedalus/light-blue.js
  21. +2 −1 source/renderer/app/themes/utils/createTheme.js
  22. +26 −31 source/renderer/app/utils/colors.js
  23. +3 −3 storybook/stories/{StakePoolsListStory.js → StakePoolsStory.js}
  24. +2 −2 storybook/stories/Staking.stories.js
@@ -25,6 +25,7 @@ Changelog

### Fixes

- Added fine adjustments to the Stake Pools screen. ([PR 1420](https://github.com/input-output-hk/daedalus/pull/1420))
- Fixed the Block consolidation status screen not fully shown in minimized mode when the Japanese language is selected ([PR 1416](https://github.com/input-output-hk/daedalus/pull/1416))
- Fixed "marked" dependency vulnerability warning ([PR 1414](https://github.com/input-output-hk/daedalus/pull/1414)
- Fixed addresses not visible on Receive screen when Password is set for the wallet in minimized mode ([PR 1407](https://github.com/input-output-hk/daedalus/pull/1407))
@@ -9,14 +9,10 @@ nix:
packages: [gmp,git]

packages:
- location: .
- .
extra-deps:
- git: https://github.com/dhall-lang/dhall-json
commit: d6adaa265dcf8ab5899396b05d612b2d8092dca4

- location:
git: https://github.com/dhall-lang/dhall-json
commit: d6adaa265dcf8ab5899396b05d612b2d8092dca4
extra-dep: true

- location:
git: https://github.com/input-output-hk/haskell-nsis.git
commit: 020e61eced93eaa6ab86ac603617e93aa6bf5af0
extra-dep: true
- git: https://github.com/input-output-hk/haskell-nsis.git
commit: 020e61eced93eaa6ab86ac603617e93aa6bf5af0
@@ -5,7 +5,7 @@ import SVGInline from 'react-svg-inline';
import classnames from 'classnames';
import clockIcon from '../../../assets/images/clock.inline.svg';
import styles from './StakePoolThumbnail.scss';
import { getHSLColor } from '../../../utils/colors';
import { getColorFromRange } from '../../../utils/colors';
import type { StakePool } from '../../../api/staking/types';
import StakePoolTooltip from './StakePoolTooltip';

@@ -17,7 +17,7 @@ type Props = {
flipHorizontal: boolean,
flipVertical: boolean,
onOpenExternalLink: Function,
handleClick: Function,
onClick: Function,
onClose: Function,
};

@@ -29,12 +29,12 @@ export const StakePoolThumbnail = observer((props: Props) => {
currentTheme,
flipHorizontal,
flipVertical,
handleClick,
onClick,
onClose,
onOpenExternalLink,
} = props;

const color = getHSLColor(index);
const color = getColorFromRange(index);

const { ranking, id, retirement } = stakePool;

@@ -45,12 +45,7 @@ export const StakePoolThumbnail = observer((props: Props) => {

return (
<div className={componentClassnames}>
<div
className={styles.content}
onClick={handleClick}
role="link"
aria-hidden
>
<div className={styles.content} onClick={onClick} role="link" aria-hidden>
<div className={styles.id}>{id}</div>
<div className={styles.ranking} style={{ color }}>
{ranking}
@@ -2,7 +2,6 @@
background-color: var(--theme-staking-stake-pool-background-color);
border: solid 1px var(--theme-staking-stake-pool-border-color);
border-radius: 4px;
box-sizing: unset;
display: flex;
height: 71px;
justify-content: center;
@@ -50,7 +49,7 @@
.clockIcon {
display: block;
line-height: 0;
margin: 0;
margin: 1px 0 0;
padding: 0;
text-align: center;

@@ -1,15 +1,14 @@
// @flow
import React, { Component, Fragment } from 'react';
import React, { Component } from 'react';
import { observer } from 'mobx-react';
import { defineMessages, intlShape } from 'react-intl';
import chroma from 'chroma-js';
import { defineMessages, intlShape, FormattedMessage } from 'react-intl';
import { Button } from 'react-polymorph/lib/components/Button';
import classnames from 'classnames';
import moment from 'moment';
import SVGInline from 'react-svg-inline';
import { ButtonSkin } from 'react-polymorph/lib/skins/simple/ButtonSkin';
import styles from './StakePoolTooltip.scss';
import { getHSLColor } from '../../../utils/colors';
import { getColorFromRange } from '../../../utils/colors';
import type { StakePool } from '../../../api/staking/types';
import closeCross from '../../../assets/images/close-cross.inline.svg';

@@ -36,7 +35,7 @@ const messages = defineMessages({
},
retirement: {
id: 'staking.stakePools.tooltip.retirement',
defaultMessage: '!!!Retirement:',
defaultMessage: '!!!Retirement in {retirementFromNow}',
description: '"Retirement" for the Stake Pools Tooltip page.',
},
delegateButton: {
@@ -94,16 +93,12 @@ export default class StakePoolTooltip extends Component<Props> {
this.tooltipClick = true;
};

get color() {
const { index } = this.props;
return getHSLColor(index);
}

render() {
const { intl } = this.context;
const {
stakePool,
isVisible,
index,
currentTheme,
flipHorizontal,
flipVertical,
@@ -130,7 +125,12 @@ export default class StakePoolTooltip extends Component<Props> {
flipVertical ? styles.flipVertical : null,
]);

const lighnessOffset = currentTheme === 'dark-blue' ? -20 : 0;
const darken = currentTheme === 'dark-blue' ? 1 : 0;
const alpha = 0.3;
const reverse = true;
const retirementFromNow = retirement
? moment(retirement).fromNow(true)
: '';

return (
<div
@@ -142,76 +142,84 @@ export default class StakePoolTooltip extends Component<Props> {
<div
className={styles.colorBand}
style={{
background: this.color,
background: getColorFromRange(index),
}}
/>
<h3 className={styles.name}>{name}</h3>
<button className={styles.closeButton} onClick={onClick}>
<SVGInline svg={closeCross} />
</button>
<div className={styles.id}>{id}</div>
<div className={styles.description}>{description}</div>
<button className={styles.url} onClick={() => onOpenExternalLink(url)}>
{url}
</button>
<dl className={styles.table}>
<dt>{intl.formatMessage(messages.ranking)}</dt>
<dd className={styles.ranking}>
<span
style={{
background: chroma(
getHSLColor(ranking, { lighnessOffset })
).alpha(0.3),
}}
>
{parseFloat(ranking).toFixed(2)}
</span>
</dd>
<dt>{intl.formatMessage(messages.controlledStake)}</dt>
<dd className={styles.controlledStake}>
<span
style={{
background: chroma(
getHSLColor(controlledStake, { lighnessOffset })
).alpha(0.3),
}}
>
{controlledStake}%
</span>
</dd>
<dt>{intl.formatMessage(messages.profitMargin)}</dt>
<dd className={styles.profitMargin}>
<span
style={{
background: chroma(
getHSLColor(profitMargin, { lighnessOffset })
).alpha(0.3),
}}
>
{profitMargin}%
</span>
</dd>
<dt>{intl.formatMessage(messages.performance)}</dt>
<dd className={styles.performance}>
<span
style={{
background: chroma(
getHSLColor(performance, { lighnessOffset })
).alpha(0.3),
}}
>
{performance}%
</span>
</dd>
<div className={styles.container}>
<h3 className={styles.name}>{name}</h3>
<button className={styles.closeButton} onClick={onClick}>
<SVGInline svg={closeCross} />
</button>
<div className={styles.id}>{id}</div>
{retirement && (
<Fragment>
<dt>{intl.formatMessage(messages.retirement)}</dt>
<dd className={styles.retirement}>
<span>{moment(retirement).fromNow(true)}</span>
</dd>
</Fragment>
<div className={styles.retirement}>
<FormattedMessage
{...messages.retirement}
values={{ retirementFromNow }}
/>
</div>
)}
</dl>
<div className={styles.description}>{description}</div>
<button
className={styles.url}
onClick={() => onOpenExternalLink(url)}
>
{url}
</button>
<dl className={styles.table}>
<dt>{intl.formatMessage(messages.ranking)}</dt>
<dd className={styles.ranking}>
<span
style={{
background: getColorFromRange(ranking, { darken, alpha }),
}}
>
{ranking}
</span>
</dd>
<dt>{intl.formatMessage(messages.controlledStake)}</dt>
<dd className={styles.controlledStake}>
<span
style={{
background: getColorFromRange(controlledStake, {
darken,
alpha,
}),
}}
>
{controlledStake}%
</span>
</dd>
<dt>{intl.formatMessage(messages.profitMargin)}</dt>
<dd className={styles.profitMargin}>
<span
style={{
background: getColorFromRange(profitMargin, {
darken,
alpha,
reverse,
}),
}}
>
{profitMargin}%
</span>
</dd>
<dt>{intl.formatMessage(messages.performance)}</dt>
<dd className={styles.performance}>
<span
style={{
background: getColorFromRange(performance, {
darken,
alpha,
reverse,
}),
}}
>
{performance}%
</span>
</dd>
</dl>
</div>
<Button
label={intl.formatMessage(messages.delegateButton)}
onClick={() => {}}

0 comments on commit 8becdc1

Please sign in to comment.
You can’t perform that action at this time.