Reza added desktop login

master
Reza_ashrafi 3 years ago
parent 91dc17b639
commit d948b16c4a
  1. 54
      src/views/Auth/Login/Cellphone/index.js
  2. 92
      src/views/Auth/Login/Cellphone/index.scss
  3. 63
      src/views/Auth/Login/Code/index.js
  4. 50
      src/views/Auth/Login/Code/index.scss
  5. 24
      src/views/Auth/Login/Timer/index.js
  6. 2
      src/views/Auth/Login/index.js
  7. 2
      src/views/Auth/Profile/Select/index.js
  8. 77
      src/views/Auth/Profile/index.js
  9. 108
      src/views/Auth/Profile/index.scss
  10. 6
      src/views/Home/Navbar/Mobile/NavbarDrawer/NavbarDrawer.js

@ -2,20 +2,35 @@ import React, { Component } from "react";
import logo from "../../../../assets/icons/logo.png"; import logo from "../../../../assets/icons/logo.png";
import iran from "../../../../assets/icons/iran.svg"; import iran from "../../../../assets/icons/iran.svg";
import pic from "../../../../assets/images/pic.png";
import "./index.scss"; import "./index.scss";
const maxDesktopSize = 1250;
const fontSize = {
desktop: {
span: window.innerWidth > maxDesktopSize ? 18 : window.innerWidth / 85,
input: window.innerWidth > maxDesktopSize ? 18 : window.innerWidth / 85,
button: window.innerWidth > maxDesktopSize ? 18 : window.innerWidth / 85,
div: window.innerWidth > maxDesktopSize ? 16 : window.innerWidth / 95,
},
};
export default class Cellphone extends Component { export default class Cellphone extends Component {
componentDidMount() {
this.inputRef1.focus();
}
render() { render() {
return ( return (
<> <>
{window.innerWidth > 1000 ? ( {window.innerWidth > 1000 ? (
<div className="auth-cellphone d-flex flex-column align-items-center"> <div className="auth-cellphone d-flex justify-content-center align-items-center">
<div className="auth-cellphone__box d-flex">
<div
style={{ width: "48%", height: "100%" }}
className="d-flex flex-column justify-content-center align-items-center"
>
<img src={logo} alt="دانوین" /> <img src={logo} alt="دانوین" />
<div></div>
<form <form
className="mb-3"
onSubmit={() => onSubmit={() =>
this.props.parent.setState({ this.props.parent.setState({
page: 1, page: 1,
@ -23,7 +38,10 @@ export default class Cellphone extends Component {
}) })
} }
> >
<span style={{ fontSize: fontSize.desktop.span }}>+98</span>
<img src={iran} alt="پرچم" />
<input <input
style={{ fontSize: fontSize.desktop.span }}
id="cellphone" id="cellphone"
type="text" type="text"
maxLength={9} maxLength={9}
@ -32,7 +50,9 @@ export default class Cellphone extends Component {
ref={(input) => { ref={(input) => {
this.inputRef1 = input; this.inputRef1 = input;
}} }}
onChange={(e) => this.setState({ cellphone: e.target.value })} onChange={(e) =>
this.setState({ cellphone: e.target.value })
}
onInput={(e) => onInput={(e) =>
(e.target.value = e.target.value (e.target.value = e.target.value
.replace(/[\u0660-\u0669\u06f0-\u06f9]/g, function (c) { .replace(/[\u0660-\u0669\u06f0-\u06f9]/g, function (c) {
@ -41,7 +61,29 @@ export default class Cellphone extends Component {
.replace(/[^\d]/, "")) .replace(/[^\d]/, ""))
} }
/> />
<button
style={{ fontSize: fontSize.desktop.button }}
type="submit"
>
ادامه
</button>
</form> </form>
<div className="auth-cellphone__box--footer d-flex flex-column justify-content-center align-items-center">
<div style={{ fontSize: fontSize.desktop.div }}>
{" "}
حساب کاربری ندارید ؟ همین حالا<button>ثبت نام کنید</button>
</div>
<div style={{ fontSize: fontSize.desktop.div }}>شرایط استفاده و حریم خصوصی</div>
</div>
</div>
<div style={{ width: "48%", height: "100%" }}>
<img
src={pic}
alt="عکس"
style={{ width: "100%", height: "100%" }}
/>
</div>
</div>
</div> </div>
) : null} ) : null}
{window.innerWidth < 1000 ? ( {window.innerWidth < 1000 ? (

@ -1,21 +1,75 @@
.auth-cellphone { .auth-cellphone {
width: 100vw;
height: 100vh;
&__box {
width: 100%; width: 100%;
height: 100%; max-width: 1000px;
justify-content: center; border: 1px solid #ddd;
align-items: center; border-radius: 20px;
label { justify-content: space-between;
height: 80%;
img {
margin-bottom: 30px;
width: 200px;
}
form {
width: 100%;
max-width: 400px;
position: relative;
img {
position: absolute;
left: 10px;
top: 6px;
width: 45px;
}
span {
text-align: right; text-align: right;
display: flex; position: absolute;
flex-direction: column; left: 65px;
color: white; top: 8px;
direction: ltr;
color: #a5a5a5;
}
input { input {
width: 100%;
max-width: 400px;
background-color: inherit; background-color: inherit;
color: #a5a5a5;
direction: ltr;
text-align: left;
background-color: #f2f2f2;
border: none;
padding: 8px 5px 8px 105px;
border-radius: 5px;
&:focus {
outline: 0px;
}
}
button {
margin-top: 20px;
width: 100%;
max-width: 400px;
border: 0px; border: 0px;
border-bottom: 2px solid white; font-family: numeralMedium;
font-size: 24px; background-color: #6cbe44;
color: white; color: white;
direction: ltr; border-radius: 7px;
text-align: center; padding: 8px;
}
}
&--footer {
max-width: 400px;
div {
font-family: numeralMedium;
color: #a5a5a5;
letter-spacing: -1px;
button {
background-color: white;
border: 0px;
color: #02733c;
letter-spacing: -1px;
}
}
} }
} }
} }
@ -51,13 +105,13 @@
width: 100%; width: 100%;
position: relative; position: relative;
bottom: 40px; bottom: 40px;
img{ img {
position: absolute; position: absolute;
left: 10px; left: 10px;
top: 6px; top: 6px;
width: 45px; width: 45px;
} }
span{ span {
text-align: right; text-align: right;
position: absolute; position: absolute;
left: 65px; left: 65px;
@ -81,30 +135,30 @@
outline: 0px; outline: 0px;
} }
} }
button{ button {
margin-top: 20px; margin-top: 20px;
width: 100%; width: 100%;
border: 0px; border: 0px;
font-family: numeralMedium; font-family: numeralMedium;
background-color: #6CBE44; background-color: #6cbe44;
color: white; color: white;
border-radius: 7px; border-radius: 7px;
padding: 8px; padding: 8px;
font-size: calc(100vw / 20); font-size: calc(100vw / 20);
} }
} }
&__footer{ &__footer {
position: fixed; position: fixed;
bottom: 40px; bottom: 40px;
div{ div {
font-family: numeralMedium; font-family: numeralMedium;
font-size: calc(100vw / 28); font-size: calc(100vw / 28);
color: #a5a5a5; color: #a5a5a5;
letter-spacing: -1px; letter-spacing: -1px;
button{ button {
background-color: white; background-color: white;
border: 0px; border: 0px;
color: #02733C; color: #02733c;
} }
} }
} }

@ -2,8 +2,19 @@ import React, { Component } from "react";
import Timer from "../Timer/index"; import Timer from "../Timer/index";
import logo from "../../../../assets/icons/logo.png"; import logo from "../../../../assets/icons/logo.png";
import pic from "../../../../assets/images/pic.png";
import "./index.scss"; import "./index.scss";
const maxDesktopSize = 1250;
const fontSize = {
desktop: {
input: window.innerWidth > maxDesktopSize ? 18 : window.innerWidth / 85,
button: window.innerWidth > maxDesktopSize ? 18 : window.innerWidth / 85,
div: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 95,
},
};
export default class Code extends Component { export default class Code extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
@ -72,7 +83,14 @@ export default class Code extends Component {
return ( return (
<> <>
{window.innerWidth > 1000 ? ( {window.innerWidth > 1000 ? (
<div className="auth-code d-flex"> <div className="auth-code d-flex justify-content-center align-items-center">
<div className="auth-code__box d-flex">
<div
style={{ width: "48%", height: "100%" }}
className="d-flex flex-column justify-content-center align-items-center"
>
<img src={logo} alt="دانوین" />
<div className="auth-code__box--codes d-flex">
<label htmlFor="code1"> <label htmlFor="code1">
<input <input
id="code1" id="code1"
@ -88,6 +106,7 @@ export default class Code extends Component {
onKeyDown={(e) => this.keyboardEvent(e)} onKeyDown={(e) => this.keyboardEvent(e)}
onInput={this.onInput} onInput={this.onInput}
onChange={(e) => this.changeValue(e)} onChange={(e) => this.changeValue(e)}
style={{ fontSize: fontSize.desktop.input }}
/> />
</label> </label>
<label htmlFor="code2"> <label htmlFor="code2">
@ -105,6 +124,7 @@ export default class Code extends Component {
onKeyDown={(e) => this.keyboardEvent(e)} onKeyDown={(e) => this.keyboardEvent(e)}
onInput={this.onInput} onInput={this.onInput}
onChange={(e) => this.changeValue(e)} onChange={(e) => this.changeValue(e)}
style={{ fontSize: fontSize.desktop.input }}
/> />
</label> </label>
<label htmlFor="code3"> <label htmlFor="code3">
@ -122,10 +142,12 @@ export default class Code extends Component {
onKeyDown={(e) => this.keyboardEvent(e)} onKeyDown={(e) => this.keyboardEvent(e)}
onInput={this.onInput} onInput={this.onInput}
onChange={(e) => this.changeValue(e)} onChange={(e) => this.changeValue(e)}
style={{ fontSize: fontSize.desktop.input }}
/> />
</label> </label>
<label htmlFor="code4"> <label htmlFor="code4">
<input <input
id="code4" id="code4"
name="o4" name="o4"
type="text" type="text"
@ -139,19 +161,48 @@ export default class Code extends Component {
onKeyDown={(e) => this.keyboardEvent(e)} onKeyDown={(e) => this.keyboardEvent(e)}
onInput={this.onInput} onInput={this.onInput}
onChange={(e) => this.changeValue(e)} onChange={(e) => this.changeValue(e)}
style={{ fontSize: fontSize.desktop.input }}
/> />
</label> </label>
</div>
<button style={{ fontSize: fontSize.desktop.button }}>ثبت</button>
{!this.state.resendStatus ? ( {!this.state.resendStatus ? (
<Timer seconds={10} parent={this} /> <Timer seconds={10} parent={this} />
) : ( ) : (
<div <div
style={{ color: "#88ff88" }} style={{
className="timer d-flex" color: "#A5A5A5",
fontFamily: "numeralMedium",
fontSize: fontSize.desktop.div,
}}
className="timer d-flex mt-4"
onClick={() => this.setState({ resendStatus: false })} onClick={() => this.setState({ resendStatus: false })}
> >
دریافت مجدد کد ارسال مجدد کد فعال سازی
</div> </div>
)} )}
<div
style={{
color: "#A5A5A5",
fontFamily: "numeralMedium",
fontSize: fontSize.desktop.div,
}}
className="timer d-flex mt-2"
onClick={() =>
this.props.parent.setState({ page: 0, cellphone: "" })
}
>
بازگشت به مرحله قبل و اصلاح شماره
</div>
</div>
<div style={{ width: "48%", height: "100%" }} className="d-flex">
<img
src={pic}
alt="عکس"
style={{ width: "100%", height: "100%" }}
/>
</div>
</div>
</div> </div>
) : null} ) : null}
{window.innerWidth < 1000 ? ( {window.innerWidth < 1000 ? (
@ -249,7 +300,9 @@ export default class Code extends Component {
<div <div
style={{ color: "#A5A5A5", fontFamily: "numeralLight" }} style={{ color: "#A5A5A5", fontFamily: "numeralLight" }}
className="timer d-flex mt-2" className="timer d-flex mt-2"
onClick={() => this.props.parent.setState({ page : 0, cellphone : ''})} onClick={() =>
this.props.parent.setState({ page: 0, cellphone: "" })
}
> >
بازگشت به مرحله قبل و اصلاح شماره بازگشت به مرحله قبل و اصلاح شماره
</div> </div>

@ -1,27 +1,51 @@
.auth-code{ .auth-code{
width: 100vw;
height: 100vh;
&__box {
width: 100%; width: 100%;
height: 100%; max-width: 1000px;
justify-content:center; border: 1px solid #ddd;
align-items:center; border-radius: 20px;
justify-content: space-between;
height: 80%;
img {
margin-bottom: 30px;
}
button{
margin-top: 20px;
width: 100%;
max-width: 300px;
border: 0px;
font-family: numeralMedium;
background-color: #6CBE44;
color: white;
border-radius: 7px;
padding: 8px;
}
&--codes{
direction: ltr; direction: ltr;
position: relative;
input { input {
width: 50px; max-width: 60px;
background-color: inherit; max-height: 60px;
background-color: #f2f2f2;
border : 0px; border : 0px;
border-bottom: 2px solid white; margin : 0px 10px;
margin : 0px 7px; color: #6F7074;
font-size: 24px;
color : white;
text-align: center; text-align: center;
direction : ltr; direction : ltr;
border-radius: 5px;
padding: 10px 15px;
&:focus{ &:focus{
outline: 0px; outline: 0px;
} }
} }
} div{
letter-spacing:-1px;
}
}
}
.mobile-auth-code{ .mobile-auth-code{
width: 100%; width: 100%;
height: 100%; height: 100%;
justify-content:center; justify-content:center;
@ -81,4 +105,6 @@
} }
} }
} }
}
} }

@ -1,6 +1,13 @@
import { Component } from "react"; import { Component } from "react";
import "./index.css"; import "./index.css";
const maxDesktopSize = 1250;
const fontSize = {
desktop: {
div: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 95,
},
};
export default class Timer extends Component { export default class Timer extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
@ -56,11 +63,26 @@ export default class Timer extends Component {
} }
render() { render() {
return ( return (
<>
{window.innerWidth > 1000 ? (
<div className="timer d-flex mt-4"> <div className="timer d-flex mt-4">
<div style={{color: '#a5a5a5', marginLeft: 5}}>زمان باقیمانده تا انقضای کد:</div> <div style={{ color: "#a5a5a5", marginLeft: 5, fontSize: fontSize.desktop.div, fontFamily:'numeralMedium' }}>
زمان باقیمانده تا انقضای کد:
</div>
<div style={{ fontSize: fontSize.desktop.div }}>{this.state.time.s}</div>:
<div style={{ fontSize: fontSize.desktop.div }}>{this.state.time.m + this.state.time.h * 60}</div>
</div>
) : null}
{window.innerWidth < 1000 ? (
<div className="timer d-flex mt-4">
<div style={{ color: "#a5a5a5", marginLeft: 5 }}>
زمان باقیمانده تا انقضای کد:
</div>
<div>{this.state.time.s}</div>: <div>{this.state.time.s}</div>:
<div>{this.state.time.m + this.state.time.h * 60}</div> <div>{this.state.time.m + this.state.time.h * 60}</div>
</div> </div>
) : null}
</>
); );
} }
} }

@ -7,7 +7,7 @@ export default class Login extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
page: 1, page: 0,
}; };
} }

@ -43,7 +43,7 @@ export default function CustomizedSelects(props) {
console.log(props); console.log(props);
return ( return (
<div style={{ position: "relative" }}> <div style={{ position: "relative"}}>
<FormControl variant="outlined" className={classes.marginLeft}> <FormControl variant="outlined" className={classes.marginLeft}>
<InputLabel id="demo-simple-select-outlined-label">{props.label}</InputLabel> <InputLabel id="demo-simple-select-outlined-label">{props.label}</InputLabel>
<Select <Select

@ -8,6 +8,15 @@ import pic from "../../../assets/images/pic.png";
import AddAPhotoIcon from "@material-ui/icons/AddAPhoto"; import AddAPhotoIcon from "@material-ui/icons/AddAPhoto";
import "./index.scss"; import "./index.scss";
const maxDesktopSize = 1250;
const fontSize = {
desktop: {
h1: window.innerWidth > maxDesktopSize ? 25 : window.innerWidth / 55,
p: window.innerWidth > maxDesktopSize ? 18 : window.innerWidth / 85,
},
};
export default class Profile extends Component { export default class Profile extends Component {
state = { state = {
file: null, file: null,
@ -18,11 +27,59 @@ export default class Profile extends Component {
}); });
}; };
render() { render() {
const {user} = this.props; const { user } = this.props;
return ( return (
<> <>
{window.innerWidth > 1000 ? ( {window.innerWidth > 1000 ? (
<div className="auth-profile d-flex"></div> <div className="auth-profile d-flex justify-content-center align-items-center">
<div className="auth-profile__box d-flex flex-column p-4">
<h1 style={{ fontSize: fontSize.desktop.h1 }}>حساب کاربری</h1>
<p style={{ fontSize: fontSize.desktop.p }}>
لطفا مشخصات خود را به صورت کامل نمایید.
</p>
<form className="auth-profile__box--form d-flex">
<div style={{ width: "48%" }}>
<div className="mb-2">
<Input name="name" label="نام و نام خانوادگی" />
</div>
<div className="mb-2">
<Input name="username" label="نام کاربری" />
</div>
<div className="mb-2">
<Input name="password" label="رمز عبور" />
</div>
</div>
<div style={{ width: "48%" }}>
<div className="mb-2" style={{ minWidth: "100%" }}>
<Select
parent={this}
options={["karaj", "tehran"]}
name="province"
label={"استان"}
/>
</div>
<div className="mb-2">
<Select
parent={this}
options={["karaj", "tehran"]}
name="city"
label={"شهرستان"}
/>
</div>
<div className="mb-2">
<TextArea
parent={this}
label={"آدرس محل سکونت"}
name="address"
/>
</div>
<div className="auth-profile__box--form__footer d-flex justify-content-center">
<button>ذخیره</button>
</div>
</div>
</form>
</div>
</div>
) : null} ) : null}
{window.innerWidth < 1000 ? ( {window.innerWidth < 1000 ? (
<div className="mobile-auth-profile d-flex flex-column"> <div className="mobile-auth-profile d-flex flex-column">
@ -55,9 +112,19 @@ export default class Profile extends Component {
<Input name="name" label="نام و نام خانوادگی" /> <Input name="name" label="نام و نام خانوادگی" />
<Input name="username" label="نام کاربری" /> <Input name="username" label="نام کاربری" />
<Input name="password" label="رمز عبور" /> <Input name="password" label="رمز عبور" />
<Select parent={this} options={['karaj', 'tehran']} name="province" label={'استان'} /> <Select
<Select parent={this} options={['karaj', 'tehran']} name="city" label={'شهرستان'} /> parent={this}
<TextArea parent={this} label={'آدرس محل سکونت'} name="address" /> options={["karaj", "tehran"]}
name="province"
label={"استان"}
/>
<Select
parent={this}
options={["karaj", "tehran"]}
name="city"
label={"شهرستان"}
/>
<TextArea parent={this} label={"آدرس محل سکونت"} name="address" />
<div className="mobile-auth-profile__footer d-flex justify-content-center"> <div className="mobile-auth-profile__footer d-flex justify-content-center">
<button>ذخیره</button> <button>ذخیره</button>
</div> </div>

@ -143,3 +143,111 @@
} }
} }
} }
.auth-profile{
width : 100vw;
height: 100vh;
&__box{
width: 100%;
max-width: 1000px;
border: 1px solid #ddd;
border-radius: 20px;
h1{
margin-top: 15px;
font-family: numeralBold;
color: #6F7074;
letter-spacing: -1px;
}
p{
font-family: numeralLight;
color: #6f7074;
letter-spacing: -1px;
text-align: justify;
}
&--form{
margin-top: 20px;
width: 100%;
justify-content:space-between;
.MuiFormControl-root{
width: 100%;
margin: 10px auto !important;
.MuiSelect-iconOutlined{
display: none;
}
.MuiSelect-outlined.MuiSelect-outlined{
padding-right: 15px;
}
color: #797979 !important;
}
.MuiOutlinedInput-notchedOutline {
top: 0px !important;
}
.MuiOutlinedInput-notchedOutline {
border-color: #cecece !important;
border-width: 1px !important;
color: green !important;
font-size: calc(100vw / 80) !important;
border-radius: 10px !important;
}
.MuiOutlinedInput-input {
padding: 20px 14px !important;
font-size: calc(100vw / 85) !important;
}
.MuiInputLabel-outlined {
font-family: numeralLight !important;
display: inline !important;
position: absolute;
text-align: right !important;
right: 7px;
top: 20px;
padding: 0px !important;
transform: translate(0px, 0px) scale(1) !important;
}
.MuiInputLabel-shrink {
text-align: center !important;
display: inline;
position: absolute;
right: 0px;
top: -8px;
transform: translate(0px, 0px) scale(0.85) !important;
padding-right: 0px !important;
}
label {
background-color: white;
max-width: 120px;
text-align: center;
font-size: calc(100vw / 85) !important;
color: #797979 !important;
letter-spacing: -1px;
}
.Mui-focused {
color: rgba(0, 0, 0, 0.54) !important;
border-color: #c4c4c5 !important;
background-color:white;
}
.MuiInputBase-input{
height: auto !important;
}
&__footer {
width: 100%;
justify-content: center;
align-items: center;
button {
font-family: numeralLight;
border: 0px;
background-color: #00CC69;
border-radius: 7px;
font-size: 18px;
font-weight: 600;
color: white;
padding: 12px 0px;
width: 100%;
}
}
}
}
}

@ -133,13 +133,13 @@ NavbarDrawer.defaultProps = {
}, },
{ {
name: "بارکد خوان", name: "بارکد خوان",
link: "/", link: "/qr-code",
icon: <img src={qrcode} alt="بارکد خوان" />, icon: <img src={qrcode} alt="بارکد خوان" />,
toast: "", toast: "",
}, },
{ {
name: "فروشگاه", name: "فروشگاه",
link: "/", link: "/products",
icon: <img src={mobileBasket} alt="فروشگاه" />, icon: <img src={mobileBasket} alt="فروشگاه" />,
toast: "", toast: "",
}, },
@ -157,7 +157,7 @@ NavbarDrawer.defaultProps = {
}, },
{ {
name: "ویرایش مشخصات", name: "ویرایش مشخصات",
link: "/", link: "/profile",
icon: <img src={mobileProfile} alt="ویرایش مشخصات" />, icon: <img src={mobileProfile} alt="ویرایش مشخصات" />,
toast: "", toast: "",
}, },

Loading…
Cancel
Save