From d2e8eb83ae741e8077bb29f1eb25cd2f20539d26 Mon Sep 17 00:00:00 2001 From: Maciej Hirsz <1096222+maciejhirsz@users.noreply.github.com> Date: Mon, 24 Sep 2018 11:45:05 +0200 Subject: [PATCH] Switches in settings (#45) --- .../frontend/src/components/Chain/Chain.css | 14 ------ .../frontend/src/components/Chain/Chain.tsx | 6 +-- packages/frontend/src/components/Option.css | 47 +++++++++++++++++++ packages/frontend/src/components/Option.tsx | 27 +++++++++++ packages/frontend/src/components/index.ts | 1 + 5 files changed, 78 insertions(+), 17 deletions(-) create mode 100644 packages/frontend/src/components/Option.css create mode 100644 packages/frontend/src/components/Option.tsx diff --git a/packages/frontend/src/components/Chain/Chain.css b/packages/frontend/src/components/Chain/Chain.css index f36b63d..7196095 100644 --- a/packages/frontend/src/components/Chain/Chain.css +++ b/packages/frontend/src/components/Chain/Chain.css @@ -101,17 +101,3 @@ font-size: 20px; font-weight: 100; } - -.Chain-settings-category p { - padding: 0; - margin: 0 0 0.1em 0; - cursor: pointer; -} - -.Chain-settings-category .Icon { - margin-right: 10px; -} - -.Chain-settings-disabled { - color: #666; -} diff --git a/packages/frontend/src/components/Chain/Chain.tsx b/packages/frontend/src/components/Chain/Chain.tsx index 7645090..bb1bcd1 100644 --- a/packages/frontend/src/components/Chain/Chain.tsx +++ b/packages/frontend/src/components/Chain/Chain.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { State as AppState } from '../../state'; import { formatNumber, secondsWithPrecision, viewport } from '../../utils'; import { Tab } from './'; -import { Tile, Icon, Node, Ago } from '../'; +import { Tile, Node, Ago, Option } from '../'; import { Types } from '@dotstats/common'; import { Persistent } from '../../Persistent'; @@ -177,7 +177,7 @@ export class Chain extends React.Component { return null; } - const className = settings[setting] ? '' : 'Chain-settings-disabled'; + const checked = settings[setting]; const changeSetting = () => { const change = {}; @@ -187,7 +187,7 @@ export class Chain extends React.Component { this.props.setSettings(change); } - return

{label}

; + return