Sha256: 6b35aefce436023c0e65bf085bcf911051d77188b1c961a8d00e149600d0457c

Contents?: true

Size: 978 Bytes

Versions: 840

Compression:

Stored size: 978 Bytes

Contents

import React, { useState } from 'react'

import {Body, Passphrase} from '../..'

const PassphraseConfirmation = (props) => {
  const [input, setInput] = useState('')
  const [confirmationInput, setConfirmationInput] = useState('')
  
  const handleChange = (e) => setInput(e.target.value)
  const handleConfirmationChange = (e) => setConfirmationInput(e.target.value)    
  
  return (
    <>
      <div>
        <Passphrase
            onChange={handleChange}
            value={input}
            {...props}
        />
        <Passphrase
            confirmation
            onChange={handleConfirmationChange}
            value={confirmationInput}
            {...props}
        />
        {input && confirmationInput && (
          <Body
              text={
                input === confirmationInput ? "They match!" : "They don't match!"
              }
              {...props}
          />
        )}
      </div>
    </>
  );
}

export default PassphraseConfirmation

Version data entries

840 entries across 840 versions & 2 rubygems

Version Path
playbook_ui-11.20.0.pre.alpha.passthrough1 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-11.20.0.pre.alpha.railsdialog1 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-11.20.0.pre.alpha.focus1 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-11.20.0 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-11.19.0.pre.alpha.map1 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-11.19.0.pre.alpha.pagpassthrough1 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-11.19.0 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-11.18.0.pre.alpha.pagutility1 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-11.19.0.pre.typeahead1 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-11.18.0 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-11.17.0 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-11.15.0.pre.alpha.dependencies1 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-11.16.0.pre.alpha.paginationrails1 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-11.16.0 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-11.16.0.pre.alpha.reactupgrade1 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-11.15.0.pre.alpha.table1 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-11.16.0.pre.alpha.pagination.rails1 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-11.15.0 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-11.14.0 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-11.12.1.pre.alpha.passphrase1 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx