Update chart button active state for dashboard charts (https://github.com/woocommerce/woocommerce-admin/pull/1202)

* Update chart button active state for dashboard charts

* Add default active state when no query is present
This commit is contained in:
Joshua T Flowers 2018-12-29 01:59:05 +08:00 committed by Timmy Crawford
parent 8dc3398636
commit 2d5e592a10
2 changed files with 14 additions and 13 deletions

View File

@ -80,7 +80,7 @@ class DashboardCharts extends Component {
>
<IconButton
className={ classNames( 'woocommerce-chart__type-button', {
'woocommerce-chart__type-button-selected': query.type === 'line',
'woocommerce-chart__type-button-selected': ! query.type || query.type === 'line',
} ) }
icon={ <Gridicon icon="line-graph" /> }
title={ __( 'Line chart', 'wc-admin' ) }

View File

@ -33,18 +33,6 @@
margin-left: $gap;
margin-right: $gap;
}
.woocommerce-chart__type-button {
&.components-icon-button {
color: $core-grey-light-700;
&.woocommerce-chart__type-button-selected {
color: $core-grey-dark-500;
}
&:hover {
box-shadow: none;
}
}
}
}
.woocommerce-chart__body {
@ -112,3 +100,16 @@
.woocommerce-chart__types {
padding: 0 8px;
}
.woocommerce-chart__type-button {
background: transparent !important;
&.components-icon-button {
color: $core-grey-light-700;
&.woocommerce-chart__type-button-selected {
color: $core-grey-dark-500;
}
&:hover {
box-shadow: none !important;
}
}
}