@ -0,0 +1,31 @@ |
||||
import proxy from "../proxy"; |
||||
const userProduct = { |
||||
list: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.get("userProduct/list", data, { dispatch }), |
||||
info: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.get("userProduct/info", data, { dispatch }), |
||||
update: |
||||
(data = {}, data2 = {}) => |
||||
async (dispatch) => { |
||||
await proxy.put("userProduct/update", data); |
||||
await proxy.get("userProduct/list", data2, { dispatch }); |
||||
}, |
||||
add: |
||||
(data = {}, data2 = {}) => |
||||
async (dispatch) => { |
||||
await proxy.post("userProduct/add", data); |
||||
await proxy.get("userProduct/list", data2, { dispatch }); |
||||
}, |
||||
del: |
||||
(data = {}, data2 = {}) => |
||||
async (dispatch) => { |
||||
await proxy.delete("userProduct/delete", data); |
||||
await proxy.get("userProduct/list", data2, { dispatch }); |
||||
}, |
||||
}; |
||||
|
||||
export default userProduct; |
@ -0,0 +1,28 @@ |
||||
const initialState = { |
||||
loading: false, |
||||
error: null, |
||||
list: null, |
||||
info: null, |
||||
}; |
||||
export default function userProduct(state = initialState, action) { |
||||
let { type, data } = action; |
||||
switch (type) { |
||||
case "userProduct/list": |
||||
return { ...state, loading: false, list: data, error: null }; |
||||
case "userProduct/info": |
||||
return { ...state, loading: false, list: null, info: data, error: null }; |
||||
case "userProduct/update": |
||||
return { ...state, loading: false, error: null }; |
||||
case "userProduct/add": |
||||
return { ...state, loading: false, error: null }; |
||||
case "userProduct/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; |
||||
} |
||||
} |
After Width: | Height: | Size: 102 KiB |
After Width: | Height: | Size: 106 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 59 KiB |
After Width: | Height: | Size: 82 KiB |
After Width: | Height: | Size: 83 KiB |
@ -0,0 +1,4 @@ |
||||
//comment modal
|
||||
//comment for book or bookPage
|
||||
//user can edit self comment
|
||||
//trophy
|
@ -0,0 +1,92 @@ |
||||
import React from "react"; |
||||
import AddAPhotoIcon from "@material-ui/icons/AddAPhoto"; |
||||
|
||||
import "./index.scss"; |
||||
|
||||
const maxDesktopSize = 1250; |
||||
const maxMobileSize = 550; |
||||
|
||||
const fontSize = { |
||||
desktop: { |
||||
span: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 80, |
||||
}, |
||||
mobile: { |
||||
span: window.innerWidth > maxMobileSize ? 14 : window.innerWidth / 30, |
||||
}, |
||||
}; |
||||
|
||||
export default function Document(props) { |
||||
const { parent, name } = props; |
||||
return ( |
||||
<> |
||||
{window.innerWidth < 1000 ? ( |
||||
<div className="mobile-auth-profile__document d-flex justify-content-center align-items-center mb-3"> |
||||
{parent.state.docFileIds === "" ? ( |
||||
<> |
||||
<input |
||||
type="file" |
||||
// parent.onChange(e.target.name, e.target.value)
|
||||
name={name} |
||||
onChange={(e) => |
||||
parent.onChange(e.target.name, e.target.files[0]) |
||||
} |
||||
/> |
||||
<span style={{ fontSize: fontSize.mobile.span }}> |
||||
گواهی تدریس خود را آپلود کنید. |
||||
</span> |
||||
</> |
||||
) : ( |
||||
<> |
||||
<input |
||||
type="file" |
||||
name="file" |
||||
onChange={(e) => |
||||
parent.onChange(e.target.name, e.target.files[0]) |
||||
} |
||||
/> |
||||
<span style={{ color: "rgb(18,140,126)" }}> |
||||
{parent.state.docFileIds.name} |
||||
</span> |
||||
{/* <img src={parent.state.file} alt={"کاربر"} /> */} |
||||
</> |
||||
)} |
||||
</div> |
||||
) : null} |
||||
{window.innerWidth > 1000 ? ( |
||||
<div className="auth-profile__upload d-flex justify-content-center-align-items-center"> |
||||
{parent.state.file === null ? ( |
||||
<> |
||||
<input |
||||
label={props.label} |
||||
onChange={(e) => parent.onChange(e.target.name, e.target.value)} |
||||
name={props.name} |
||||
defaultValue="" |
||||
type="file" |
||||
/> |
||||
<AddAPhotoIcon |
||||
style={{ |
||||
width: 40, |
||||
height: 40, |
||||
color: "grey", |
||||
position: "absolute", |
||||
left: "calc(50% - 20px)", |
||||
top: "calc(50% - 20px)", |
||||
}} |
||||
/> |
||||
</> |
||||
) : ( |
||||
<> |
||||
<input |
||||
label={props.label} |
||||
onChange={(e) => parent.onChange(e.target.name, e.target.value)} |
||||
name={props.name} |
||||
defaultValue="" |
||||
type="file" |
||||
/> |
||||
</> |
||||
)} |
||||
</div> |
||||
) : null} |
||||
</> |
||||
); |
||||
} |
@ -0,0 +1,28 @@ |
||||
.mobile-auth-profile { |
||||
&__document { |
||||
margin: 10px auto; |
||||
width: 100%; |
||||
height: 50px; |
||||
border-radius: 10px; |
||||
border: 2px dashed rgb(209, 209, 209); |
||||
position: relative; |
||||
input { |
||||
width: 100%; |
||||
height: 100%; |
||||
position: absolute; |
||||
left: 0px; |
||||
top: 0px; |
||||
opacity: 0; |
||||
} |
||||
img { |
||||
width: 100%; |
||||
height: 100%; |
||||
object-fit: cover; |
||||
border-radius: 50%; |
||||
} |
||||
span { |
||||
color: #afafaf; |
||||
font-family: numeralLight; |
||||
} |
||||
} |
||||
} |
@ -1,75 +0,0 @@ |
||||
.mybooks { |
||||
width: 100vw; |
||||
max-width: 1250px; |
||||
margin: 0px auto; |
||||
padding: 0px 10px; |
||||
direction: rtl; |
||||
min-height: calc(100vh - 288px); |
||||
padding-top: 100px; |
||||
} |
||||
|
||||
.mobile-mybooks { |
||||
width: 100vw; |
||||
max-width: 600px; |
||||
margin: 0px auto; |
||||
padding: 0px; |
||||
direction: rtl; |
||||
overflow-x: hidden; |
||||
padding-top: 70px; |
||||
h1 { |
||||
padding: 0px 10px; |
||||
font-family: numeralBold; |
||||
color: #6f7074; |
||||
margin-bottom: 10px; |
||||
} |
||||
&__item { |
||||
margin: 10px auto; |
||||
height: calc(100vh - 200px); |
||||
max-height: 470px; |
||||
background-color: #fafafa; |
||||
border-radius: 0.5rem; |
||||
box-shadow: 0 3px 8px 0 rgb(0 0 0 / 16%); |
||||
margin-bottom: 20px; |
||||
h1 { |
||||
font-family: numeralMedium; |
||||
color: #6f7074; |
||||
margin-bottom: 10px; |
||||
} |
||||
& img { |
||||
height: 60%; |
||||
width: 80%; |
||||
min-height: 250px; |
||||
max-height: 290px; |
||||
border-radius: 10px; |
||||
margin: 20px auto; |
||||
// max-height: 320px; |
||||
// margin: 20px 40px; |
||||
} |
||||
&--buttons { |
||||
// padding: 5px 9px; |
||||
width: 80%; |
||||
margin: 0px auto; |
||||
a { |
||||
text-decoration: none; |
||||
width: 100%; |
||||
padding: 8px; |
||||
font-family: numeralMedium; |
||||
margin-bottom: 10px; |
||||
border-radius: 10px; |
||||
text-align: center; |
||||
position: relative; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: space-between; |
||||
margin: 10px 5px; |
||||
img { |
||||
position: absolute; |
||||
top: calc(50% - 8px); |
||||
left: 5px; |
||||
width: 20px; |
||||
height: 20px; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |