parent
2b1d297722
commit
edf81c7074
19 changed files with 433 additions and 315 deletions
@ -0,0 +1,3 @@ |
||||
// @create-index
|
||||
export type { default as PublicAction } from "./public"; |
||||
export type { default as UserAction } from "./user"; |
@ -0,0 +1,33 @@ |
||||
interface getHomeData { |
||||
type : "public/homePage" |
||||
data : any |
||||
} |
||||
|
||||
interface getBlogList{ |
||||
type : "public/blogList" |
||||
data : any |
||||
} |
||||
|
||||
interface getBlogInfo{ |
||||
type : "public/blogInfo" |
||||
data : any |
||||
} |
||||
|
||||
interface error{ |
||||
type : "error" |
||||
data : undefined |
||||
} |
||||
|
||||
interface loading{ |
||||
type : "loading" |
||||
data : undefined |
||||
} |
||||
|
||||
// interface filterNewProducts{
|
||||
|
||||
// }
|
||||
|
||||
|
||||
type PublicAction =getBlogList | getBlogInfo | getHomeData | loading | error; |
||||
|
||||
export default PublicAction; |
@ -0,0 +1,49 @@ |
||||
interface otp { |
||||
type : "public/sendOTP" |
||||
data : any |
||||
} |
||||
|
||||
interface otp_login{ |
||||
type : "user/otp/login" |
||||
data : any |
||||
} |
||||
|
||||
// interface switchRole{
|
||||
// type : "user/switchRole"
|
||||
// data : Object
|
||||
// }
|
||||
|
||||
interface logout{ |
||||
type : "user/logout" |
||||
data : any |
||||
} |
||||
|
||||
interface getUserRole{ |
||||
type : "user/getUserRole" |
||||
data : any |
||||
} |
||||
|
||||
interface getProfile{ |
||||
type : "user/getProfile" |
||||
data : any |
||||
} |
||||
|
||||
interface setProfile{ |
||||
type : "user/setProfile" |
||||
data : any |
||||
} |
||||
|
||||
interface error{ |
||||
type : "error" |
||||
data : undefined |
||||
} |
||||
|
||||
interface loading{ |
||||
type : "loading" |
||||
data : undefined |
||||
} |
||||
|
||||
|
||||
type UserAction = otp | otp_login | logout | getUserRole | getProfile | setProfile | error | loading; |
||||
|
||||
export default UserAction; |
@ -1,4 +0,0 @@ |
||||
// @create-index
|
||||
export { default as publicApi } from "./public.js"; |
||||
export { default as user } from "./user.js"; |
||||
|
@ -0,0 +1,4 @@ |
||||
// @create-index
|
||||
export { default as publicApi } from "./public"; |
||||
export { default as user } from "./user"; |
||||
|
@ -1,25 +0,0 @@ |
||||
import proxy from "../proxy"; |
||||
const publicApi = { |
||||
getHomeData: (data, history) => async (dispatch) => |
||||
await proxy.get("public/homePage", data, { history, dispatch }), |
||||
getFaqList: (data, history) => async (dispatch) => |
||||
await proxy.get("faq/list", data, { history, dispatch }), |
||||
setFaqActive: (data) => async (dispatch) => |
||||
await dispatch({ type: "public/faq/activate", data: data }), |
||||
searchFaq: (data) => async (dispatch) => |
||||
await dispatch({ type: "public/faq/search", data: data }), |
||||
getContactData: |
||||
(data = {}, history) => |
||||
async (dispatch) => |
||||
await proxy.get("public/contact", data, { history, dispatch }), |
||||
getArList: (data, history) => async (dispatch) => |
||||
await proxy.get("public/ar", data, { history, dispatch }), |
||||
getBlogList: (data, history) => async (dispatch) => |
||||
await proxy.get("public/blogList", data, { history, dispatch }), |
||||
getBlogInfo: (data, history) => async (dispatch) => |
||||
await proxy.get("public/blogInfo", data, { history, dispatch }), |
||||
filterNewProducts: (data, history) => async (dispatch) => |
||||
await dispatch({ type: "public/filter", data: data }), |
||||
}; |
||||
|
||||
export default publicApi; |
@ -0,0 +1,34 @@ |
||||
import { Dispatch } from "redux"; |
||||
import proxy from "../proxy"; |
||||
const publicApi = { |
||||
getHomeData: (data: undefined, history: any) => async (dispatch: Dispatch) => |
||||
await proxy.get("public/homePage", data, { history, dispatch }), |
||||
|
||||
// getFaqList: (data: undefined, history: any) => async (dispatch: Dispatch) =>
|
||||
// await proxy.get("faq/list", data, { history, dispatch }),
|
||||
|
||||
// setFaqActive: (data: undefined) => async (dispatch: Dispatch) =>
|
||||
// await dispatch({ type: "public/faq/activate", data: data }),
|
||||
|
||||
// searchFaq: (data: String) => async (dispatch: Dispatch) =>
|
||||
// await dispatch({ type: "public/faq/search", data: data }),
|
||||
|
||||
// getContactData:
|
||||
// (data = {}, history: any) =>
|
||||
// async (dispatch: Dispatch) =>
|
||||
// await proxy.get("public/contact", data, { history, dispatch }),
|
||||
|
||||
// getArList: (data: undefined, history: any) => async (dispatch: Dispatch) =>
|
||||
// await proxy.get("public/ar", data, { history, dispatch }),
|
||||
|
||||
getBlogList: (data: undefined, history: any) => async (dispatch: Dispatch) => |
||||
await proxy.get("public/blogList", data, { history, dispatch }), |
||||
|
||||
getBlogInfo: (data: String, history: any) => async (dispatch: Dispatch) => |
||||
await proxy.get("public/blogInfo", data, { history, dispatch }), |
||||
|
||||
// filterNewProducts: (data: Object) => async (dispatch: Dispatch) =>
|
||||
// await dispatch({ type: "public/filter", data: data }),
|
||||
}; |
||||
|
||||
export default publicApi; |
@ -1,61 +0,0 @@ |
||||
import proxy from "../proxy"; |
||||
const user = { |
||||
otp: (data, history) => async (dispatch) => |
||||
await proxy.login("public/sendOTP", data, { history, dispatch }), |
||||
// otp:
|
||||
// (data = {}) =>
|
||||
// async (dispatch) =>
|
||||
// dispatch({ type: "public/sendOTP", payload: data }),
|
||||
otp_login: (data, history) => async (dispatch) => |
||||
await proxy.login("user/otp/login", data, { history, dispatch }), |
||||
// otp_login:
|
||||
// (data = {}) =>
|
||||
// async (dispatch) =>
|
||||
// dispatch({ type: "user/otp/login", payload: data }),
|
||||
register: (data, history) => async (dispatch) => |
||||
await proxy.login("user/register", data, { history, dispatch }), |
||||
switchRole: (data, history) => async (dispatch) => |
||||
await proxy.login("user/switchRole", data, { history, dispatch }), |
||||
logout: (data, history) => async (dispatch) => |
||||
await proxy.logout("user/logout", data, { history, dispatch }), |
||||
getUserRole: (data) => async (dispatch) => |
||||
await proxy.get("user/getUserRole", data, { dispatch }), |
||||
list: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.get("user/list", data, { dispatch }), |
||||
domains: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.get("user/domains", data, { dispatch }), |
||||
getmothers: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.get2("mothers/list", data, { |
||||
dispatch, |
||||
}), |
||||
getProfile: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.get("user/getProfile", data, { dispatch }), |
||||
setProfile: |
||||
(data = {}, data2 = {}) => |
||||
async (dispatch) => { |
||||
await proxy.put("user/setProfile", data, { dispatch }); |
||||
await proxy.get("user/getProfile", data2, { dispatch }); |
||||
}, |
||||
add: |
||||
(data = {}, data2 = {}) => |
||||
async (dispatch) => { |
||||
await proxy.post("user/add", data); |
||||
await proxy.get("user/list", data2, { dispatch }); |
||||
}, |
||||
del: |
||||
(data = {}, data2 = {}) => |
||||
async (dispatch) => { |
||||
await proxy.delete("user/delete", data); |
||||
await proxy.get("user/list", data2, { dispatch }); |
||||
}, |
||||
}; |
||||
|
||||
export default user; |
@ -0,0 +1,61 @@ |
||||
import proxy from "../proxy"; |
||||
import {Dispatch} from 'redux'; |
||||
|
||||
const user = { |
||||
otp: (data : String) => async (dispatch : Dispatch) => |
||||
await proxy.login("public/sendOTP", data, { dispatch }), |
||||
|
||||
otp_login: (data : Object) => async (dispatch : Dispatch) => |
||||
await proxy.login("user/otp/login", data, { dispatch }), |
||||
|
||||
// register: (data : undefined) => async (dispatch : Dispatch) =>
|
||||
// await proxy.login("user/register", data, { dispatch }),
|
||||
|
||||
// switchRole: (data : String) => async (dispatch : Dispatch) =>
|
||||
// await proxy.login("user/switchRole", data, { dispatch }),
|
||||
|
||||
logout: (data : String) => async (dispatch : Dispatch) => |
||||
await proxy.logout("user/logout", data, { dispatch }), |
||||
|
||||
getUserRole: (data : String) => async (dispatch : Dispatch) => |
||||
await proxy.get("user/getUserRole", data, { dispatch }), |
||||
|
||||
// list:
|
||||
// (data = {}) =>
|
||||
// async (dispatch : Dispatch) =>
|
||||
// await proxy.get("user/list", data, { dispatch }),
|
||||
// domains:
|
||||
// (data = {}) =>
|
||||
// async (dispatch : Dispatch) =>
|
||||
// await proxy.get("user/domains", data, { dispatch }),
|
||||
// getmothers:
|
||||
// (data = {}) =>
|
||||
// async (dispatch : Dispatch) =>
|
||||
// await proxy.get("mothers/list", data, {
|
||||
// dispatch,
|
||||
// }),
|
||||
getProfile: |
||||
(data = {}) => |
||||
async (dispatch : Dispatch) => |
||||
await proxy.get("user/getProfile", data, { dispatch }), |
||||
setProfile: |
||||
(data = {}, data2 = {}) => |
||||
async (dispatch : Dispatch) => { |
||||
await proxy.put("user/setProfile", data, { dispatch }); |
||||
await proxy.get("user/getProfile", data2, { dispatch }); |
||||
}, |
||||
add: |
||||
(data = {}, data2 = {}) => |
||||
async (dispatch : Dispatch) => { |
||||
await proxy.post("user/add", data); |
||||
await proxy.get("user/list", data2, { dispatch }); |
||||
}, |
||||
del: |
||||
(data = {}, data2 = {}) => |
||||
async (dispatch : Dispatch) => { |
||||
await proxy.delete("user/delete", data); |
||||
await proxy.get("user/list", data2, { dispatch }); |
||||
}, |
||||
}; |
||||
|
||||
export default user; |
@ -1,3 +0,0 @@ |
||||
// @create-index
|
||||
export { default as publicApi } from "./public.js"; |
||||
export { default as user } from "./user.js"; |
@ -0,0 +1,3 @@ |
||||
// @create-index
|
||||
export { default as publicApi } from "./public"; |
||||
export { default as user } from "./user"; |
@ -1,18 +1,18 @@ |
||||
import React from "react"; |
||||
import Avatar from "@material-ui/core/Avatar"; |
||||
import {Link} from 'react-router-dom'; |
||||
import "./index.scss"; |
||||
|
||||
export default function Book(props: any) { |
||||
const { data } = props; |
||||
return ( |
||||
<article className="home-books-book d-flex flex-column"> |
||||
<img src={data.imageUrl} alt={data.name} /> |
||||
<Link to={'/'} className="home-books-book d-flex flex-column" draggable={'false'}> |
||||
<img src={data.imageUrl} alt={data.name} draggable={'false'} /> |
||||
<footer className="d-flex"> |
||||
<div className="home-books-book__info d-flex flex-column"> |
||||
<h2>{data.name}</h2> |
||||
<p>{data.text.slice(0, 50)}</p> |
||||
</div> |
||||
</footer> |
||||
</article> |
||||
</Link> |
||||
); |
||||
} |
||||
|
Loading…
Reference in new issue