parent
f0e7f8005c
commit
abaa0c00e8
41 changed files with 857 additions and 290 deletions
@ -0,0 +1,40 @@ |
||||
import proxy from "../proxy"; |
||||
const comment = { |
||||
list: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.get("comment/list", data, { dispatch }), |
||||
info: |
||||
(data = {}) => |
||||
async (dispatch) => { |
||||
await proxy.get("comment/info", data, { dispatch }); |
||||
}, |
||||
add: |
||||
( |
||||
data = {}, |
||||
data2 = { |
||||
id: window.location.pathname.slice( |
||||
window.location.pathname.lastIndexOf("/") + 1, |
||||
window.location.pathname.length |
||||
), |
||||
} |
||||
) => |
||||
async (dispatch) => { |
||||
await proxy.post("comment/add", data); |
||||
await proxy.get("book/info", data2, { dispatch }); |
||||
}, |
||||
del: |
||||
(data = {}, data2 = {}) => |
||||
async (dispatch) => { |
||||
await proxy.delete("ar/delete", data); |
||||
await proxy.get("ar/list", data2, { dispatch }); |
||||
}, |
||||
update: |
||||
(data = {}, data2 = {}) => |
||||
async (dispatch) => { |
||||
await proxy.put("ar/update", data); |
||||
await proxy.get("ar/list", data2, { dispatch }); |
||||
}, |
||||
}; |
||||
|
||||
export default comment; |
@ -0,0 +1,34 @@ |
||||
import { toast } from "react-toastify"; |
||||
|
||||
const initialState = { |
||||
loading: false, |
||||
error: null, |
||||
list: null, |
||||
}; |
||||
|
||||
export default function comment(state = initialState, action) { |
||||
let { type, data } = action; |
||||
switch (type) { |
||||
case "comment/list": |
||||
return { ...state, loading: false, error: null }; |
||||
case "comment/update": |
||||
return { ...state, loading: false, error: null }; |
||||
case "comment/add": |
||||
return { ...state, loading: false, error: null }; |
||||
case "comment/delete": |
||||
return { ...state, loading: false, error: null }; |
||||
case "comment/info": |
||||
return { |
||||
...state, |
||||
loading: false, |
||||
list: data, |
||||
error: null, |
||||
}; |
||||
case "loading": |
||||
return { ...state, loading: true }; |
||||
case "error": |
||||
return { ...state, loading: false, error: data.message }; |
||||
default: |
||||
return state; |
||||
} |
||||
} |
After Width: | Height: | Size: 12 KiB |
@ -0,0 +1,45 @@ |
||||
import React from "react"; |
||||
import Breadcrumbs from "@material-ui/core/Breadcrumbs"; |
||||
import { Link } from "react-router-dom"; |
||||
|
||||
import "./index.scss"; |
||||
|
||||
function handleClick(event) { |
||||
event.preventDefault(); |
||||
console.info("You clicked a breadcrumb."); |
||||
} |
||||
|
||||
const maxDesktopSize = 1250; |
||||
const maxMobileSize = 650; |
||||
|
||||
const fontSize = { |
||||
desktop: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90, |
||||
mobile: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 25, |
||||
}; |
||||
|
||||
export default function ActiveLastBreadcrumb(props) { |
||||
const { name } = props; |
||||
return ( |
||||
<Breadcrumbs aria-label="breadcrumb"> |
||||
<Link |
||||
style={{ |
||||
fontSize: |
||||
window.innerWidth > 1000 ? fontSize.desktop : fontSize.mobile, |
||||
}} |
||||
to={"/"} |
||||
> |
||||
صفحه اصلی |
||||
</Link> |
||||
<Link |
||||
style={{ |
||||
fontSize: |
||||
window.innerWidth > 1000 ? fontSize.desktop : fontSize.mobile, |
||||
color: "#00CC69", |
||||
}} |
||||
to={"/ar"} |
||||
> |
||||
واقعیت افزوده |
||||
</Link> |
||||
</Breadcrumbs> |
||||
); |
||||
} |
@ -0,0 +1,8 @@ |
||||
.MuiBreadcrumbs-li{ |
||||
a { |
||||
text-decoration: none; |
||||
font-family: numeralLight; |
||||
color: #6F7074; |
||||
letter-spacing: -1px; |
||||
} |
||||
} |
@ -1,31 +1,45 @@ |
||||
import React, { Component } from 'react'; |
||||
import React, { Component } from "react"; |
||||
import { Link } from "react-router-dom"; |
||||
|
||||
import './index.scss'; |
||||
export default function LastQR(props){ |
||||
const {data} = props; |
||||
return( |
||||
<> |
||||
{ |
||||
window.innerWidth > 1000 ? |
||||
<div className="last-qr"> |
||||
import "./index.scss"; |
||||
|
||||
const grades = [ |
||||
"اول", |
||||
"دوم", |
||||
"سوم", |
||||
"چهارم", |
||||
"پنجم", |
||||
"ششم", |
||||
"هفتم", |
||||
"هشتم", |
||||
"نهم", |
||||
"دهم", |
||||
"یازدهم", |
||||
"دوازدهم", |
||||
]; |
||||
|
||||
</div> : null |
||||
} |
||||
{ |
||||
window.innerWidth < 1000 ? |
||||
<div className="mobile-last-qr d-flex"> |
||||
export default function LastQR(props) { |
||||
const { data } = props; |
||||
return ( |
||||
<> |
||||
{window.innerWidth > 1000 ? <div className="last-qr"></div> : null} |
||||
{window.innerWidth < 1000 ? ( |
||||
<Link to={`/qr${data.link}`} className="mobile-last-qr d-flex"> |
||||
<div className="mobile-last-qr__right d-flex"> |
||||
<img src={data.image} alt={data.title} /> |
||||
<img |
||||
src={`https://dnvn.ir/api/v1/file/${data.fileIds}`} |
||||
alt={data.name} |
||||
/> |
||||
<div className="d-flex flex-column"> |
||||
<strong>{data.title}</strong> |
||||
<span>{data.subTitle}</span> |
||||
<strong>{data.name}</strong> |
||||
<span>{grades[data.gradeId]}</span> |
||||
</div> |
||||
</div> |
||||
<div className="mobile-last-qr__left d-flex"> |
||||
<button>صفحه {data.page}</button> |
||||
<button>صفحه {data.pagesNum}</button> |
||||
</div> |
||||
</div> : null |
||||
} |
||||
</Link> |
||||
) : null} |
||||
</> |
||||
); |
||||
} |
Loading…
Reference in new issue