update 17 files

front
Reza_ashrafi 3 years ago
parent 1a9ddf94ad
commit cca48f842b
  1. 4
      src/views/Home/Download/index.js
  2. 3
      src/views/Home/HomeSearch/index.js
  3. 31
      src/views/Home/HomeSlider/Blog/index.js
  4. 24
      src/views/Home/HomeSlider/index.js
  5. 10
      src/views/Home/HomeStatic/index.js
  6. 20
      src/views/Home/Navbar/Mobile/NavbarDrawer/NavbarDrawer.js
  7. 2
      src/views/Home/Navbar/Mobile/NavbarDrawer/NavbarDrawer.scss
  8. 95
      src/views/Home/Navbar/Mobile/index.js
  9. 5
      src/views/Products/BreadCrumb/index.js
  10. 27
      src/views/Products/Filters/AppliedFilters/index.js
  11. 40
      src/views/Products/Filters/TypicalFilters/index.js
  12. 9
      src/views/Products/Filters/index.js
  13. 6
      src/views/Products/List/index.js
  14. 15
      src/views/Products/Sort/index.js
  15. 18
      src/views/Products/index.js

@ -59,7 +59,9 @@ const H_DownloadApp = () => {
<a <a
download download
href="https://danovin.ir/app.apk" href="https://danovin.ir/app.apk"
className="h-download-app-content-mobile" className={`h-download-app-content-mobile d-flex ${
window.lang === "en" ? "flex-row-reverse" : ""
}`}
> >
<div className="h-download-app-content-box2-app-img-container"> <div className="h-download-app-content-box2-app-img-container">
<img <img

@ -58,7 +58,7 @@ class HomeSearch extends Component {
<img src={dropdown} alt={window.t("فلش")} /> <img src={dropdown} alt={window.t("فلش")} />
</div> </div>
</div> </div>
<div className="home-mobile-search "> <div className="home-mobile-search">
<input <input
ref="input" ref="input"
placeholder={window.t("نام یک کتاب را جستجو کنید")} placeholder={window.t("نام یک کتاب را جستجو کنید")}
@ -71,7 +71,6 @@ class HomeSearch extends Component {
}) })
} }
/> />
<button <button
className="home-mobile-search__submit" className="home-mobile-search__submit"
style={{ float: "left" }} style={{ float: "left" }}

@ -113,12 +113,19 @@ export default class Simple extends Component {
) : null} ) : null}
{window.innerWidth < 1000 ? ( {window.innerWidth < 1000 ? (
<article <article
className="mobile-slider-blog d-flex flex-column" className={`mobile-slider-blog d-flex flex-column ${
window.lang === "en" ? "align-items-end" : ""
}`}
style={{ style={{
height: height, height: height,
}} }}
> >
<Link to={`/blogs/${data.id}`}> <Link
to={`/blogs/${data.id}`}
className={`d-flex flex-column ${
window.lang === "en" ? "align-items-end" : ""
}`}
>
{data.type === "image" ? ( {data.type === "image" ? (
<div style={{ textAlign: "center" }}> <div style={{ textAlign: "center" }}>
<img <img
@ -133,15 +140,25 @@ export default class Simple extends Component {
{data.type === "audio" ? ( {data.type === "audio" ? (
<img src={music} alt={data.title} /> <img src={music} alt={data.title} />
) : null} ) : null}
<h1>{data.title}</h1> <h1 className={`${window.lang === "en" ? "text-end" : ""}`}>
{data.title}
</h1>
<h2> <h2>
<div <div
dangerouslySetInnerHTML={{ __html: data.text }} dangerouslySetInnerHTML={{ __html: data.text }}
style={{ height: 80, overflow: "hidden" }} style={{
height: 80,
overflow: "hidden",
textAlign: window.lang === "en" ? "left" : "",
}}
></div> ></div>
</h2> </h2>
<div className="mobile-slider-blog__footer d-flex mt-3"> <div
className={`mobile-slider-blog__footer d-flex mt-3 ${
window.lang === "en" ? "flex-row-reverse" : ""
}`}
>
<div <div
className={`d-flex ${ className={`d-flex ${
window.lang === "en" ? "flex-row-reverse" : "" window.lang === "en" ? "flex-row-reverse" : ""
@ -149,7 +166,9 @@ export default class Simple extends Component {
> >
{/* <img src={} /> */} {/* <img src={} /> */}
<div <div
className="d-flex flex-column" className={`d-flex flex-column ${
window.lang === "en" ? "align-items-end" : ""
}`}
style={{ fontSize: "12px" }} style={{ fontSize: "12px" }}
> >
<span> <span>

@ -55,8 +55,16 @@ const SimpleHeader = (props) => {
</div> </div>
) : null} ) : null}
{window.innerWidth < 1000 ? ( {window.innerWidth < 1000 ? (
<div className="mobile-home-scroll__header d-flex"> <div
<div className="mobile-home-scroll__header--right d-flex"> className={`mobile-home-scroll__header d-flex ${
window.lang === "en" ? "flex-row-reverse" : ""
}`}
>
<div
className={`mobile-home-scroll__header--right d-flex ${
window.lang === "en" ? "flex-row-reverse" : ""
}`}
>
<h1>{props.title}</h1> <h1>{props.title}</h1>
<span></span> <span></span>
</div> </div>
@ -82,8 +90,16 @@ const TabHeader = (props) => {
</div> </div>
) : null} ) : null}
{window.innerWidth < 1000 ? ( {window.innerWidth < 1000 ? (
<div className="mobile-home-scroll__header d-flex"> <div
<div className="mobile-home-scroll__header--right d-flex"> className={`mobile-home-scroll__header d-flex ${
window.lang === "en" ? "flex-row-reverse" : ""
}`}
>
<div
className={`mobile-home-scroll__header--right d-flex ${
window.lang === "en" ? "flex-row-reverse" : ""
}`}
>
<h1>{props.title}</h1> <h1>{props.title}</h1>
<span></span> <span></span>
</div> </div>

@ -102,14 +102,20 @@ const Item = (props) => {
width: `${props.data.width}%`, width: `${props.data.width}%`,
height: props.height, height: props.height,
}} }}
className={"home-static__list2--item"} className={`home-static__list2--item ${
window.lang === "en" ? "d-flex" : ""
}`}
> >
<img <img
src={`https://dnvn.ir/api/v1/file/${props.data.fileId}`} src={`https://dnvn.ir/api/v1/file/${props.data.fileId}`}
alt={window.t("عکس")} alt={window.t("عکس")}
style={{ float: "left" }} style={{ float: "left" }}
/> />
<div className="d-flex flex-column"> <div
className={`d-flex flex-column ${
window.lang === "en" ? "align-items-end" : ""
}`}
>
<h2 style={{ color: "#02733c", fontSize: 12 }}> <h2 style={{ color: "#02733c", fontSize: 12 }}>
{props.data.topText} {props.data.topText}
</h2> </h2>

@ -169,7 +169,11 @@ class NavbarDrawer extends Component {
let score = 2; let score = 2;
return ( return (
<div className="navbar-drawer d-flex flex-column"> <div
className={`navbar-drawer d-flex flex-column ${
window.lang === "en" ? "align-items-end" : ""
}`}
>
{statusx ? ( {statusx ? (
<div className="navbar-drawer__header d-flex align-items-center"> <div className="navbar-drawer__header d-flex align-items-center">
<> <>
@ -218,7 +222,11 @@ class NavbarDrawer extends Component {
</div> </div>
) : null} ) : null}
{this.state.dropdown ? ( {this.state.dropdown ? (
<div className="navbar-drawer__dropdown d-flex flex-column"> <div
className={`navbar-drawer__dropdown d-flex flex-column ${
window.lang === "en" ? "align-items-start" : ""
}`}
>
{/* {this.props.users.map((item, i) => ( {/* {this.props.users.map((item, i) => (
<User data={item} key={i} /> <User data={item} key={i} />
))} */} ))} */}
@ -247,9 +255,13 @@ class NavbarDrawer extends Component {
(() => (item.link === "" ? toast.error(item.toast) : null)) (() => (item.link === "" ? toast.error(item.toast) : null))
} }
> >
<div className="navbar-drawer__bottom--link d-flex"> <div
className={`navbar-drawer__bottom--link d-flex align-items-center ${
window.lang === "en" ? "flex-row-reverse" : ""
}`}
>
{item.icon} {item.icon}
<div>{item.name}</div> <div style={{ margin: "0px 10px" }}>{item.name}</div>
{item.message && <div class="badge">{item.message}</div>} {item.message && <div class="badge">{item.message}</div>}
</div> </div>
</Link> </Link>

@ -90,7 +90,7 @@
& img { & img {
width: 20px; width: 20px;
height: 20px; height: 20px;
margin-left: 20px; // margin-left: 20px;
} }
& .badge { & .badge {
background-color: red; background-color: red;

@ -86,56 +86,75 @@ export default function MobileNavbar(props) {
); );
if (!status) if (!status)
return ( return (
<nav className="mobile-navbar d-flex"> <nav
className={`mobile-navbar d-flex ${
window.lang === "en" ? "flex-row-reverse" : ""
}`}
style={{ width: "100%" }}
>
<div <div
className={`d-flex ${window.lang === "en" ? "flex-row-reverse" : ""}`} className={`d-flex justify-content-between align-items-center ${
window.lang === "en" ? "flex-row-reverse" : ""
}`}
style={{ width: "100%" }}
> >
<div <div
className="mobile-navbar__menu" className="mobile-navbar__menu"
style={{ marginTop: 10 }} // style={{ marginTop: 10 }}
onClick={toggleDrawer("right", true)} onClick={toggleDrawer("right", true)}
> >
<img src={hamburger} alt={window.t("منو")} /> <img src={hamburger} alt={window.t("منو")} />
{/* <Link to="/" className="mobile-navbar__logo2" style={{}}>
<img src={logo} alt={window.t("لوگو")} className="logo" />
</Link> */}
</div> </div>
<Link to="/" className="mobile-navbar__logo2" style={{}}> <div
<img src={logo} alt={window.t("لوگو")} className="logo" /> className={`d-flex align-items-center ${
</Link> window.lang === "en" ? "flex-row-reverse" : ""
</div> }`}
<div className="mobile-navbar__left d-flex" style={{ marginLeft: 10 }}>
<select
className="language-select"
onChange={(e) => {
window.localStorage.setItem("language", e.target.value);
window.location.reload();
}}
>
{[
{ key: "فارسی", lang: "fa", default: true },
{ key: "English", lang: "en" },
{ key: "العربیه", lang: "ar" },
].map((el, index) => (
<option
key={el.lang}
value={el.lang}
selected={
(!window.lang && el.default) || el.lang == window.lang
}
>
{el.key}
</option>
))}
</select>
<Link
style={{ fontSize: 12 }}
to={"/auth"}
className="mobile-navbar__signup"
> >
{window.t("ورود یا ثبتنام")} <select
</Link> className="language-select"
onChange={(e) => {
window.localStorage.setItem("language", e.target.value);
window.location.reload();
}}
>
{[
{ key: "فارسی", lang: "fa", default: true },
{ key: "English", lang: "en" },
{ key: "العربیه", lang: "ar" },
].map((el, index) => (
<option
key={el.lang}
value={el.lang}
selected={
(!window.lang && el.default) || el.lang == window.lang
}
>
{el.key}
</option>
))}
</select>
<Link
style={{ fontSize: 12, padding: "8px 5px" }}
to={"/auth"}
className="mobile-navbar__signup"
>
{window.t("ورود یا ثبتنام")}
</Link>
</div>
</div>
<div
className={`mobile-navbar__left d-flex ${
window.lang === "en" ? "flex-row-reverse" : ""
}`}
style={{ marginLeft: 10 }}
>
{page !== "home" ? <BackButton /> : null} {page !== "home" ? <BackButton /> : null}
</div> </div>
<SwipeableDrawer <SwipeableDrawer
anchor="right" anchor={window.lang === "en" ? "left" : "right"}
open={state["right"]} open={state["right"]}
onClose={toggleDrawer("right", false)} onClose={toggleDrawer("right", false)}
onOpen={toggleDrawer("right", true)} onOpen={toggleDrawer("right", true)}

@ -13,7 +13,10 @@ const fontSize = {
export default function ActiveLastBreadcrumb() { export default function ActiveLastBreadcrumb() {
return ( return (
<Breadcrumbs aria-label="breadcrumb"> <Breadcrumbs
aria-label="breadcrumb"
style={{ direction: window.lang === "en" ? "ltr" : "" }}
>
<Link <Link
to={"/"} to={"/"}
style={{ style={{

@ -32,14 +32,35 @@ export default class AppliedFilters extends React.Component {
render() { render() {
const { data } = this.props; const { data } = this.props;
return ( return (
<div className="products-filters-applied d-flex flex-column"> <div
<header className="products-filters-applied__header d-flex align-items-center"> className={`products-filters-applied d-flex flex-column ${
window.lang === "en" ? "align-items-start" : ""
}`}
style={{
width: "100%",
}}
>
<header
className={`products-filters-applied__header d-flex align-items-center ${
window.lang === "en" ? "flex-row-reverse" : ""
}`}
style={{
width: "100%",
}}
>
<span></span> <span></span>
<h2 style={{ fontSize: fontSize.h2 }}> <h2 style={{ fontSize: fontSize.h2 }}>
{window.t("فیلترهای اعمال شده")} {window.t("فیلترهای اعمال شده")}
</h2> </h2>
</header> </header>
<div className="products-filters-applied__items d-flex flex-wrap"> <div
className={`products-filters-applied__items d-flex flex-wrap ${
window.lang === "en" ? "flex-row-reverse" : ""
}`}
style={{
width: "100%",
}}
>
{data.level.map((item, i) => ( {data.level.map((item, i) => (
<Item name={"level"} data={item} key={i} parent={this} /> <Item name={"level"} data={item} key={i} parent={this} />
))} ))}

@ -36,12 +36,36 @@ export default class TypicalFilters extends React.Component {
render() { render() {
const { data, title, theme } = this.props; const { data, title, theme } = this.props;
return ( return (
<div className="products-filters-typical d-flex flex-column"> <div
<header className="products-filters-typical__header d-flex align-items-center"> className={`products-filters-typical d-flex flex-column ${
<span style={{ background: theme }}></span> window.lang === "en" ? "align-items-end" : ""
}`}
style={{
width: "100%",
}}
>
<header
className={`products-filters-typical__header d-flex align-items-center ${
window.lang === "en" ? "flex-row-reverse" : ""
}`}
>
<span
style={{
background: theme,
marginLeft: window.lang === "en" ? "" : 5,
marginRight: window.lang === "en" ? 5 : "",
}}
></span>
<h2 style={{ fontSize: 15 }}>{title}</h2> <h2 style={{ fontSize: 15 }}>{title}</h2>
</header> </header>
<div className="products-filters-typical__items d-flex flex-column"> <div
className={`products-filters-typical__items d-flex flex-column ${
window.lang === "en" ? "align-items-end" : ""
}`}
style={{
width: window.lang === "en" ? "90%" : "auto",
}}
>
{data.map((item, i) => ( {data.map((item, i) => (
<Item data={item} key={i} parent={this} /> <Item data={item} key={i} parent={this} />
))} ))}
@ -72,7 +96,11 @@ const Item = (props) => {
return available; return available;
}; };
return ( return (
<div className="d-flex align-items-center mt-2"> <div
className={`d-flex align-items-center mt-2 ${
window.lang === "en" ? "flex-row-reverse" : ""
}`}
>
<FormControlLabel <FormControlLabel
control={ control={
<Checkbox <Checkbox
@ -84,7 +112,7 @@ const Item = (props) => {
checked={checkHandler(data, parent.props.name)} checked={checkHandler(data, parent.props.name)}
onChange={() => parent.onChange(parent.props.name, data)} onChange={() => parent.onChange(parent.props.name, data)}
/> />
<strong style={{ fontSize: 15 }}>{data}</strong> <strong style={{ fontSize: 15, margin: "0px 10px" }}>{data}</strong>
</div> </div>
); );
}; };

@ -8,7 +8,14 @@ export default class Filtesrs extends React.Component {
render() { render() {
const { parent } = this.props; const { parent } = this.props;
return ( return (
<div className="products-filters d-flex flex-column"> <div
className={`products-filters d-flex flex-column ${
window.lang === "en" ? "align-items-end" : ""
}`}
style={{
width: "100%",
}}
>
{parent.state.selectedFilters.level.length !== 0 || {parent.state.selectedFilters.level.length !== 0 ||
parent.state.selectedFilters.subject.length !== 0 ? ( parent.state.selectedFilters.subject.length !== 0 ? (
<AppliedFiltesrs <AppliedFiltesrs

@ -16,7 +16,11 @@ class List extends React.Component {
let { filterResult, loading } = this.props; let { filterResult, loading } = this.props;
return window.innerWidth > 1000 ? ( return window.innerWidth > 1000 ? (
<div className="products-list d-flex flex-wrap"> <div
className={`products-list d-flex flex-wrap ${
window.lang === "en" ? "flex-row-reverse" : ""
}`}
>
{!loading ? ( {!loading ? (
filterResult?.length > 0 ? ( filterResult?.length > 0 ? (
(Array.isArray(filterResult) ? filterResult : []).map((item, i) => ( (Array.isArray(filterResult) ? filterResult : []).map((item, i) => (

@ -14,12 +14,23 @@ export default class Sort extends React.Component {
render() { render() {
const { parent, selectedSort } = this.props; const { parent, selectedSort } = this.props;
return ( return (
<div className="products-sort d-flex align-items-center"> <div
className={`products-sort d-flex align-items-center ${
window.lang === "en" ? "flex-row-reverse" : ""
}`}
style={{
width: window.lang === "en" ? "100%" : "",
}}
>
<SortIcon style={{ fontSize: 30, color: "#A5A5A5", marginLeft: 10 }} /> <SortIcon style={{ fontSize: 30, color: "#A5A5A5", marginLeft: 10 }} />
<span style={{ fontSize: fontSize.span }}> <span style={{ fontSize: fontSize.span }}>
{window.t("مرتب سازی بر اساس")} {window.t("مرتب سازی بر اساس")}
</span> </span>
<ul className="d-flex align-items-center mr-2"> <ul
className={`d-flex align-items-center mr-2 ${
window.lang === "en" ? "flex-row-reverse" : ""
}`}
>
{parent.props.sortItems.map((item, i) => ( {parent.props.sortItems.map((item, i) => (
<Item <Item
data={item} data={item}

@ -64,14 +64,26 @@ class Products extends Component {
<> <>
{window.innerWidth > 1000 ? ( {window.innerWidth > 1000 ? (
<> <>
<div className="products d-flex flex-column"> <div
className={`products d-flex flex-column ${
window.lang === "en" ? "align-items-end" : ""
}`}
>
<Navbar page={"products"} /> <Navbar page={"products"} />
<Breadcrumbs /> <Breadcrumbs />
<div className="products__body d-flex"> <div
className={`products__body d-flex ${
window.lang === "en" ? "flex-row-reverse" : ""
}`}
>
{this.props.subjects.length > 0 ? ( {this.props.subjects.length > 0 ? (
<Filters parent={this} /> <Filters parent={this} />
) : null} ) : null}
<div className="products__body--left d-flex flex-column"> <div
className={`products__body--left d-flex flex-column ${
window.lang === "en" ? "align-items-end" : ""
}`}
>
<Sort <Sort
parent={this} parent={this}
selectedSort={this.state.selectedFilters.sort} selectedSort={this.state.selectedFilters.sort}

Loading…
Cancel
Save