From 958c27aeeb559c976225ca1463d0b4b9b804d2e3 Mon Sep 17 00:00:00 2001 From: Alex Windett Date: Mon, 21 Nov 2016 17:41:23 +0000 Subject: [PATCH] Updating Toggle component to use input instead of divs --- ui/src/components/toggle/index.js | 32 ++++++++---- ui/src/components/toggle/readme.md | 9 ++-- ui/src/components/toggle/style.css | 84 +++++++++++++++++------------- 3 files changed, 73 insertions(+), 52 deletions(-) diff --git a/ui/src/components/toggle/index.js b/ui/src/components/toggle/index.js index 1f0e6850..859a3983 100644 --- a/ui/src/components/toggle/index.js +++ b/ui/src/components/toggle/index.js @@ -5,34 +5,44 @@ const React = require('react'); const styles = require('./style.css'); const Toggle = ({ - off = false, + checked = false, className, style }) => { const tgl = classNames( className, - styles.toggle, - off ? styles.off : styles.on, + styles.tgl, + checked ? styles.on : styles.off, ); - const btn = classNames( + const input = classNames( className, - styles.btn + styles.input + ); + + const label = classNames( + className, + styles.label ); return ( -
-
- - {off ? 'Off' : 'On'} - +
+