Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2319 from Emurgo/redesign-top-navbar
Redesign top navbar
- Loading branch information
Showing
36 changed files
with
1,765 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 28 additions & 8 deletions
36
packages/yoroi-extension/app/components/topbar/BuySellAdaButton.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,57 @@ | ||
// @flow | ||
import React, { Component } from 'react'; | ||
import type { Node } from 'react'; | ||
import type { Node, ComponentType } from 'react'; | ||
import { observer } from 'mobx-react'; | ||
import { intlShape, } from 'react-intl'; | ||
import { intlShape } from 'react-intl'; | ||
import styles from './BuySellAdaButton.scss'; | ||
import globalMessages from '../../i18n/global-messages'; | ||
import type { $npm$ReactIntl$IntlFormat } from 'react-intl'; | ||
import classnames from 'classnames'; | ||
import classnames from 'classnames'; | ||
import { Button } from 'react-polymorph/lib/components/Button'; | ||
import { ButtonSkin } from 'react-polymorph/lib/skins/simple/ButtonSkin'; | ||
import { withLayout } from '../../themes/context/layout'; | ||
import type { LayoutComponentMap } from '../../themes/context/layout'; | ||
|
||
type Props = {| | ||
+onBuySellClick: void => void, | ||
|}; | ||
|
||
@observer | ||
export default class BuySellAdaButton extends Component<Props> { | ||
type InjectedProps = {| | ||
+renderLayoutComponent: LayoutComponentMap => Node, | ||
|}; | ||
|
||
static contextTypes: {|intl: $npm$ReactIntl$IntlFormat|} = { | ||
@observer | ||
class BuySellAdaButton extends Component<Props & InjectedProps> { | ||
static contextTypes: {| intl: $npm$ReactIntl$IntlFormat |} = { | ||
intl: intlShape.isRequired, | ||
}; | ||
|
||
render(): Node { | ||
|
||
const { intl } = this.context; | ||
|
||
return ( | ||
const BuyAdaButtonClassic = ( | ||
<Button | ||
label={intl.formatMessage(globalMessages.buyAda)} | ||
className={classnames([styles.button, 'secondary'])} | ||
onClick={() => this.props.onBuySellClick()} | ||
skin={ButtonSkin} | ||
/> | ||
); | ||
|
||
const BuyAdaButtonRevamp = ( | ||
<Button | ||
label={intl.formatMessage(globalMessages.buySellAda)} | ||
className={styles.buttonRevamp} | ||
onClick={() => this.props.onBuySellClick()} | ||
skin={ButtonSkin} | ||
/> | ||
); | ||
|
||
return this.props.renderLayoutComponent({ | ||
CLASSIC: BuyAdaButtonClassic, | ||
REVAMP: BuyAdaButtonRevamp, | ||
}); | ||
} | ||
} | ||
|
||
export default (withLayout(BuySellAdaButton): ComponentType<Props>); |
21 changes: 20 additions & 1 deletion
21
packages/yoroi-extension/app/components/topbar/BuySellAdaButton.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,23 @@ | ||
.button { | ||
display: block !important; | ||
width: 230px !important; | ||
} | ||
} | ||
|
||
.buttonRevamp { | ||
border: 1px solid #a7afc0 !important; | ||
background: white !important; | ||
width: 160px !important; | ||
max-height: 44px; | ||
padding: 11px 0 !important; | ||
color: #6b7384 !important; | ||
font-size: 14px; | ||
font-weight: 500; | ||
letter-spacing: 0.5px; | ||
line-height: 22px; | ||
&:hover { | ||
background: transparent; | ||
} | ||
align-items: center; | ||
justify-content: center; | ||
display: flex; | ||
} |
Oops, something went wrong.