-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modals and DashAlert state #737
Changes from 10 commits
9c26b5f
0974e05
3f569ab
c0542ab
b9b8a92
fd55283
3b80f0d
293fec7
8f8185c
635a972
0504735
538ca0c
404e356
963a542
e1efcf2
abc13ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ import HTML5Backend from 'react-dnd-html5-backend'; | |
const NewTeam = (props) => { | ||
const {dispatch, params: {newOrg}} = props; | ||
return ( | ||
<DashboardWrapper title="User Dashboard"> | ||
<DashboardWrapper dispatch={dispatch} title="User Dashboard"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ackernaut can we get rid of this? |
||
<NewTeamFormContainer dispatch={dispatch} newOrgRoute={Boolean(newOrg)}/> | ||
</DashboardWrapper> | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const NOTIFICATION_BAR_PRESENT = 'notifications/NOTIFICATION_BAR_PRESENT'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. where does this bar appear? all dashboards? meeting? i think we may wanna refactor it into a dashboard duck. we already have an entity called notifications & having a notifications duck that doesnt pertain to it is gonna get confusing. |
||
|
||
const initialState = { | ||
hasNotificationBar: false | ||
}; | ||
|
||
export default function reducer(state = initialState, action = {}) { | ||
switch (action.type) { | ||
case NOTIFICATION_BAR_PRESENT: { | ||
return { | ||
...state, | ||
hasNotificationBar: action.payload.hasNotificationBar, | ||
}; | ||
} | ||
default: | ||
return state; | ||
} | ||
} | ||
|
||
export const notificationBarPresent = (hasNotificationBar) => ({ | ||
type: NOTIFICATION_BAR_PRESENT, | ||
payload: { | ||
hasNotificationBar | ||
} | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,17 +5,18 @@ import {DragDropContext as dragDropContext} from 'react-dnd'; | |
import HTML5Backend from 'react-dnd-html5-backend'; | ||
|
||
const UserDashboard = (props) => { | ||
const {children, location: {pathname}} = props; | ||
const {children, dispatch, location: {pathname}} = props; | ||
const title = pathname === '/me' ? 'User Dashboard' : 'User Settings'; | ||
return ( | ||
<DashboardWrapper location={pathname} title={title}> | ||
<DashboardWrapper dispatch={dispatch} location={pathname} title={title}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. necessary? |
||
{children} | ||
</DashboardWrapper> | ||
); | ||
}; | ||
|
||
UserDashboard.propTypes = { | ||
children: PropTypes.any, | ||
dispatch: PropTypes.func.isRequired, | ||
location: PropTypes.object | ||
}; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ import {reducer as storageReducer} from 'redux-storage-whitelist-fn'; | |
import storageMerger from 'universal/redux/storageMerger'; | ||
import makeRootReducer from 'universal/redux/rootDuck'; | ||
import menuReducer from 'universal/modules/menu/ducks/menuDuck'; | ||
import notificationReducer from 'universal/modules/notifications/ducks/notificationDuck'; | ||
|
||
const {SET_SUBMIT_SUCCEEDED} = actionTypes; | ||
|
||
|
@@ -35,6 +36,7 @@ const appReducers = { | |
[DEFAULT_AUTH_REDUCER_NAME]: auth, | ||
cashay: cashayReducer, | ||
form: formReducer.plugin(formPlugin), | ||
notifications: notificationReducer, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's refactor to 'dashboard' or something similar so we don't confuse the notification bar with notifications |
||
menu: menuReducer, | ||
toasts, | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont pass dispatch to containers,
mapStateToProps
gives it to em anywaysThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ackernaut is this necessary?