[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/js/bp-core/js/blocks/login-form/ -> edit.js (source)

   1  /**
   2   * WordPress dependencies.
   3   */
   4  const {
   5      blockEditor: {
   6          InspectorControls,
   7      },
   8      components: {
   9          Disabled,
  10          PanelBody,
  11          TextControl,
  12          ToggleControl,
  13      },
  14      element: {
  15          Fragment,
  16          createElement,
  17      },
  18      i18n: {
  19          __,
  20      },
  21      serverSideRender: ServerSideRender,
  22  } = wp;
  23  
  24  const editLoginForm = ( { attributes, setAttributes } ) => {
  25      const { title,forgotPwdLink } = attributes;
  26  
  27      return (
  28          <Fragment>
  29              <InspectorControls>
  30                  <PanelBody title={ __( 'Settings', 'buddypress' ) } initialOpen={ true }>
  31                      <TextControl
  32                          label={ __( 'Title', 'buddypress' ) }
  33                          value={ title }
  34                          onChange={ ( text ) => {
  35                              setAttributes( { title: text } );
  36                          } }
  37                      />
  38                      <ToggleControl
  39                          label={ __( 'Include the link to reset the user password', 'buddypress' ) }
  40                          checked={ !! forgotPwdLink }
  41                          onChange={ () => {
  42                              setAttributes( { forgotPwdLink: ! forgotPwdLink } );
  43                          } }
  44                      />
  45                  </PanelBody>
  46              </InspectorControls>
  47              <Disabled>
  48                  <ServerSideRender block="bp/login-form" attributes={ attributes } />
  49              </Disabled>
  50          </Fragment>
  51      );
  52  };
  53  
  54  export default editLoginForm;


Generated: Fri May 5 01:01:24 2023 Cross-referenced by PHPXref 0.7.1