update 14 files

front
Reza_ashrafi 2 years ago
parent 655e329c50
commit 8681b95b7e
  1. 1
      public/en.js
  2. 2
      src/App.css
  3. 5
      src/AppRouter.js
  4. 15
      src/views/Auth/Profile/Birthdate/index.js
  5. 2
      src/views/Auth/index.js
  6. 14
      src/views/Cart/Table/index.js
  7. 8
      src/views/Cart/index.scss
  8. 2
      src/views/Home/Navbar/Mobile/NavbarDrawer/NavbarDrawer.js
  9. 6
      src/views/Product/index.js
  10. 8
      src/views/Product/index.scss
  11. 5
      src/views/Products/index.js
  12. 17
      src/views/Products/index.scss

@ -303,6 +303,7 @@ const en = {
تعداد: "Number", تعداد: "Number",
محصول: "the product", محصول: "the product",
جستجو: "Search", جستجو: "Search",
حذف: "Delete",
ارسال: "submit", ارسال: "submit",
خاموش: "Off", خاموش: "Off",
بیشتر: "More", بیشتر: "More",

@ -7,7 +7,7 @@
direction: ltr; direction: ltr;
} }
.left: { .left {
text-align: left !important; text-align: left !important;
} }

@ -288,7 +288,8 @@ class AppRouter extends Component {
)} )}
</Route> </Route>
<Route exact path={"/cart"}> <Route exact path={"/cart"}>
{status ? ( <Cart />
{/* {status ? (
<Cart /> <Cart />
) : ( ) : (
<Redirect <Redirect
@ -296,7 +297,7 @@ class AppRouter extends Component {
pathname: "/", pathname: "/",
}} }}
/> />
)} )} */}
</Route> </Route>
<Route exact path={"/checkout"}> <Route exact path={"/checkout"}>
{status ? ( {status ? (

@ -3,13 +3,14 @@ import onInput from "~/util/onInput";
import Input from "../Input/index"; import Input from "../Input/index";
import "./index.scss"; import "./index.scss";
import moment from "jalali-moment"; import moment from "jalali-moment";
export default function Birthdate(props) { export default function Birthdate(props) {
const { defaultValue, parent, name } = props; const { defaultValue, parent, name } = props;
let momentDate = moment(defaultValue[name]); let momentDate = moment(defaultValue[name]);
let isvalid = momentDate.isValid(); let isvalid = momentDate?.isValid();
const day = isvalid ? momentDate.format("jDD") : null, const day = isvalid ? momentDate?.format("jDD") : null,
month = isvalid ? momentDate.format("jMM") : null, month = isvalid ? momentDate?.format("jMM") : null,
year = isvalid ? momentDate.format("jYYYY") : null; year = isvalid ? momentDate?.format("jYYYY") : null;
const [state, setState] = useState({ day, month, year }); const [state, setState] = useState({ day, month, year });
const onChange = (_name, value) => { const onChange = (_name, value) => {
let _state = { ...state, [_name]: value }; let _state = { ...state, [_name]: value };
@ -18,7 +19,11 @@ export default function Birthdate(props) {
parent.onChange( parent.onChange(
name, name,
moment moment
.from(`${_state.year}/${_state.month}/${_state.day}`, "fa", "YYYY/M/D") .from(
`${_state?.year}/${_state?.month}/${_state?.day}`,
"fa",
"YYYY/M/D"
)
.locale("en") .locale("en")
); );
}; };

@ -15,7 +15,7 @@ export default class Auth extends Component {
return ( return (
<div className="auth d-flex"> <div className="auth d-flex">
{this.state.page === "login" ? <Login parent={this} /> : null} {this.state.page === "login" ? <Login parent={this} /> : null}
{this.state.page === "profile" ? <Profile parent={this} /> : null} {/* {this.state.page === "profile" ? <Profile parent={this} /> : null} */}
</div> </div>
); );
} }

@ -197,7 +197,11 @@ const Item = (props) => {
src={`https://dnvn.ir/api/v1/file/${data.product.book.fileIds}`} src={`https://dnvn.ir/api/v1/file/${data.product.book.fileIds}`}
alt={data.product.book.name} alt={data.product.book.name}
/> />
<div className="mobile-cart-table-product__info d-flex flex-column p-1"> <div
className={`mobile-cart-table-product__info d-flex flex-column p-1 ${
window.lang === "en" ? "align-items-start" : ""
}`}
>
<strong style={{ fontSize: fontSize.mobile.info.strong }}> <strong style={{ fontSize: fontSize.mobile.info.strong }}>
{window.t("نسخه") + {window.t("نسخه") +
` ${ ` ${
@ -215,7 +219,13 @@ const Item = (props) => {
window.t("کد فعالسازی محتوای الکترونیک")} window.t("کد فعالسازی محتوای الکترونیک")}
</span> </span>
{route !== "callback" ? ( {route !== "callback" ? (
<div className="mobile-cart-table-product__info--delete d-flex align-items-center align-self-end"> <div
className={`mobile-cart-table-product__info--delete d-flex align-items-center ${
window.lang === "en"
? "align-self-start"
: "align-self-end"
}`}
>
<DeleteOutlineOutlinedIcon <DeleteOutlineOutlinedIcon
style={{ style={{
color: "#FC120A", color: "#FC120A",

@ -64,6 +64,14 @@
} }
} }
.ltr {
.mobile-cart {
* {
direction: ltr;
}
}
}
.mobile-cart { .mobile-cart {
width: 100vw; width: 100vw;
max-width: 650px; max-width: 650px;

@ -36,7 +36,7 @@ class NavbarDrawer extends Component {
message: "", message: "",
}, },
{ {
name: "ورود یا ثبت نام", name: window.t("ورود یا ثبتنام"),
link: "/auth", link: "/auth",
icon: <img src={mobileLogout} alt={window.t("کتابهای من")} />, icon: <img src={mobileLogout} alt={window.t("کتابهای من")} />,
toast: "", toast: "",

@ -224,7 +224,11 @@ class Product extends Component {
<> <>
<div className="mobile-product d-flex flex-column"> <div className="mobile-product d-flex flex-column">
<Navbar /> <Navbar />
<header className="mobile-product__header d-flex flex-column align-items-center"> <header
className={
"mobile-product__header d-flex flex-column align-items-center"
}
>
<img <img
src={`https://dnvn.ir/api/v1/file/${info.fileIds}`} src={`https://dnvn.ir/api/v1/file/${info.fileIds}`}
alt={info.name} alt={info.name}

@ -1,3 +1,11 @@
.ltr {
.mobile-product {
* {
direction: ltr;
}
}
}
.mobile-product { .mobile-product {
width: 100vw; width: 100vw;
max-width: 650px; max-width: 650px;

@ -103,7 +103,10 @@ class Products extends Component {
<div className="mobile-products__search d-flex"> <div className="mobile-products__search d-flex">
<input <input
type="search" type="search"
style={{ fontSize: 15 }} style={{
fontSize: 15,
textAlign: window.lang === "en" ? "left" : "",
}}
placeholder={window.t("جستجو")} placeholder={window.t("جستجو")}
onChange={(e) => this.handleProductSearch(e.target.value)} onChange={(e) => this.handleProductSearch(e.target.value)}
/> />

@ -1,3 +1,20 @@
.ltr {
.mobile-products {
* {
direction: ltr;
}
&__search {
input {
padding: 5px 35px 5px 5px;
}
img {
left: auto;
right: 10px;
}
}
}
}
.products { .products {
width: 100vw; width: 100vw;
max-width: 1250px; max-width: 1250px;

Loading…
Cancel
Save