mirror of
https://github.com/Funkoala14/CreatorCenter_OOIN.git
synced 2025-06-09 20:39:18 +08:00
28 lines
668 B
JavaScript
28 lines
668 B
JavaScript
|
const initialState = {
|
||
|
message: '',
|
||
|
show: false,
|
||
|
type: 'success', // success, warning, error, info
|
||
|
};
|
||
|
|
||
|
const notificationBarSlice = createSlice({
|
||
|
name: 'notificationBar',
|
||
|
initialState,
|
||
|
reducers: {
|
||
|
setNotificationBarMessage: (state, action) => {
|
||
|
state.message = action.payload;
|
||
|
},
|
||
|
setNotificationBarShow: (state, action) => {
|
||
|
state.show = action.payload;
|
||
|
},
|
||
|
resetNotificationBar: (state) => {
|
||
|
state.message = '';
|
||
|
state.show = false;
|
||
|
state.type = 'success';
|
||
|
},
|
||
|
},
|
||
|
});
|
||
|
|
||
|
export const { setNotificationBarMessage, setNotificationBarShow, resetNotificationBar } = notificationBarSlice.actions;
|
||
|
|
||
|
export default notificationBarSlice.reducer;
|