Skip to:
Content

BuddyPress.org

Changeset 12618


Ignore:
Timestamp:
04/15/2020 12:08:56 AM (5 years ago)
Author:
imath
Message:

BP Blocks: gather all settings into a unique panel

Props greenshady

Fixes #8271

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/js/blocks/group.js

    r12577 r12618  
    192192    }
    193193  }))), createElement(InspectorControls, null, createElement(PanelBody, {
    194     title: __('Group\'s home button settings', 'buddypress'),
     194    title: __('Settings', 'buddypress'),
    195195    initialOpen: true
    196196  }, createElement(ToggleControl, {
     
    203203    },
    204204    help: displayActionButton ? __('Include a link to the group\'s home page under their name.', 'buddypress') : __('Toggle to display a link to the group\'s home page under their name.', 'buddypress')
    205   })), createElement(PanelBody, {
    206     title: __('Description settings', 'buddypress'),
    207     initialOpen: false
    208   }, createElement(ToggleControl, {
     205  }), createElement(ToggleControl, {
    209206    label: __('Display group\'s description', 'buddypress'),
    210207    checked: !!displayDescription,
     
    215212    },
    216213    help: displayDescription ? __('Include the group\'s description under their name.', 'buddypress') : __('Toggle to display the group\'s description under their name.', 'buddypress')
    217   })), isAvatarEnabled && createElement(PanelBody, {
    218     title: __('Avatar settings', 'buddypress'),
    219     initialOpen: false
    220   }, createElement(SelectControl, {
    221     label: __('Size', 'buddypress'),
     214  }), isAvatarEnabled && createElement(SelectControl, {
     215    label: __('Avatar size', 'buddypress'),
    222216    value: avatarSize,
    223217    options: AVATAR_SIZES,
     218    help: __('Select "None" to disable the avatar.', 'buddypress'),
    224219    onChange: function onChange(option) {
    225220      setAttributes({
     
    227222      });
    228223    }
    229   })), isCoverImageEnabled && createElement(PanelBody, {
    230     title: __('Cover image settings', 'buddypress'),
    231     initialOpen: false
    232   }, createElement(ToggleControl, {
     224  }), isCoverImageEnabled && createElement(ToggleControl, {
    233225    label: __('Display Cover Image', 'buddypress'),
    234226    checked: !!displayCoverImage,
  • trunk/src/bp-members/js/blocks/member.js

    r12577 r12618  
    192192    }
    193193  }))), createElement(InspectorControls, null, createElement(PanelBody, {
    194     title: __('Profile button settings', 'buddypress'),
     194    title: __('Settings', 'buddypress'),
    195195    initialOpen: true
    196196  }, createElement(ToggleControl, {
     
    203203    },
    204204    help: displayActionButton ? __('Include a link to the user\'s profile page under their display name.', 'buddypress') : __('Toggle to display a link to the user\'s profile page under their display name.', 'buddypress')
    205   })), isAvatarEnabled && createElement(PanelBody, {
    206     title: __('Avatar settings', 'buddypress'),
    207     initialOpen: false
    208   }, createElement(SelectControl, {
    209     label: __('Size', 'buddypress'),
     205  }), isAvatarEnabled && createElement(SelectControl, {
     206    label: __('Avatar size', 'buddypress'),
    210207    value: avatarSize,
    211208    options: AVATAR_SIZES,
     209    help: __('Select "None" to disable the avatar.', 'buddypress'),
    212210    onChange: function onChange(option) {
    213211      setAttributes({
     
    215213      });
    216214    }
    217   })), isCoverImageEnabled && createElement(PanelBody, {
    218     title: __('Cover image settings', 'buddypress'),
    219     initialOpen: false
    220   }, createElement(ToggleControl, {
     215  }), isCoverImageEnabled && createElement(ToggleControl, {
    221216    label: __('Display Cover Image', 'buddypress'),
    222217    checked: !!displayCoverImage,
     
    227222    },
    228223    help: displayCoverImage ? __('Include the user\'s cover image over their display name.', 'buddypress') : __('Toggle to display the user\'s cover image over their display name.', 'buddypress')
    229   })), isMentionEnabled && createElement(PanelBody, {
    230     title: __('Mention settings', 'buddypress'),
    231     initialOpen: false
    232   }, createElement(ToggleControl, {
     224  }), isMentionEnabled && createElement(ToggleControl, {
    233225    label: __('Display Mention slug', 'buddypress'),
    234226    checked: !!displayMentionSlug,
  • trunk/src/js/bp-groups/js/blocks/group.js

    r12576 r12618  
    6868            </BlockControls>
    6969            <InspectorControls>
    70                 <PanelBody title={ __( 'Group\'s home button settings', 'buddypress' ) } initialOpen={ true }>
     70                <PanelBody title={ __( 'Settings', 'buddypress' ) } initialOpen={ true }>
    7171                    <ToggleControl
    7272                        label={ __( 'Display Group\'s home button', 'buddypress' ) }
     
    8181                        }
    8282                    />
    83                 </PanelBody>
    84                 <PanelBody title={ __( 'Description settings', 'buddypress' ) } initialOpen={ false }>
     83
    8584                    <ToggleControl
    8685                        label={ __( 'Display group\'s description', 'buddypress' ) }
     
    9594                        }
    9695                    />
    97                 </PanelBody>
    98                 { isAvatarEnabled && (
    99                     <PanelBody title={ __( 'Avatar settings', 'buddypress' ) } initialOpen={ false }>
     96
     97                    { isAvatarEnabled && (
    10098                        <SelectControl
    101                             label={ __( 'Size', 'buddypress' ) }
     99                            label={ __( 'Avatar size', 'buddypress' ) }
    102100                            value={ avatarSize }
    103101                            options={ AVATAR_SIZES }
     102                            help={ __( 'Select "None" to disable the avatar.', 'buddypress' ) }
    104103                            onChange={ ( option ) => {
    105104                                setAttributes( { avatarSize: option } );
    106105                            } }
    107106                        />
    108                     </PanelBody>
    109                 ) }
    110                 { isCoverImageEnabled && (
    111                     <PanelBody title={ __( 'Cover image settings', 'buddypress' ) } initialOpen={ false }>
     107                    ) }
     108
     109                    { isCoverImageEnabled && (
    112110                        <ToggleControl
    113111                            label={ __( 'Display Cover Image', 'buddypress' ) }
     
    122120                            }
    123121                        />
    124                     </PanelBody>
    125                 ) }
     122                    ) }
     123                </PanelBody>
    126124            </InspectorControls>
    127125            <Disabled>
  • trunk/src/js/bp-members/js/blocks/member.js

    r12576 r12618  
    6767            </BlockControls>
    6868            <InspectorControls>
    69                 <PanelBody title={ __( 'Profile button settings', 'buddypress' ) } initialOpen={ true }>
     69                <PanelBody title={ __( 'Settings', 'buddypress' ) } initialOpen={ true }>
    7070                    <ToggleControl
    7171                        label={ __( 'Display Profile button', 'buddypress' ) }
     
    8080                        }
    8181                    />
    82                 </PanelBody>
    83                 { isAvatarEnabled && (
    84                     <PanelBody title={ __( 'Avatar settings', 'buddypress' ) } initialOpen={ false }>
     82
     83                    { isAvatarEnabled && (
    8584                        <SelectControl
    86                             label={ __( 'Size', 'buddypress' ) }
     85                            label={ __( 'Avatar size', 'buddypress' ) }
    8786                            value={ avatarSize }
    8887                            options={ AVATAR_SIZES }
     88                            help={ __( 'Select "None" to disable the avatar.', 'buddypress' ) }
    8989                            onChange={ ( option ) => {
    9090                                setAttributes( { avatarSize: option } );
    9191                            } }
    9292                        />
    93                     </PanelBody>
    94                 ) }
    95                 { isCoverImageEnabled && (
    96                     <PanelBody title={ __( 'Cover image settings', 'buddypress' ) } initialOpen={ false }>
     93                    ) }
     94
     95                    { isCoverImageEnabled && (
    9796                        <ToggleControl
    9897                            label={ __( 'Display Cover Image', 'buddypress' ) }
     
    107106                            }
    108107                        />
    109                     </PanelBody>
    110                 ) }
    111                 { isMentionEnabled && (
    112                     <PanelBody title={ __( 'Mention settings', 'buddypress' ) } initialOpen={ false }>
     108                    ) }
     109
     110                    { isMentionEnabled && (
    113111                        <ToggleControl
    114112                            label={ __( 'Display Mention slug', 'buddypress' ) }
     
    123121                            }
    124122                        />
    125                     </PanelBody>
    126                 ) }
     123                    ) }
     124                </PanelBody>
    127125            </InspectorControls>
    128126            <Disabled>
Note: See TracChangeset for help on using the changeset viewer.