news scroll reducer
This commit is contained in:
parent
0fad55ef98
commit
ad09a4a708
|
|
@ -1,14 +1,61 @@
|
|||
// // Types
|
||||
// import { ILanguage, ILanguageAction } from "../types/store.types";
|
||||
// Types
|
||||
import { INewsScroll, INewsScrollAction } from "../types/store.types";
|
||||
|
||||
// // Helpers
|
||||
// import getSavedLanguage from "../helpers/getSavedLanguage";
|
||||
export const postsInitialState = {
|
||||
data: [
|
||||
{
|
||||
id: -1,
|
||||
title: "",
|
||||
slug: "",
|
||||
excerpt: "",
|
||||
published_at: "",
|
||||
featured_images: [
|
||||
{
|
||||
id: -1,
|
||||
disk_name: "",
|
||||
file_name: "",
|
||||
path: "",
|
||||
extension: "",
|
||||
},
|
||||
{
|
||||
id: -1,
|
||||
disk_name: "",
|
||||
file_name: "",
|
||||
path: "",
|
||||
extension: "",
|
||||
},
|
||||
{
|
||||
id: -1,
|
||||
disk_name: "",
|
||||
file_name: "",
|
||||
path: "",
|
||||
extension: "",
|
||||
},
|
||||
],
|
||||
content_html: "",
|
||||
categories: [
|
||||
{
|
||||
id: -1,
|
||||
name: "",
|
||||
},
|
||||
],
|
||||
powerseo_title: "",
|
||||
powerseo_description: "",
|
||||
powerseo_keywords: "",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
// const initialState = {
|
||||
// title: getSavedLanguage(),
|
||||
// };
|
||||
|
||||
// export const languageReducer = (
|
||||
// state: ILanguage = initialState,
|
||||
// action: ILanguageAction
|
||||
// ) => {};
|
||||
export const dataReducer = (
|
||||
state: INewsScroll = postsInitialState,
|
||||
action: INewsScrollAction
|
||||
) => {
|
||||
switch (action.type) {
|
||||
case "SET_NEWS_SCROLL": {
|
||||
return { ...state, data: action.payload };
|
||||
}
|
||||
default: {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue