1.0.5 • Published 3 years ago

shared-app-2 v1.0.5

Weekly downloads
6
License
MIT
Repository
-
Last release
3 years ago

shared-app-2

Made with create-react-library

NPM JavaScript Style Guide

Install

npm install --save shared-app-2

Usage

import React, { Component } from 'react'

import { FormikControl, Form, Formik } from 'shared-app-2'


class Example extends Component {
  render() {
       return (
        <div className='calc-container sdc-calc'>
            <h1 className='calc-title text-center text-bold'>
                Stamp Duty Calculator
            </h1>
            <div className='row'>
                <div className='col-md-6'>
                    <h4 className='text-bold'>Fill in the details</h4>{' '}
                    <Formik
                        initialValues={initialValues}
                        validateOnChange={false}
                        onSubmit={onSubmit}
                    >
                        {({
                            values,
                            errors,
                            setFieldValue,
                            isSubmitting,
                            isValid
                        }) => {
                            return (
                                <Form>
                                    <div className='row'>
                                        <div className='col-md-12 '>
                                            <FormikControl
                                                control='select'
                                                label='State of the Property'
                                                name='state'
                                                setFieldValue={setFieldValue}
                                                options={propertyStateOption}
                                            />
                                            <FormikControl
                                                control='numeric'
                                                label='Property Value'
                                                name='property_value'
                                                placeholder='Enter property value'
                                                errors={errors}
                                                setFieldValue={setFieldValue}
                                            />
                                            <FormikControl
                                                control='radio'
                                                label='Property Type'
                                                name='property_type'
                                                options={propertyTypeOption}
                                            />
                                            <FormikControl
                                                control='radio'
                                                label='Are you the first home buyer ?'
                                                name='first_home_buyer'
                                                options={commonOption}
                                            />
                                            <FormikControl
                                                control='radio'
                                                label='Property Status'
                                                name='property_status'
                                                options={propertyStatusOption}
                                            />
                                    <button
                                        className='btn-blue btn'
                                        disabled={isSubmitting || !isValid}
                                        type='submit'
                                    >
                                        Calculate
                                    </button>
                                </Form>
                            )
                        }}
                    </Formik>
                </div>
            </div>
        </div>
    )
  }
}

License

MIT © amirsaga

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago