diff --git a/assets/components/src/card/style.scss b/assets/components/src/card/style.scss index cd66707cd9..6d255c55fe 100644 --- a/assets/components/src/card/style.scss +++ b/assets/components/src/card/style.scss @@ -30,6 +30,7 @@ align-items: center; display: flex; flex-wrap: wrap; + gap: 8px; justify-content: space-between; margin-bottom: -16px; @@ -37,6 +38,12 @@ margin-bottom: 0 !important; margin-top: 0 !important; } + + .newspack-select-control { + .components-base-control__field { + margin-bottom: 0; + } + } } // Is Narrow diff --git a/assets/components/src/select-control/ButtonGroupControl.js b/assets/components/src/select-control/ButtonGroupControl.js index 4d50f12199..20f5fa55ac 100644 --- a/assets/components/src/select-control/ButtonGroupControl.js +++ b/assets/components/src/select-control/ButtonGroupControl.js @@ -16,6 +16,7 @@ import { hooks } from '..'; const ButtonGroupControl = ( { buttonOptions, + buttonSmall, className, hideLabelFromVision, label, @@ -42,7 +43,9 @@ const ButtonGroupControl = ( { diff --git a/assets/components/src/select-control/index.js b/assets/components/src/select-control/index.js index eb519282bf..ed9c391b75 100644 --- a/assets/components/src/select-control/index.js +++ b/assets/components/src/select-control/index.js @@ -25,7 +25,7 @@ class SelectControl extends Component { * Render. */ render() { - const { className, optgroups, buttonOptions, ...otherProps } = this.props; + const { className, optgroups, buttonOptions, buttonSmall, ...otherProps } = this.props; const classes = classNames( 'newspack-select-control', optgroups && 'newspack-grouped-select-control', @@ -38,7 +38,11 @@ class SelectControl extends Component { { optgroups ? ( ) : buttonOptions ? ( - + ) : ( ) } diff --git a/assets/wizards/readerRevenue/components/money-input/style.scss b/assets/wizards/readerRevenue/components/money-input/style.scss index 2b01cd4eca..80a912bf64 100644 --- a/assets/wizards/readerRevenue/components/money-input/style.scss +++ b/assets/wizards/readerRevenue/components/money-input/style.scss @@ -4,54 +4,49 @@ @use '~@wordpress/base-styles/colors' as wp-colors; -.newspack-donations-wizard__money-input-container { - margin-bottom: 10px; - p { - margin: 0 0 8px; - } - @media screen and ( min-width: 480px ) { - margin-bottom: 0; - & + & { - margin-left: 16px; +.newspack-donations-wizard { + &__money-input { + align-items: stretch; + display: flex; + margin: 8px 0 0; + + .currency { + border: 1px solid wp-colors.$gray-700; + border-right: 0; + align-items: center; + background: wp-colors.$gray-100; + border-radius: 2px 0 0 2px; + display: flex; + flex: 0 0 14px; + height: auto; + justify-content: center; + line-height: 1; + margin: 0; + padding: 0 8px; + text-align: center; } - } -} -.newspack-donations-wizard__money-input { - align-items: stretch; - display: flex; - margin: 8px 0 0; - - .currency { - border: 1px solid wp-colors.$gray-700; - border-right: 0; - align-items: center; - background: wp-colors.$gray-100; - border-radius: 2px 0 0 2px; - display: flex; - flex: 0 0 14px; - height: auto; - justify-content: center; - line-height: 1; - margin: 0; - padding: 0 8px; - text-align: center; - } + .newspack-text-control { + margin: 0 !important; + width: 100%; - .newspack-text-control { - margin: 0 !important; - width: 100%; + @media screen and ( min-width: 1128px ) { + max-width: 100%; + } - @media screen and ( min-width: 1128px ) { - max-width: 100%; - } + input[type='number'] { + border-radius: 0 2px 2px 0; + } - input[type='number'] { - border-radius: 0 2px 2px 0; + .components-base-control__field { + margin-bottom: 0; + } } - .components-base-control__field { - margin-bottom: 0; + &-container { + p { + margin: 0 0 8px; + } } } } diff --git a/assets/wizards/readerRevenue/views/donation/index.tsx b/assets/wizards/readerRevenue/views/donation/index.tsx index 68752b5282..9d7a72bbb9 100644 --- a/assets/wizards/readerRevenue/views/donation/index.tsx +++ b/assets/wizards/readerRevenue/views/donation/index.tsx @@ -12,10 +12,11 @@ import { MoneyInput } from '../../components'; import { Button, Card, + Grid, Notice, SectionHeader, + SelectControl, Wizard, - ActionCard, } from '../../../../components/src'; import { READER_REVENUE_WIZARD_SLUG } from '../../constants'; @@ -82,71 +83,88 @@ export const DonationAmounts = () => { return ( <> - - + + + changeHandler( [ 'tiered' ] )( ! tiered ) } + buttonOptions={ [ + { value: true, label: __( 'Tiered', 'newspack' ) }, + { value: false, label: __( 'Untiered', 'newspack' ) }, + ] } + buttonSmall + value={ tiered } + hideLabelFromVision + /> + { tiered ? ( - availableFrequencies.map( section => { - const isFrequencyDisabled = disabledFrequencies[ section.key ]; - const isOneFrequencyActive = - Object.values( disabledFrequencies ).filter( Boolean ).length === - FREQUENCY_SLUGS.length - 1; - return ( - - changeHandler( [ 'disabledFrequencies', section.key ] )( ! isFrequencyDisabled ) - } - title={ section.tieredLabel } - disabled={ ! isFrequencyDisabled && isOneFrequencyActive } - > - { ! isFrequencyDisabled && ( -
- - + { availableFrequencies.map( section => { + const isFrequencyDisabled = disabledFrequencies[ section.key ]; + const isOneFrequencyActive = + Object.values( disabledFrequencies ).filter( Boolean ).length === + FREQUENCY_SLUGS.length - 1; + return ( + + + + changeHandler( [ 'disabledFrequencies', section.key ] )( + ! isFrequencyDisabled + ) + } + label={ section.tieredLabel } + disabled={ ! isFrequencyDisabled && isOneFrequencyActive } /> - -
- ) } -
- ); - } ) + { ! isFrequencyDisabled && ( + + + + + + ) } + + + ); + } ) } + ) : ( -
- { availableFrequencies.map( section => ( - - ) ) } -
+ + + { availableFrequencies.map( section => ( + + ) ) } + + ) } );