-
Notifications
You must be signed in to change notification settings - Fork 851
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
Add snackbar#1950, Dialog UI#1953 reducer, action, action creator #1959
Conversation
src/redux/actions/snackbar.js
Outdated
@@ -0,0 +1,25 @@ | |||
import { handleActions } from 'redux-actions'; | |||
import actionTypes from '../actionTypes'; |
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.
Do need a separate file for this. It can be combined with the dialog box reducers.
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.
@akshatnitd The reason for keeping a separate file is, snackbar is used in more components, where dialog box is not used. Just to keep the imports less, so I split the reducers in to 2. If you want, I can combine them, or we can use 2 separate reducer
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.
I'll go with your approach, and make a single file
src/redux/actions/dialog.js
Outdated
import actionTypes from '../actionTypes'; | ||
|
||
const defaultState = { | ||
openLogin: false, |
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.
Keep the state as -
modalProps: {
isModalOpen : false,
modalType: ''
},
snackBarProps : {
isSnackBarOpen: false,
snackBarMessage: ''
}
src/redux/actions/dialog.js
Outdated
|
||
export default handleActions( | ||
{ | ||
[actionTypes.UI_OPEN_LOGIN_DIALOG](state) { |
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.
Make changes in the actions and reducers accordingly.
9dcb727
to
37bd111
Compare
@akshatnitd made the changes 👍 , please review |
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.
LGTM 🚀
Fixes: #1953, #1950
Changes:
Add reducers, action, action creator for redux integration for the following:
Demo Link: https://pr-1959-1-fossasia-susi-web-chat.surge.sh