mirror of
https://github.com/wassname/talk.git
synced 2026-06-30 00:33:54 +08:00
33 lines
647 B
JavaScript
33 lines
647 B
JavaScript
import { OPEN_FEATURED_DIALOG, CLOSE_FEATURED_DIALOG } from './constants';
|
|
|
|
const initialState = {
|
|
showFeaturedDialog: false,
|
|
comment: {
|
|
id: null,
|
|
tags: [],
|
|
},
|
|
asset: {
|
|
id: null,
|
|
},
|
|
};
|
|
|
|
export default function reducer(state = initialState, action) {
|
|
switch (action.type) {
|
|
case OPEN_FEATURED_DIALOG:
|
|
return {
|
|
...state,
|
|
comment: action.comment,
|
|
asset: action.asset,
|
|
showFeaturedDialog: true,
|
|
};
|
|
case CLOSE_FEATURED_DIALOG:
|
|
return {
|
|
...state,
|
|
featuredCommentId: null,
|
|
showFeaturedDialog: false,
|
|
};
|
|
default:
|
|
return state;
|
|
}
|
|
}
|