function checkbox(locals) {
  let stylesheet = locals.stylesheet
  let checkboxStyle = stylesheet.checkbox.normal
  let errorBlockStyle = stylesheet.errorBlock
  let controlLabelStyle = stylesheet.controlLabel.normal

  if (locals.hasError) {
    checkboxStyle = stylesheet.checkbox.error
  }

  let error = locals.hasError && locals.error ? <Text style={errorBlockStyle}>{locals.error}</Text> : null
  let label = locals.label ? <Text style={controlLabelStyle}>{locals.label}</Text> : null

  let heading
  if (locals.path[0] == "shouldReceiveReminder") {
    heading = (
      <Text style={[
        controlLabelStyle,
        BaseStyles.marginHorz,
        BaseStyles.marginVert
      ]}>
        SCHEDULE REMINDER
      </Text>
    )
  }

  return (
    <View>
      {heading}
      <View style={[
        BaseStyles.whiteBg,
        BaseStyles.paddingVert,
        BaseStyles.paddingHorz,
        BaseStyles.row,
        BaseStyles.justifiedCols
      ]}>
        <Text style={[
          BaseStyles.sansSerifRegular,
          BaseStyles.fontSmall,
          BaseStyles.textDark
        ]}>
          {locals.label}
        </Text>
        <SwitchIOS
          ref="input"
          disabled={locals.disabled}
          onTintColor={locals.onTintColor}
          thumbTintColor={locals.thumbTintColor}
          tintColor={locals.tintColor}
          style={checkboxStyle}
          onValueChange={(value) => locals.onChange(value)}
          value={locals.value} />
        {error}
      </View>
    </View>
  )
}
/**
 * Custom check box to be use with the Tcomb form plugin.
 *
 * @param  {object} locals - props passed from tcomb library
 * @return {object} component
 */
Custom check box to be use with the Tcomb form plugin.
@param  {object} locals - props passed from tcomb library
@return {object} component
Custom check box to be use with the Tcomb form plugin . @param { object } locals - props passed from tcomb library @return { object } component
function checkbox(locals) {
  let stylesheet = locals.stylesheet
  let checkboxStyle = stylesheet.checkbox.normal
  let errorBlockStyle = stylesheet.errorBlock
  let controlLabelStyle = stylesheet.controlLabel.normal
  if (locals.hasError) {
    checkboxStyle = stylesheet.checkbox.error
  }
  let error = locals.hasError && locals.error ? <Text style={errorBlockStyle}>{locals.error}</Text> : null
  let label = locals.label ? <Text style={controlLabelStyle}>{locals.label}</Text> : null
  let heading
  if (locals.path[0] == "shouldReceiveReminder") {
    heading = (
      <Text style={[
        controlLabelStyle,
        BaseStyles.marginHorz,
        BaseStyles.marginVert
      ]}>
        SCHEDULE REMINDER
      </Text>
    )
  }
  return (
    <View>
      {heading}
      <View style={[
        BaseStyles.whiteBg,
        BaseStyles.paddingVert,
        BaseStyles.paddingHorz,
        BaseStyles.row,
        BaseStyles.justifiedCols
      ]}>
        <Text style={[
          BaseStyles.sansSerifRegular,
          BaseStyles.fontSmall,
          BaseStyles.textDark
        ]}>
          {locals.label}
        </Text>
        <SwitchIOS
          ref="input"
          disabled={locals.disabled}
          onTintColor={locals.onTintColor}
          thumbTintColor={locals.thumbTintColor}
          tintColor={locals.tintColor}
          style={checkboxStyle}
          onValueChange={(value) => locals.onChange(value)}
          value={locals.value} />
        {error}
      </View>
    </View>
  )
}
function checkbox ( locals ) { let stylesheet = locals . stylesheet let checkboxStyle = stylesheet . checkbox . normal let errorBlockStyle = stylesheet . errorBlock let controlLabelStyle = stylesheet . controlLabel . normal if ( locals . hasError ) { checkboxStyle = stylesheet . checkbox . error } let error = locals . hasError && locals . error ? < Text style = { errorBlockStyle } > { locals . error } < / Text > : null let label = locals . label ? < Text style = { controlLabelStyle } > { locals . label } < / Text > : null let heading if ( locals . path [ 0 ] == "shouldReceiveReminder" ) { heading = ( < Text style = { [ controlLabelStyle , BaseStyles . marginHorz , BaseStyles . marginVert ] } > 
        SCHEDULE REMINDER
       < / Text > ) } return ( < View > { heading } < View style = { [ BaseStyles . whiteBg , BaseStyles . paddingVert , BaseStyles . paddingHorz , BaseStyles . row , BaseStyles . justifiedCols ] } > < Text style = { [ BaseStyles . sansSerifRegular , BaseStyles . fontSmall , BaseStyles . textDark ] } > { locals . label } < / Text > < SwitchIOS ref = "input" disabled = { locals . disabled } onTintColor = { locals . onTintColor } thumbTintColor = { locals . thumbTintColor } tintColor = { locals . tintColor } style = { checkboxStyle } onValueChange = { ( value ) => locals . onChange ( value ) } value = { locals . value } / > { error } < / View > < / View > ) }
Custom check box to be use with the Tcomb form plugin.
Custom check box to be use with the Tcomb form plugin .