parent
94e8caa1ee
commit
1e1842d4fe
22 changed files with 415 additions and 1014 deletions
@ -1,3 +1,7 @@ |
|||||||
import proxy from '../proxy'; |
import proxy from "../proxy"; |
||||||
export const otp = (data) => async (dispatch) => |
const publicApi = { |
||||||
(await proxy.get('public/otp', data)).dispatch(dispatch); |
getHomeData: (data, history) => async (dispatch) => |
||||||
|
await proxy.get("public/homePage", data, { history, dispatch }), |
||||||
|
}; |
||||||
|
|
||||||
|
export default publicApi; |
||||||
|
Binary file not shown.
Binary file not shown.
@ -1,74 +1,96 @@ |
|||||||
import React, { Component } from 'react'; |
import React, { Component } from "react"; |
||||||
import {Link} from 'react-router-dom'; |
import { Link } from "react-router-dom"; |
||||||
|
|
||||||
import './index.scss'; |
import "./index.scss"; |
||||||
|
|
||||||
const maxDesktopSize = 1250; |
const maxDesktopSize = 1250; |
||||||
|
|
||||||
const fontSize = { |
const fontSize = { |
||||||
desktop : { |
desktop: { |
||||||
h1: window.innerWidth > maxDesktopSize ? 20 : window.innerWidth / 80, |
h1: window.innerWidth > maxDesktopSize ? 20 : window.innerWidth / 80, |
||||||
h2: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 95, |
h2: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 95, |
||||||
span: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 110, |
span: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 110, |
||||||
a: window.innerWidth > maxDesktopSize ? 15 : window.innerWidth / 90, |
a: window.innerWidth > maxDesktopSize ? 15 : window.innerWidth / 90, |
||||||
} |
}, |
||||||
} |
}; |
||||||
export default class Simple extends Component { |
export default class Simple extends Component { |
||||||
render() { |
render() { |
||||||
const { height, data } = this.props; |
const { height, data } = this.props; |
||||||
return( |
return ( |
||||||
<> |
<> |
||||||
{ |
{window.innerWidth > 1000 ? ( |
||||||
window.innerWidth > 1000 ?
|
<article |
||||||
<article className="slider-blog d-flex flex-column"
|
className="slider-blog d-flex flex-column" |
||||||
style={{ |
style={{ |
||||||
height: height, |
height: height, |
||||||
}}> |
}} |
||||||
<div> |
> |
||||||
<img src={data.image} alt={data.title} /> |
<Link to={data.link}> |
||||||
<h1 style={{ fontSize: fontSize.desktop.h1 }}>{data.title}</h1> |
<img |
||||||
<h2 style={{ fontSize: fontSize.desktop.h2 }}>{data.subTitle}</h2> |
src={`https://dnvn.ir/api/v1/file/${data.fileId}`} |
||||||
<div className="slider-blog__footer d-flex mt-3"> |
alt={data.title} |
||||||
<div className="d-flex"> |
/> |
||||||
{/* <img src={} /> */} |
<h1 style={{ fontSize: fontSize.desktop.h1 }}>{data.title}</h1> |
||||||
<div className="d-flex flex-column"> |
<h2 style={{ fontSize: fontSize.desktop.h2 }}>{data.subTitle}</h2> |
||||||
<span style={{ fontSize: fontSize.desktop.span }}>مطالعه کامل در {data.duration}</span> |
<div className="slider-blog__footer d-flex mt-3"> |
||||||
<span style={{ fontSize: fontSize.desktop.span }}>تاریخ انتشار {data.data}</span> |
<div className="d-flex"> |
||||||
</div> |
{/* <img src={} /> */} |
||||||
|
<div className="d-flex flex-column"> |
||||||
|
<span style={{ fontSize: fontSize.desktop.span }}> |
||||||
|
مطالعه کامل در {data.duration} |
||||||
|
</span> |
||||||
|
<span style={{ fontSize: fontSize.desktop.span }}> |
||||||
|
تاریخ انتشار {data.data} |
||||||
|
</span> |
||||||
</div> |
</div> |
||||||
<Link style={{ fontSize: fontSize.desktop.a }} to={data.link}>{data.buttonText}</Link> |
|
||||||
</div> |
</div> |
||||||
<span className="slider-blog__category" style={{backgroundColor: data.category.color, fontSize: fontSize.desktop.span}}>{data.category.name}</span> |
<Link style={{ fontSize: fontSize.desktop.a }} to={data.link}> |
||||||
|
{data.buttonText} |
||||||
|
</Link> |
||||||
</div> |
</div> |
||||||
</article> : null |
<span |
||||||
} |
className="slider-blog__category" |
||||||
{ |
style={{ |
||||||
window.innerWidth < 1000 ?
|
backgroundColor: data.category.color, |
||||||
<article className="mobile-slider-blog d-flex flex-column"
|
fontSize: fontSize.desktop.span, |
||||||
|
}} |
||||||
|
> |
||||||
|
{data.category.name} |
||||||
|
</span> |
||||||
|
</Link> |
||||||
|
</article> |
||||||
|
) : null} |
||||||
|
{window.innerWidth < 1000 ? ( |
||||||
|
<article |
||||||
|
className="mobile-slider-blog d-flex flex-column" |
||||||
style={{ |
style={{ |
||||||
height: height, |
height: height, |
||||||
}}> |
}} |
||||||
<div> |
> |
||||||
<img src={data.image} alt={data.title} /> |
<Link to={data.link}> |
||||||
<h1>{data.title}</h1> |
<img src={data.image} alt={data.title} /> |
||||||
<h2>{data.subTitle}</h2> |
<h1>{data.title}</h1> |
||||||
<div className="mobile-slider-blog__footer d-flex mt-3"> |
<h2>{data.subTitle}</h2> |
||||||
<div className="d-flex"> |
<div className="mobile-slider-blog__footer d-flex mt-3"> |
||||||
{/* <img src={} /> */} |
<div className="d-flex"> |
||||||
<div className="d-flex flex-column"> |
{/* <img src={} /> */} |
||||||
<span>مطالعه کامل در {data.duration}</span> |
<div className="d-flex flex-column"> |
||||||
<span>تاریخ انتشار {data.data}</span> |
<span>مطالعه کامل در {data.duration}</span> |
||||||
</div> |
<span>تاریخ انتشار {data.data}</span> |
||||||
</div> |
</div> |
||||||
<Link to={data.link}>{data.buttonText}</Link> |
|
||||||
</div> |
</div> |
||||||
<span className="mobile-slider-blog__category" style={{backgroundColor: data.category.color}}>{data.category.name}</span> |
<Link to={data.link}>{data.buttonText}</Link> |
||||||
</div> |
</div> |
||||||
</article> : null |
<span |
||||||
} |
className="mobile-slider-blog__category" |
||||||
|
style={{ backgroundColor: data.category.color }} |
||||||
|
> |
||||||
|
{data.category.name} |
||||||
|
</span> |
||||||
|
</Link> |
||||||
|
</article> |
||||||
|
) : null} |
||||||
</> |
</> |
||||||
|
|
||||||
|
|
||||||
); |
); |
||||||
} |
} |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue