Skip to content
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

Merged
merged 3 commits into from
Jan 20, 2019

Conversation

fragm3
Copy link
Contributor

@fragm3 fragm3 commented Jan 16, 2019

Fixes: #1953, #1950

Changes:

Add reducers, action, action creator for redux integration for the following:

  1. Snackbar
  2. Dialog Actions(OpenLogin, OpenSignup, OpenForgotPassword

Demo Link: https://pr-1959-1-fossasia-susi-web-chat.surge.sh

@@ -0,0 +1,25 @@
import { handleActions } from 'redux-actions';
import actionTypes from '../actionTypes';
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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

import actionTypes from '../actionTypes';

const defaultState = {
openLogin: false,
Copy link
Member

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: ''
}


export default handleActions(
{
[actionTypes.UI_OPEN_LOGIN_DIALOG](state) {
Copy link
Member

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.

@fragm3
Copy link
Contributor Author

fragm3 commented Jan 18, 2019

@akshatnitd made the changes 👍 , please review

Copy link
Member

@akshatnitd akshatnitd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@Akshat-Jain Akshat-Jain merged commit 0666991 into fossasia:master Jan 20, 2019
AvinashAgarwal14 pushed a commit to AvinashAgarwal14/chat.susi.ai that referenced this pull request Jan 21, 2019
pulkit1joshi pushed a commit to pulkit1joshi/susi.ai that referenced this pull request Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants