import React from 'react';

import { RfidInput } from '../../src/index';
import '../../src/react-chayns-rfid_input/index.scss';
import ExampleContainer from '../ExampleContainer';

export default class Example extends React.Component {
    constructor() {
        super();

        this.state = {
            rfidInput: '',
            rfid: '',
        };
    }

    onInput = (rfidInput) => {
        this.setState({ rfidInput });
    };

    onConfirm = (rfid) => {
        this.setState({ rfid });
    };

    render() {
        return(
            <ExampleContainer headline="RFID Input">
                <h3>RFID-Live</h3>
                <p>{this.state.rfidInput || '-'}</p>
                <h3>RFID</h3>
                <p>{this.state.rfid || '-'}</p>

                <RfidInput
                    onConfirm={this.onConfirm}
                    onInput={this.onInput}
                    value={this.state.rfidInput}
                    enableScan={chayns.env.isApp && chayns.env.isAndroid}
                />

                <RfidInput
                    onConfirm={this.onConfirm}
                    onInput={this.onInput}
                    value={this.state.rfidInput}
                    enableScan
                />
            </ExampleContainer>
        );
    }
}

import React from 'react';

import { RfidInput } from '../../src/index';
import '../../src/react-chayns-rfid_input/index.scss';
import ExampleContainer from '../ExampleContainer';

export default class Example extends React.Component {
    constructor() {
        super();

        this.state = {
            rfidInput: '',
            rfid: '',
        };
    }

    onInput = (rfidInput) => {
        this.setState({ rfidInput });
    };

    onConfirm = (rfid) => {
        this.setState({ rfid });
    };

    render() {
        const { rfid, rfidInput } = this.state;

        return (
            <ExampleContainer headline="RFID Input">
                <h3>RFID-Live</h3>
                <p>{rfidInput || '-'}</p>
                <h3>RFID</h3>
                <p>{rfid || '-'}</p>

                <RfidInput
                    onConfirm={this.onConfirm}
                    onInput={this.onInput}
                    value={rfidInput}
                    enableScan={RfidInput.isNfcAvailable()}
                />

                <RfidInput
                    onConfirm={this.onConfirm}
                    onInput={this.onInput}
                    value={rfidInput}
                    enableScan
                />
            </ExampleContainer>
        );
    }
}

Add usage of isNfcAvailable to example Improve CodeStyle on rfid-example
Add usage of isNfcAvailable to example
Improve CodeStyle on rfid-example
