Add placeholder store for config

This commit is contained in:
Melvin Valster
2019-07-29 22:30:12 +02:00
parent ddac625759
commit 483a0aa549
7 changed files with 34 additions and 1 deletions
+1
View File
@@ -2,6 +2,7 @@
- [ ] Fix: Tooltips cause horizontal scroll on less-wide screens. Investigate.
- [ ] Move routing logic from `Home` into `Calculator`
- [ ] Responsiveness:
- [ ] Tooltips on mobile need different UX
- [ ] Tooltips:
+2
View File
@@ -1,4 +1,6 @@
.calculator {
animation: fadeIn .4s ease-out;
&__points {
padding: 1em;
color: white;
+1
View File
@@ -0,0 +1 @@
export {}
+14
View File
@@ -0,0 +1,14 @@
import {
ConfigState, ConfigActionTypes
} from './types'
const initialState: ConfigState = {
alwaysShowPoints: false
}
export default function(state = initialState, action: ConfigActionTypes): ConfigState {
switch (action.type) {
default:
return state
}
}
+13
View File
@@ -0,0 +1,13 @@
export interface ConfigState {
alwaysShowPoints: boolean
}
export const SET_CONFIG_VALUE = 'SET_CONFIG_VALUE'
interface SetConfigValueAction {
type: typeof SET_CONFIG_VALUE
key: string
value: any
}
export type ConfigActionTypes = SetConfigValueAction
+2
View File
@@ -1,8 +1,10 @@
import { createStore, combineReducers, compose } from 'redux'
import calculator from './calculator/reducers'
import config from './config/reducers'
const rootReducer = combineReducers({
calculator,
config
})
export type AppState = ReturnType<typeof rootReducer>
+1 -1
View File
@@ -13,7 +13,7 @@ const isSizeMissing = (icon) => (size): boolean => !fs.existsSync(getPath(icon,
const getIconNames = (): string[] => {
return [
// 'inv_misc_questionmark',
'inv_misc_questionmark',
...Object.values(spells).map(getIcon),
...Object.values(classes).map(getIcon),
...Object.values(talentsById).map(getIcon)