at the end of the day, it was inevitable

This commit is contained in:
Mo Elzubeir
2022-12-09 08:36:26 -06:00
commit 1218570914
1768 changed files with 887087 additions and 0 deletions
@@ -0,0 +1,49 @@
import * as api from '../../../../../api/themesApi'
import ReduxModule from '../../../abstract/reduxModule'
const GET_DEFAULT_THEME = 'Get default theme'
export class Themes extends ReduxModule {
getNamespace () {
return '[Themes]'
}
getDefaultTheme = ({token, fulfilled}) => {
return api
.getDefaultItem(token)
.then((data) => {
fulfilled(data)
return data
})
};
defineActions () {
const getDefaultTheme = this.thunkAction(GET_DEFAULT_THEME, this.getDefaultTheme)
return {
getDefaultTheme
}
}
getInitialState () {
return {
isPending: false,
themes: [],
defaultTheme: null,
activeId: ''
}
}
defineReducers () {
return {
[`${GET_DEFAULT_THEME} fulfilled`]: this.setReducer('defaultTheme')
}
}
}
const themes = new Themes()
themes.init()
export default themes
export const getDefaultTheme = themes.actions.getDefaultTheme