UNPKG

lucid-ui

Version:

A UI component library from AppNexus.

51 lines 2.07 kB
import React from 'react'; import createClass from 'create-react-class'; import { SwitchLabeled } from '../../../index'; var style = { marginBottom: '3px' }; export default createClass({ getInitialState: function getInitialState() { return { airplaneMode: false, bluetooth: false, cellularData: false }; }, handleSelectedAirplaneMode: function handleSelectedAirplaneMode(isSelected) { this.setState({ airplaneMode: isSelected }); }, handleSelectedBluetooth: function handleSelectedBluetooth(isSelected) { this.setState({ bluetooth: isSelected }); }, handleSelectedCellularData: function handleSelectedCellularData(isSelected) { this.setState({ cellularData: isSelected }); }, render: function render() { return /*#__PURE__*/React.createElement("section", null, /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("em", null, "(Use the styles on the parent container of", ' ', /*#__PURE__*/React.createElement("code", null, "SwitchLabeled"), " components to ensure only the switches and their labels are clickable)")), /*#__PURE__*/React.createElement("span", { style: { display: 'inline-flex', flexDirection: 'column', alignItems: 'flex-start' } }, /*#__PURE__*/React.createElement(SwitchLabeled, { isSelected: this.state.airplaneMode === true, onSelect: this.handleSelectedAirplaneMode, style: style }, /*#__PURE__*/React.createElement(SwitchLabeled.Label, null, "Airplane Mode")), /*#__PURE__*/React.createElement(SwitchLabeled, { isSelected: this.state.bluetooth === true, onSelect: this.handleSelectedBluetooth, style: style }, /*#__PURE__*/React.createElement(SwitchLabeled.Label, null, "Bluetooth")), /*#__PURE__*/React.createElement(SwitchLabeled, { isSelected: this.state.cellularData === true, onSelect: this.handleSelectedCellularData, style: style }, /*#__PURE__*/React.createElement(SwitchLabeled.Label, null, "Cellular Data")))); } });