mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Add box shadow to Home screen tabs (#8739)
This matches the box shadow on the asset page. Some CSS specificity hijinks were required to override the base `Tabs` CSS rules, and a new `tabsClassName` prop was added to the `Tabs` component.
This commit is contained in:
parent
cac3bf5c56
commit
b96eb55c76
@ -1,16 +1,19 @@
|
|||||||
import React, { Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
|
import classnames from 'classnames'
|
||||||
|
|
||||||
export default class Tabs extends Component {
|
export default class Tabs extends Component {
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
defaultActiveTabName: null,
|
defaultActiveTabName: null,
|
||||||
onTabClick: null,
|
onTabClick: null,
|
||||||
|
tabsClassName: undefined,
|
||||||
}
|
}
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
defaultActiveTabName: PropTypes.string,
|
defaultActiveTabName: PropTypes.string,
|
||||||
onTabClick: PropTypes.func,
|
onTabClick: PropTypes.func,
|
||||||
children: PropTypes.node.isRequired,
|
children: PropTypes.node.isRequired,
|
||||||
|
tabsClassName: PropTypes.string,
|
||||||
}
|
}
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
@ -62,9 +65,10 @@ export default class Tabs extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
|
const { tabsClassName } = this.props
|
||||||
return (
|
return (
|
||||||
<div className="tabs">
|
<div className="tabs">
|
||||||
<ul className="tabs__list">
|
<ul className={classnames('tabs__list', tabsClassName)}>
|
||||||
{ this.renderTabs() }
|
{ this.renderTabs() }
|
||||||
</ul>
|
</ul>
|
||||||
<div className="tabs__content">
|
<div className="tabs__content">
|
||||||
|
@ -232,7 +232,7 @@ export default class Home extends PureComponent {
|
|||||||
<div className="home__balance-wrapper">
|
<div className="home__balance-wrapper">
|
||||||
<EthOverview />
|
<EthOverview />
|
||||||
</div>
|
</div>
|
||||||
<Tabs defaultActiveTabName={defaultHomeActiveTabName} onTabClick={onTabClick}>
|
<Tabs defaultActiveTabName={defaultHomeActiveTabName} onTabClick={onTabClick} tabsClassName="home__tabs">
|
||||||
<Tab
|
<Tab
|
||||||
activeClassName="home__tab--active"
|
activeClassName="home__tab--active"
|
||||||
className="home__tab"
|
className="home__tab"
|
||||||
|
@ -21,6 +21,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: fix style import order so this isn't required to override specificity of `tab` class
|
// TODO: fix style import order so this isn't required to override specificity of `tab` class
|
||||||
|
&__main-view &__tabs {
|
||||||
|
border: none;
|
||||||
|
box-shadow: 0px 3px 4px rgba(135, 134, 134, 0.16);
|
||||||
|
}
|
||||||
|
|
||||||
&__main-view &__tab {
|
&__main-view &__tab {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
color: $Grey-500;
|
color: $Grey-500;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user