update 6 files

front
Reza_ashrafi 3 years ago
parent cca48f842b
commit 8477e18551
  1. 63
      src/views/Product/AddToCart/index.js
  2. 5
      src/views/Product/BreadCrumb/index.js
  3. 2
      src/views/Product/Comment/index.js
  4. 17
      src/views/Product/Gallery/index.js
  5. 6
      src/views/Product/Info/index.js
  6. 18
      src/views/Product/index.js

@ -53,9 +53,23 @@ function AddToCart(props) {
return ( return (
<> <>
{window.innerWidth > 1000 ? ( {window.innerWidth > 1000 ? (
<section className="product-addtocart d-flex flex-column"> <section
<div className="product-addtocart__box d-flex flex-column"> className={`product-addtocart d-flex flex-column ${
<div className="product-addtocart__box--price d-flex "> window.lang === "en" ? "align-items-end" : ""
}`}
style={{
width: window.lang === "en" ? "100%" : "",
}}
>
<div
className={`product-addtocart__box d-flex flex-column ${
window.lang === "en" ? "align-items-end" : ""
}`}
style={{
width: window.lang === "en" ? "100%" : "",
}}
>
<div className="product-addtocart__box--price d-flex">
<div <div
style={{ fontSize: fontSize.desktop.div, width: "100%" }} style={{ fontSize: fontSize.desktop.div, width: "100%" }}
className="flex-column" className="flex-column"
@ -86,7 +100,7 @@ function AddToCart(props) {
// href={file(sampleFileId)} // href={file(sampleFileId)}
// target="_blank" // target="_blank"
// rel="noopener noreferrer" // rel="noopener noreferrer"
style={{ fontSize: fontSize.desktop.button }} style={{ fontSize: fontSize.desktop.button, width: "100%" }}
className="product-addtocart__box--sampleButton" className="product-addtocart__box--sampleButton"
> >
{window.t("مشاهده نمونه کتاب")} <img src={document_red} alt="" /> {window.t("مشاهده نمونه کتاب")} <img src={document_red} alt="" />
@ -103,14 +117,18 @@ function AddToCart(props) {
// window.location.pathname.length // window.location.pathname.length
// )}` // )}`
// }`} // }`}
style={{ fontSize: fontSize.desktop.button, opacity: 0.3 }} style={{
fontSize: fontSize.desktop.button,
opacity: 0.3,
width: "100%",
}}
className="product-addtocart__box--digitalButton" className="product-addtocart__box--digitalButton"
> >
{page === "digital" ? "کتاب چاپی" : window.t("نسخه الکترونیک")} {page === "digital" ? "کتاب چاپی" : window.t("نسخه الکترونیک")}
<img src={ebook_blue} alt="" /> <img src={ebook_blue} alt="" />
</Link> </Link>
<button <button
style={{ fontSize: fontSize.desktop.button }} style={{ fontSize: fontSize.desktop.button, width: "100%" }}
className="product-addtocart__box--addButton" className="product-addtocart__box--addButton"
onClick={() => { onClick={() => {
if (proxy.status()) if (proxy.status())
@ -137,8 +155,16 @@ function AddToCart(props) {
> >
{window.t("افزودن به سبد خرید")} <img src={basket_white} alt="" /> {window.t("افزودن به سبد خرید")} <img src={basket_white} alt="" />
</button> </button>
<div className="product-addtocart__box--accept d-flex"> <div
<input type="checkbox" checked={true} /> className={`product-addtocart__box--accept d-flex align-items-center ${
window.lang === "en" ? "flex-row-reverse" : ""
}`}
>
<input
type="checkbox"
checked={true}
style={{ marginRight: window.lang === "en" ? 5 : "" }}
/>
<Link <Link
to="/page/privacy" to="/page/privacy"
style={{ fontSize: "13px", margin: 0, padding: 0 }} style={{ fontSize: "13px", margin: 0, padding: 0 }}
@ -148,8 +174,16 @@ function AddToCart(props) {
)} )}
</Link> </Link>
</div> </div>
<div className="product-addtocart__box--accept d-flex"> <div
<input type="checkbox" checked={true} /> className={`product-addtocart__box--accept d-flex align-items-center ${
window.lang === "en" ? "flex-row-reverse" : ""
}`}
>
<input
type="checkbox"
checked={true}
style={{ marginRight: window.lang === "en" ? 5 : "" }}
/>
<Link <Link
to="/page/returning" to="/page/returning"
style={{ fontSize: "13px", margin: 0, padding: 0 }} style={{ fontSize: "13px", margin: 0, padding: 0 }}
@ -158,9 +192,14 @@ function AddToCart(props) {
</Link> </Link>
</div> </div>
</div> </div>
<footer className="product-addtocart__footer d-flex justify-content-between mt-3"> <footer
className="product-addtocart__footer d-flex justify-content-between mt-3"
style={{
width: window.lang === "en" ? "100%" : "",
}}
>
{supportItems.map((item, i) => ( {supportItems.map((item, i) => (
<div className="d-flex flex-column align-items-center" key={i}> <div className={`d-flex flex-column align-items-center`} key={i}>
<img src={item.icon} alt={item.name} /> <img src={item.icon} alt={item.name} />
<h2 style={{ fontSize: fontSize.desktop.h2 }}>{item.title}</h2> <h2 style={{ fontSize: fontSize.desktop.h2 }}>{item.title}</h2>
</div> </div>

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

@ -24,7 +24,7 @@ export default function Comment(props) {
return ( return (
<> <>
{window.innerWidth < 1000 ? ( {window.innerWidth < 1000 ? (
<div className="mobile-comment d-flex flex-column"> <div className={`mobile-comment d-flex flex-column`}>
<strong style={{ fontSize: fontSize.mobile.strong }}> <strong style={{ fontSize: fontSize.mobile.strong }}>
{comment.username} {comment.username}
</strong> </strong>

@ -12,7 +12,11 @@ export default function Gallery(props) {
return ( return (
<> <>
{window.innerWidth > 1000 ? ( {window.innerWidth > 1000 ? (
<section className="product-gallery d-flex flex-column"> <section
className={`product-gallery d-flex flex-column ${
window.lang === "en" ? "align-items-end" : ""
}`}
>
<div className="product-gallery__top"> <div className="product-gallery__top">
{selectedMedia ? ( {selectedMedia ? (
<> <>
@ -26,7 +30,11 @@ export default function Gallery(props) {
</> </>
) : null} ) : null}
</div> </div>
<div className="product-gallery__list d-flex"> <div
className={`product-gallery__list d-flex ${
window.lang === "en" ? "flex-row-reverse" : ""
}`}
>
{props.gallery.length > 3 ? ( {props.gallery.length > 3 ? (
<> <>
<Item <Item
@ -88,7 +96,10 @@ const Item = (props) => {
className="product-gallery-item d-flex" className="product-gallery-item d-flex"
> >
{item.type === "image" ? ( {item.type === "image" ? (
<img src={`https://dnvn.ir/api/v1/file/${item.id}`} alt={window.t("عکس")} /> <img
src={`https://dnvn.ir/api/v1/file/${item.id}`}
alt={window.t("عکس")}
/>
) : null} ) : null}
{item.type === "film" ? ( {item.type === "film" ? (
<Video fileId={`https://dnvn.ir/api/v1/file/${item.id}`} /> <Video fileId={`https://dnvn.ir/api/v1/file/${item.id}`} />

@ -16,7 +16,11 @@ export default function Info(props) {
return ( return (
<> <>
{window.innerWidth > 1000 ? ( {window.innerWidth > 1000 ? (
<section className="product-info d-flex flex-column"> <section
className={`product-info d-flex flex-column ${
window.lang === "en" ? "align-items-end" : ""
}`}
>
<h1 style={{ fontSize: fontSize.desktop.h1 }}>{title}</h1> <h1 style={{ fontSize: fontSize.desktop.h1 }}>{title}</h1>
<span style={{ fontSize: fontSize.desktop.span }}>{subTitle}</span> <span style={{ fontSize: fontSize.desktop.span }}>{subTitle}</span>
<p style={{ fontSize: fontSize.desktop.p }}>{description}</p> <p style={{ fontSize: fontSize.desktop.p }}>{description}</p>

@ -130,7 +130,11 @@ class Product extends Component {
{window.innerWidth > 1000 ? ( {window.innerWidth > 1000 ? (
info ? ( info ? (
<> <>
<div className="product d-flex flex-column"> <div
className={`product d-flex flex-column ${
window.lang === "en" ? "align-items-end" : ""
}`}
>
<Navbar /> <Navbar />
<Breadcrumbs <Breadcrumbs
page={page} page={page}
@ -140,7 +144,11 @@ class Product extends Component {
: info.product[0].name : info.product[0].name
} }
/> />
<header className="product__header d-flex mt-4"> <header
className={`product__header d-flex mt-4 ${
window.lang === "en" ? "flex-row-reverse" : ""
}`}
>
<Gallery gallery={info.files} /> <Gallery gallery={info.files} />
<Info <Info
subTitle={`پایه ${grades[info.gradeId]}`} subTitle={`پایه ${grades[info.gradeId]}`}
@ -165,7 +173,11 @@ class Product extends Component {
/> />
</header> </header>
<div className="product__comments d-flex flex-column"> <div className="product__comments d-flex flex-column">
<div className="d-flex justify-content-between"> <div
className={`d-flex justify-content-between ${
window.lang === "en" ? "flex-row-reverse" : ""
}`}
>
<h3 style={{ fontSize: fontSize.desktop.h1 }}> <h3 style={{ fontSize: fontSize.desktop.h1 }}>
{window.t("نظرات خریداران")} {window.t("نظرات خریداران")}
</h3> </h3>

Loading…
Cancel
Save