PromucFlow_constructor/app/client/src/sagas/ThemeSaga.tsx
devrk96 a297737ca3
Feature: Theme switching between light and dark mode (#578)
* Theme switching feature integrated

* Condition removed

* menu height bugs fixed

* warnings removed
2020-09-22 17:26:11 +05:30

12 lines
432 B
TypeScript

import { ReduxActionTypes, ReduxAction } from "constants/ReduxActionConstants";
import { takeLatest } from "redux-saga/effects";
import { ThemeMode } from "reducers/uiReducers/themeReducer";
export function* setThemeSaga(actionPayload: ReduxAction<ThemeMode>) {
yield localStorage.setItem("THEME", actionPayload.payload);
}
export default function* themeSagas() {
yield takeLatest(ReduxActionTypes.SET_THEME, setThemeSaga);
}