parent
dd3e29fcb9
commit
f414876aae
14 changed files with 301 additions and 128 deletions
@ -0,0 +1,19 @@ |
||||
import proxy from '../proxy'; |
||||
const blog = { |
||||
list: (data = {}) => async (dispatch) => |
||||
await proxy.get('blog/list', data, { dispatch }), |
||||
update: (data = {}, data2 = {}) => async (dispatch) => { |
||||
await proxy.put('blog/update', data); |
||||
await proxy.get('blog/list', data2, { dispatch }); |
||||
}, |
||||
add: (data = {}, data2 = {}) => async (dispatch) => { |
||||
await proxy.post('blog/add', data); |
||||
await proxy.get('blog/list', data2, { dispatch }); |
||||
}, |
||||
del: (data = {}, data2 = {}) => async (dispatch) => { |
||||
await proxy.delete('blog/delete', data); |
||||
await proxy.get('blog/list', data2, { dispatch }); |
||||
}, |
||||
}; |
||||
|
||||
export default blog; |
@ -1,13 +1,35 @@ |
||||
import proxy from '../proxy'; |
||||
export const list = |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
(await proxy.get('chat/list', data)).dispatch(dispatch); |
||||
export const info = |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
(await proxy.get('chat/info', data)).dispatch(dispatch); |
||||
export const bio = |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
(await proxy.get('chat/bio', data)).dispatch(dispatch); |
||||
import proxy from "../proxy"; |
||||
const chat = { |
||||
list: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.get("chat/list", data, { dispatch }), |
||||
info: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.get("chat/info", data, { dispatch }), |
||||
bio: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.get("chat/bio", data, { dispatch }), |
||||
update: |
||||
(data = {}, data2 = {}) => |
||||
async (dispatch) => { |
||||
await proxy.put("blog/update", data); |
||||
await proxy.get("blog/list", data2, { dispatch }); |
||||
}, |
||||
add: |
||||
(data = {}, data2 = {}) => |
||||
async (dispatch) => { |
||||
await proxy.post("blog/add", data); |
||||
await proxy.get("blog/list", data2, { dispatch }); |
||||
}, |
||||
del: |
||||
(data = {}, data2 = {}) => |
||||
async (dispatch) => { |
||||
await proxy.delete("blog/delete", data); |
||||
await proxy.get("blog/list", data2, { dispatch }); |
||||
}, |
||||
}; |
||||
|
||||
export default chat; |
||||
|
@ -1,7 +1,7 @@ |
||||
// @create-index
|
||||
|
||||
export { default as chat } from './chat.js'; |
||||
export { default as message } from './message.js'; |
||||
export { default as public } from './public.js'; |
||||
// export { default as message } from './message.js';
|
||||
// export { default as public } from './public.js';
|
||||
export { default as user } from './user.js'; |
||||
|
||||
|
@ -1,9 +1,37 @@ |
||||
import proxy from '../proxy'; |
||||
export const login = |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
(await proxy.login(data)).dispatch(dispatch); |
||||
export const logout = |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
(await proxy.logout(data)).dispatch(dispatch); |
||||
const user = { |
||||
otp: (data, history) => async (dispatch) => |
||||
await proxy.login('public/sendOTP', data, { history, dispatch }), |
||||
otp_login: (data, history) => async (dispatch) => |
||||
await proxy.login('user/otp/login', data, { history, dispatch }), |
||||
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, |
||||
}), |
||||
update: (data = {}, data2 = {}) => async (dispatch) => { |
||||
await proxy.put('user/update', data); |
||||
await proxy.get('user/list', 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,25 @@ |
||||
const initialState = { |
||||
loading: false, |
||||
error: null, |
||||
list: [], |
||||
}; |
||||
export default function user(state = initialState, action) { |
||||
let { type, data } = action; |
||||
switch (type) { |
||||
case 'blog/list': |
||||
return { ...state, loading: false, list: data, error: null }; |
||||
case 'blog/update': |
||||
return { ...state, loading: false, error: null }; |
||||
case 'blog/add': |
||||
return { ...state, loading: false, error: null }; |
||||
case 'blog/delete': |
||||
return { ...state, loading: false, error: null }; |
||||
/////////////
|
||||
case 'loading': |
||||
return { ...state, loading: true }; |
||||
case 'error': |
||||
return { ...state, loading: false, error: data.message }; |
||||
default: |
||||
return state; |
||||
} |
||||
} |
@ -1,14 +1,35 @@ |
||||
import proxy from '../proxy'; |
||||
const initialState = { |
||||
isLogin: proxy.status(), |
||||
status: proxy.status(), |
||||
loading: false, |
||||
error: null, |
||||
list: null, |
||||
domains: [], |
||||
mothers: [], |
||||
}; |
||||
export default function user(state = initialState, action) { |
||||
let { type, data } = action; |
||||
switch (type) { |
||||
case 'login': |
||||
return { ...state, ...proxy.status(), islogin: proxy.status(), ...data }; |
||||
case 'logout': |
||||
return { ...state, islogin: proxy.status() }; |
||||
case 'user/login': |
||||
case 'user/register': |
||||
case 'user/otp/login': |
||||
case 'user/switchRole': |
||||
return { ...state, loading: false, status: data, error: null }; |
||||
case 'user/logout': |
||||
return { ...state, loading: false, status: proxy.status(), error: null }; |
||||
case 'user/getUserRole': |
||||
return { ...state, loading: false, userRoles: data, error: null }; |
||||
case 'user/list': |
||||
return { ...state, loading: false, list: data, error: null }; |
||||
case 'user/domains': |
||||
return { ...state, loading: false, domains: data, error: null }; |
||||
case 'mothers/list': |
||||
return { ...state, loading: false, mothers: data, error: null }; |
||||
/////////////
|
||||
case 'loading': |
||||
return { ...state, loading: true }; |
||||
case 'error': |
||||
return { ...state, loading: false, error: data.message }; |
||||
default: |
||||
return state; |
||||
} |
||||
|
@ -0,0 +1,9 @@ |
||||
export const ApiConfig = { |
||||
apiKey: 'AIzaSyBBksq-Asxq2M4Ot-75X19IyrEYJqNBPcg', |
||||
authDomain: 'dnvn.ir', |
||||
baseUrl: 'https://dnvn.ir/api/v1', |
||||
//baseUrl: 'http://localhost:3030/api/v1',
|
||||
loginURL: 'user/login', |
||||
otploginURL: 'user/otp/login', |
||||
logoutURL: 'user/logout', |
||||
}; |
@ -1,27 +1,33 @@ |
||||
import React from 'react'; |
||||
import {VideoCard} from 'material-ui-player'; |
||||
import ReactVideoJsPlayer from './React-video-js-player/index'; |
||||
import React from "react"; |
||||
import { VideoCard } from "material-ui-player"; |
||||
import ReactVideoJsPlayer from "./React-video-js-player/index"; |
||||
|
||||
import './index.scss'; |
||||
import "./index.scss"; |
||||
|
||||
|
||||
export default function VideoBox(props){ |
||||
return( |
||||
<> |
||||
{ |
||||
window.innerWidth > 1000 ?
|
||||
<div className="video-box d-flex flex-column" id="video">
|
||||
<h2 style={{fontSize: props.fontSize.desktop.content.h2 }} className="d-flex align-items-center"><span></span>{props.data.title}</h2> |
||||
<ReactVideoJsPlayer /> |
||||
</div> : null |
||||
} |
||||
{ |
||||
window.innerWidth < 1000 ?
|
||||
<div className="mobile-video-box d-flex flex-column" id="video">
|
||||
<h2 className="d-flex align-items-center"><span></span>{props.data.title}</h2> |
||||
<ReactVideoJsPlayer /> |
||||
</div> : null |
||||
}
|
||||
</> |
||||
); |
||||
export default function VideoBox(props) { |
||||
return ( |
||||
<> |
||||
{window.innerWidth > 1000 ? ( |
||||
<div className="video-box d-flex flex-column" id="video"> |
||||
<h2 |
||||
style={{ fontSize: props.fontSize.desktop.content.h2 }} |
||||
className="d-flex align-items-center" |
||||
> |
||||
<span></span> |
||||
{props.data.title} |
||||
</h2> |
||||
<ReactVideoJsPlayer /> |
||||
</div> |
||||
) : null} |
||||
{window.innerWidth < 1000 ? ( |
||||
<div className="mobile-video-box d-flex flex-column" id="video"> |
||||
<h2 className="d-flex align-items-center"> |
||||
<span></span> |
||||
{props.data.title} |
||||
</h2> |
||||
<ReactVideoJsPlayer /> |
||||
</div> |
||||
) : null} |
||||
</> |
||||
); |
||||
} |
Loading…
Reference in new issue