Sha256: bf4c5bfa9774a90cfd7b142220dad82b73a7809d3032cc9b7260f4bd90e7ba42

Contents?: true

Size: 984 Bytes

Versions: 948

Compression:

Stored size: 984 Bytes

Contents

import React, { useState } from 'react'

import {Body, Passphrase} from 'playbook-ui'

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

948 entries across 948 versions & 2 rubygems

Version Path
playbook_ui_docs-14.11.1.pre.alpha.PLAY17445539 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-14.11.1.pre.alpha.PLAY17445539 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui_docs-14.11.1.pre.alpha.PBNTR798datepickerturbo5537 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-14.11.1.pre.alpha.PBNTR798datepickerturbo5537 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui_docs-14.11.1.pre.alpha.pbntr703collapsiblerowsrails5536 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-14.11.1.pre.alpha.pbntr703collapsiblerowsrails5536 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui_docs-14.11.1.pre.alpha.PLAY1751pbcontenttagpt25529 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-14.11.1.pre.alpha.PLAY1751pbcontenttagpt25529 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui_docs-14.11.1.pre.alpha.PBNTR7495495 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-14.11.1.pre.alpha.PBNTR7495495 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui_docs-14.12.0.pre.rc.11 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-14.12.0.pre.rc.11 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui_docs-14.12.0.pre.rc.10 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-14.12.0.pre.rc.10 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui_docs-14.12.0.pre.rc.9 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-14.12.0.pre.rc.9 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui_docs-14.12.0.pre.rc.8 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-14.12.0.pre.rc.8 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui_docs-14.12.0.pre.rc.7 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx
playbook_ui-14.12.0.pre.rc.7 app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.jsx