Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Title and logo are now customizable based on Settings page
- Loading branch information
1 parent
ab42d84
commit 07a3838
Showing
14 changed files
with
130 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import AppDispatcher from '../dispatcher/AppDispatcher'; | ||
import AppConstants from '../constants/AppConstants'; | ||
|
||
export default { | ||
updateSettings(settings) { | ||
AppDispatcher.dispatch({ | ||
type: AppConstants.UPDATE_SETTINGS, | ||
value: settings | ||
}); | ||
}, | ||
selectGrid() { | ||
AppDispatcher.dispatch({ | ||
type: AppConstants.VIEW_GRID, | ||
}); | ||
}, | ||
selectList() { | ||
AppDispatcher.dispatch({ | ||
type: AppConstants.VIEW_LIST, | ||
}); | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default class Settings { | ||
constructor({ name = '', version = '', logo = '' }) { | ||
this.name = name; | ||
this.version = version; | ||
this.logo = logo; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React, { Component } from 'react'; | ||
import { Container } from 'flux/utils'; | ||
import NavbarComponent from './NavbarComponent'; | ||
import AppStore from '../stores/AppStore'; | ||
|
||
class NavbarContainer extends Component { | ||
|
||
static getStores() { | ||
return [AppStore]; | ||
} | ||
|
||
static calculateState() { | ||
return { | ||
appStore: AppStore.getState(), | ||
}; | ||
} | ||
|
||
render() { | ||
return <NavbarComponent {...this.state} />; | ||
} | ||
|
||
} | ||
|
||
export default Container.create(NavbarContainer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/app/constants/ViewConstants.js → src/app/constants/AppConstants.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export default { | ||
UPDATE_SETTINGS: 'UPDATE_SETTINGS', | ||
VIEW_GRID: 'view--grid', | ||
VIEW_LIST: 'view--list', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { ReduceStore } from 'flux/utils'; | ||
import AppDispatcher from '../dispatcher/AppDispatcher'; | ||
import AppConstants from '../constants/AppConstants'; | ||
|
||
import Settings from '../class/Settings'; | ||
|
||
class AppStore extends ReduceStore { | ||
constructor() { | ||
super(AppDispatcher); | ||
} | ||
|
||
getInitialState() { | ||
return { | ||
view: AppConstants.VIEW_GRID, | ||
settings: new Settings({ | ||
name: 'Technology Radar', | ||
logo: 'images/logo.png', | ||
}) | ||
}; | ||
} | ||
|
||
reduce(state, action) { | ||
switch (action.type) { | ||
case AppConstants.UPDATE_SETTINGS: | ||
return { | ||
...state, | ||
settings: action.value, | ||
}; | ||
case AppConstants.VIEW_GRID: | ||
return { | ||
...state, | ||
view: AppConstants.VIEW_GRID, | ||
}; | ||
case AppConstants.VIEW_LIST: | ||
return { | ||
...state, | ||
view: AppConstants.VIEW_LIST, | ||
}; | ||
default: | ||
return state; | ||
} | ||
} | ||
} | ||
|
||
export default new AppStore(); |
This file was deleted.
Oops, something went wrong.