From f71dc98fcca7de2e075452dd4dacaafb788d380f Mon Sep 17 00:00:00 2001 From: Vincent Date: Thu, 9 Jan 2020 12:15:12 +1100 Subject: [PATCH] Setting toggles configured --- stylesheets/_session.scss | 18 ++++--- ts/components/MainViewController.tsx | 33 +++++++++++- .../settings/SessionSettingListItem.tsx | 51 ++++++++++++------- 3 files changed, 75 insertions(+), 27 deletions(-) diff --git a/stylesheets/_session.scss b/stylesheets/_session.scss index eb1dffaa3..e84eeddd7 100644 --- a/stylesheets/_session.scss +++ b/stylesheets/_session.scss @@ -51,7 +51,7 @@ $session-shade-13: #474646; $session-shade-14: #535865; $session-shade-15: #5b6c72; $session-shade-16: #979797; -$session-shade-17: #d8d8d8; +$session-shade-17: #180a0a; $session-shade-18: #141414; $session-opaque-dark-1: rgba(0, 0, 0, 0.25); @@ -921,26 +921,28 @@ label { font-size: 15px; font-weight: bold; color: $session-color-white; + background-color: $session-shade-1; - height: 90px; - padding: 0px 15px; + padding: $session-margin-lg; + border-bottom: 2px solid $session-shade-5; display: flex; align-items: center; justify-content: space-between; &__info { - background-color: $session-shade-1; + padding-right: $session-margin-lg; + } + + &__title { + line-height: 1.7; } &__description { font-size: 13px; + font-weight: 100; @include session-color-subtle($session-color-white); } - - &:not(:last-child){ - border-bottom: 1px solid $session-shade-3; - } } } diff --git a/ts/components/MainViewController.tsx b/ts/components/MainViewController.tsx index 172feb7f3..d5cbdb462 100644 --- a/ts/components/MainViewController.tsx +++ b/ts/components/MainViewController.tsx @@ -1,7 +1,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import { SessionSettingListItem } from './session/settings/SessionSettingListItem'; +import { SessionSettingListItem, SessionSettingType } from './session/settings/SessionSettingListItem'; // interface State { // } @@ -51,7 +51,36 @@ export class MainViewController { public static renderSettingsView() { const element = (
- + + + + + alert("Cleaaarred!") } + />
); diff --git a/ts/components/session/settings/SessionSettingListItem.tsx b/ts/components/session/settings/SessionSettingListItem.tsx index cc8f58740..b8f7881e0 100644 --- a/ts/components/session/settings/SessionSettingListItem.tsx +++ b/ts/components/session/settings/SessionSettingListItem.tsx @@ -1,18 +1,21 @@ import React from 'react'; import { SessionToggle } from '../SessionToggle'; - -interface Props { -} +import { SessionButton, SessionButtonColor } from '../SessionButton'; -// export settings = { -// id -// category -// name -// description -// type (toggle, dropdown, etc) -// } +export enum SessionSettingType { + Toggle = 'toggle', + Options = 'options', + Button = 'button', +} +interface Props { + title: string; + description?: string; + type: SessionSettingType; + value: boolean | string; + onClick?: any; +} export class SessionSettingListItem extends React.Component { public constructor(props: Props) { @@ -24,21 +27,35 @@ export class SessionSettingListItem extends React.Component { public render(): JSX.Element { + const { title, description, type, value, onClick } = this.props + return (
- Typing indicators + { title }
-
- This is the description of the super usper awesome setting item -
+ { description && ( +
+ { description } +
+ )}
-
- -
+ { type === SessionSettingType.Toggle && ( +
+ +
+ )} + + { type === SessionSettingType.Button && ( + + )}
);