How to use the informed.withFieldApi function in informed

To help you get started, we’ve selected a few informed examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LN-Zap / zap-desktop / renderer / components / Onboarding / Steps / ConnectionType.js View on Github external
import PropTypes from 'prop-types'
import styled from 'styled-components'
import { FormattedMessage } from 'react-intl'
import { withFieldApi } from 'informed'
import { Box, Flex } from 'rebass'
import { Form, RadioGroup } from 'components/UI'
import ZapLogo from 'components/Icon/ZapLogoBolt'
import BaseConnectionTypeItem from './components/ConnectionTypeItem'
import BaseContainer from './components/Container'
import messages from './messages'

const Container = styled(BaseContainer)`
  visibility: ${props => (props.lndConnect ? 'hidden' : 'visible')};
`

const ConnectionTypeItem = withFieldApi('connectionType')(BaseConnectionTypeItem)

class ConnectionType extends React.Component {
  static propTypes = {
    connectionType: PropTypes.string,
    lndConnect: PropTypes.string,
    resetOnboarding: PropTypes.func.isRequired,
    setConnectionType: PropTypes.func.isRequired,
    stopLnd: PropTypes.func.isRequired,
    wizardApi: PropTypes.object,
    wizardState: PropTypes.object,
  }

  static defaultProps = {
    wizardApi: {},
    wizardState: {},
  }
github LN-Zap / zap-desktop / renderer / components / Onboarding / Steps / BackupSetup.js View on Github external
import React from 'react'
import PropTypes from 'prop-types'
import { FormattedMessage, injectIntl } from 'react-intl'
import { withFieldApi } from 'informed'
import { Flex } from 'rebass/styled-components'
import { intlShape } from '@zap/i18n'
import { Heading, Bar } from 'components/UI'
import { Form, RadioGroup } from 'components/Form'
import { BACKUP_FORM_WIDTH, BACKUP_FORM_HEIGHT } from './components/settings'
import BaseBackupTypeItem from './components/BackupTypeItem'
import Container from './components/Container'
import SkipBackupsDialog from './components/SkipBackupsDialog'
import messages from './messages'

const BackupTypeItem = withFieldApi('backupType')(BaseBackupTypeItem)

class BackupSetup extends React.Component {
  static propTypes = {
    hideSkipBackupDialog: PropTypes.func.isRequired,
    intl: intlShape.isRequired,
    isRestoreMode: PropTypes.bool,
    isSkipBackupDialogOpen: PropTypes.bool,
    setBackupProvider: PropTypes.func.isRequired,
    showError: PropTypes.func.isRequired,
    showSkipBackupDialog: PropTypes.func,
    wizardApi: PropTypes.object,
    wizardState: PropTypes.object,
  }

  static defaultProps = {
    wizardApi: {},

informed

A lightweight framework and utility for building powerful forms in React applications

MIT
Latest version published 2 days ago

Package Health Score

81 / 100
Full package analysis