This commit is contained in:
Thomas Nordquist
2019-01-13 15:19:09 +01:00
parent 31b3077743
commit 1267bb27f7
2 changed files with 17 additions and 20 deletions

View File

@@ -1,23 +1,23 @@
import * as React from 'react' import * as React from 'react'
import * as q from '../../../backend/src/Model' import * as q from '../../../backend/src/Model'
import Drawer from '@material-ui/core/Drawer' import { AppState, NodeOrder } from '../reducers'
import IconButton from '@material-ui/core/IconButton' import {
import Paper from '@material-ui/core/Paper' Divider,
import Divider from '@material-ui/core/Divider' Drawer,
import MenuItem from '@material-ui/core/MenuItem' IconButton,
import Select from '@material-ui/core/Select' Input,
InputLabel,
MenuItem,
Select,
Typography,
} from '@material-ui/core'
import { StyleRulesCallback, withStyles } from '@material-ui/core/styles'
import ChevronRight from '@material-ui/icons/ChevronRight' import ChevronRight from '@material-ui/icons/ChevronRight'
import { Typography, InputBase, Input, InputLabel } from '@material-ui/core'
import { withStyles, StyleRulesCallback } from '@material-ui/core/styles'
import { settingsActions } from '../actions'
import { AppState, NodeOrder } from '../reducers'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux' import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import { settingsActions } from '../actions'
const styles: StyleRulesCallback = theme => ({ const styles: StyleRulesCallback = theme => ({
drawer: { drawer: {
@@ -85,7 +85,6 @@ class Settings extends React.Component<Props, {}> {
private renderAutoExpand() { private renderAutoExpand() {
const { classes, autoExpandLimit } = this.props const { classes, autoExpandLimit } = this.props
return ( return (
<div style={{ padding: '8px' }}> <div style={{ padding: '8px' }}>
<InputLabel htmlFor="auto-expand">Auto Expand</InputLabel> <InputLabel htmlFor="auto-expand">Auto Expand</InputLabel>
@@ -93,11 +92,10 @@ class Settings extends React.Component<Props, {}> {
value={autoExpandLimit} value={autoExpandLimit}
onChange={this.onChangeAutoExpand} onChange={this.onChangeAutoExpand}
input={<Input name="auto-expand" id="auto-expand-label-placeholder" />} input={<Input name="auto-expand" id="auto-expand-label-placeholder" />}
displayEmpty={true}
name="auto-expand" name="auto-expand"
className={classes.input} className={classes.input}
> >
<MenuItem value={0}><em>Disabled</em></MenuItem> <MenuItem value={0}><em>Collapsed</em></MenuItem>
<MenuItem value={2}>Few</MenuItem> <MenuItem value={2}>Few</MenuItem>
<MenuItem value={3}>Some</MenuItem> <MenuItem value={3}>Some</MenuItem>
<MenuItem value={10}>Most</MenuItem> <MenuItem value={10}>Most</MenuItem>

View File

@@ -1,6 +1,7 @@
import { Reducer, Action } from 'redux'
import * as q from '../../../backend/src/Model' import * as q from '../../../backend/src/Model'
import { Action, Reducer } from 'redux'
export enum ActionTypes { export enum ActionTypes {
setAutoExpandLimit = 'SET_AUTO_EXPAND_LIMIT', setAutoExpandLimit = 'SET_AUTO_EXPAND_LIMIT',
toggleSettingsVisibility = 'TOGGLE_SETTINGS_VISIBILITY', toggleSettingsVisibility = 'TOGGLE_SETTINGS_VISIBILITY',
@@ -47,7 +48,6 @@ const reducer: Reducer<AppState | undefined, CustomAction> = (state, action) =>
if (!state) { if (!state) {
throw Error('No initial state') throw Error('No initial state')
} }
console.log(action)
switch (action.type) { switch (action.type) {
case ActionTypes.setAutoExpandLimit: case ActionTypes.setAutoExpandLimit:
@@ -62,7 +62,6 @@ const reducer: Reducer<AppState | undefined, CustomAction> = (state, action) =>
}, },
} }
case ActionTypes.setPublishTopic: case ActionTypes.setPublishTopic:
console.log(state)
return { return {
...state, ...state,
sidebar: { ...state.sidebar, publishTopic: action.publishTopic }, sidebar: { ...state.sidebar, publishTopic: action.publishTopic },