Update variable name

This commit is contained in:
Kelly Dwan 2018-10-11 15:43:56 -04:00
parent 6df6594ee1
commit cea79c3b96
1 changed files with 8 additions and 8 deletions

View File

@ -83,12 +83,12 @@ class DatePickerContent extends Component {
initialTabName={ 'custom' === period ? 'custom' : 'period' } initialTabName={ 'custom' === period ? 'custom' : 'period' }
onSelect={ this.onTabSelect } onSelect={ this.onTabSelect }
> >
{ ( { name: selectedTab } ) => ( { selected => (
<Fragment> <Fragment>
{ selectedTab === 'period' && ( { selected.name === 'period' && (
<PresetPeriods onSelect={ onUpdate } period={ period } /> <PresetPeriods onSelect={ onUpdate } period={ period } />
) } ) }
{ selectedTab === 'custom' && ( { selected.name === 'custom' && (
<DateRange <DateRange
after={ after } after={ after }
before={ before } before={ before }
@ -104,8 +104,8 @@ class DatePickerContent extends Component {
) } ) }
<div <div
className={ classnames( 'woocommerce-filters-date__content-controls', { className={ classnames( 'woocommerce-filters-date__content-controls', {
'is-sticky-bottom': selectedTab === 'custom' && isMobileViewport(), 'is-sticky-bottom': selected.name === 'custom' && isMobileViewport(),
'is-custom': selectedTab === 'custom', 'is-custom': selected.name === 'custom',
} ) } } ) }
> >
<H className="woocommerce-filters-date__text"> <H className="woocommerce-filters-date__text">
@ -113,7 +113,7 @@ class DatePickerContent extends Component {
</H> </H>
<ComparePeriods onSelect={ onUpdate } compare={ compare } /> <ComparePeriods onSelect={ onUpdate } compare={ compare } />
<div className="woocommerce-filters-date__button-group"> <div className="woocommerce-filters-date__button-group">
{ selectedTab === 'custom' && ( { selected.name === 'custom' && (
<Button <Button
className="woocommerce-filters-date__button" className="woocommerce-filters-date__button"
isDefault isDefault
@ -123,10 +123,10 @@ class DatePickerContent extends Component {
{ __( 'Reset', 'wc-admin' ) } { __( 'Reset', 'wc-admin' ) }
</Button> </Button>
) } ) }
{ isValidSelection( selectedTab ) ? ( { isValidSelection( selected.name ) ? (
<Button <Button
className="woocommerce-filters-date__button" className="woocommerce-filters-date__button"
onClick={ onSelect( selectedTab, onClose ) } onClick={ onSelect( selected.name, onClose ) }
isPrimary isPrimary
> >
{ __( 'Update', 'wc-admin' ) } { __( 'Update', 'wc-admin' ) }