mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
* feat(feedback): convert to react and redux - For styles, remove "aui-dialog2" nesting so existing styles can be reused. - Remove Feedback.js and replace with calls to redux for state storing and accessing. - Add dispatching to FeedbackButton instead of relying on jquery clicking handling so the button can be hooked into redux. * address feedback * remove calling to not show feedback for recorder and filmstrip
46 lines
933 B
JavaScript
46 lines
933 B
JavaScript
import {
|
|
ReducerRegistry
|
|
} from '../base/redux';
|
|
|
|
import {
|
|
CANCEL_FEEDBACK,
|
|
SUBMIT_FEEDBACK
|
|
} from './actionTypes';
|
|
|
|
const DEFAULT_STATE = {
|
|
message: '',
|
|
|
|
// The sentinel value -1 is used to denote no rating has been set and to
|
|
// preserve pre-redux behavior.
|
|
score: -1,
|
|
submitted: false
|
|
};
|
|
|
|
/**
|
|
* Reduces the Redux actions of the feature features/feedback.
|
|
*/
|
|
ReducerRegistry.register(
|
|
'features/feedback',
|
|
(state = DEFAULT_STATE, action) => {
|
|
switch (action.type) {
|
|
case CANCEL_FEEDBACK: {
|
|
return {
|
|
...state,
|
|
message: action.message,
|
|
score: action.score
|
|
};
|
|
}
|
|
|
|
case SUBMIT_FEEDBACK: {
|
|
return {
|
|
...state,
|
|
message: '',
|
|
score: -1,
|
|
submitted: true
|
|
};
|
|
}
|
|
}
|
|
|
|
return state;
|
|
});
|