From 5e28e53d1ab5fe4c58e2e36e2110c2fcda3ea280 Mon Sep 17 00:00:00 2001 From: Reza_ashrafi Date: Fri, 25 Jun 2021 23:06:03 +0430 Subject: [PATCH] reza added profile --- src/views/Auth/Login/Cellphone/index.js | 9 +- src/views/Auth/Profile/Input/index.js | 27 +++++ src/views/Auth/Profile/Select/index.js | 75 ++++++++++++ src/views/Auth/Profile/TextArea/index.js | 32 ++++++ src/views/Auth/Profile/index.js | 77 ++++++++++--- src/views/Auth/Profile/index.scss | 138 +++++++++++++++++++++++ src/views/Auth/index.js | 3 +- 7 files changed, 343 insertions(+), 18 deletions(-) create mode 100644 src/views/Auth/Profile/Input/index.js create mode 100644 src/views/Auth/Profile/Select/index.js create mode 100644 src/views/Auth/Profile/TextArea/index.js diff --git a/src/views/Auth/Login/Cellphone/index.js b/src/views/Auth/Login/Cellphone/index.js index 42715ca..2b8f063 100644 --- a/src/views/Auth/Login/Cellphone/index.js +++ b/src/views/Auth/Login/Cellphone/index.js @@ -82,11 +82,14 @@ export default class Cellphone extends Component { .replace(/[^\d]/, "")) } /> - +
-
حساب کاربری ندارید ؟ همین حالا
-
شرایط استفاده و حریم خصوصی
+
+ {" "} + حساب کاربری ندارید ؟ همین حالا +
+
شرایط استفاده و حریم خصوصی
) : null} diff --git a/src/views/Auth/Profile/Input/index.js b/src/views/Auth/Profile/Input/index.js new file mode 100644 index 0000000..6dbcd5d --- /dev/null +++ b/src/views/Auth/Profile/Input/index.js @@ -0,0 +1,27 @@ +import React from 'react'; +import TextField from '@material-ui/core/TextField'; +import { makeStyles } from '@material-ui/core/styles'; + +const useStyles = makeStyles((theme) => ({ + root: { + '& .MuiTextField-root': { + + width: '100%', + position : 'relative', + marginRight : 10, + + }, + }, +})); + +export default function FormPropsTextFields(props) { + const classes = useStyles(); + + return ( +
+
+ +
+
+ ); +} diff --git a/src/views/Auth/Profile/Select/index.js b/src/views/Auth/Profile/Select/index.js new file mode 100644 index 0000000..ecf9703 --- /dev/null +++ b/src/views/Auth/Profile/Select/index.js @@ -0,0 +1,75 @@ +import React from "react"; +import { makeStyles, withStyles } from "@material-ui/core/styles"; +import FormControl from "@material-ui/core/FormControl"; +import Select from '@material-ui/core/Select'; +import InputBase from "@material-ui/core/InputBase"; +import KeyboardArrowDownIcon from "@material-ui/icons/KeyboardArrowDown"; +import InputLabel from '@material-ui/core/InputLabel'; + +const BootstrapInput = withStyles((theme) => ({ + root: { + "label + &": { + marginTop: theme.spacing(3), + }, + }, + input: { + borderRadius: 4, + position: "relative", + // backgroundColor: theme.palette.background.paper, + border: "1px solid #a5a5a5", + fontSize: window.innerWidth > 1000 ? 16 : "calc(100vw / 30)", + color: "#a5a5a5", + // maxWidth : 70, + minWidth: '100%', + padding: "0px", + transition: theme.transitions.create(["border-color", "box-shadow"]), + // Use the system font instead of the default Roboto font. + fontFamily: "numeralLight", + "&:focus": { + borderRadius: 4, + }, + }, +}))(InputBase); + +const useStyles = makeStyles((theme) => ({ + marginLeft: { + // margin: theme.spacing(1), + marginLeft: 8, + }, +})); + +export default function CustomizedSelects(props) { + const classes = useStyles(); + + console.log(props); + return ( +
+ + {props.label} + + + +
+ ); +} diff --git a/src/views/Auth/Profile/TextArea/index.js b/src/views/Auth/Profile/TextArea/index.js new file mode 100644 index 0000000..6145d68 --- /dev/null +++ b/src/views/Auth/Profile/TextArea/index.js @@ -0,0 +1,32 @@ +import React from 'react'; +import { makeStyles } from '@material-ui/core/styles'; +import TextField from '@material-ui/core/TextField'; + +const useStyles = makeStyles((theme) => ({ + root: { + '& .MuiTextField-root': { + margin: theme.spacing(0), + width: '100%', + }, + }, +})); + +export default function MultilineTextFields(props) { + const classes = useStyles(); + const [value, setValue] = React.useState('Controlled'); + + return ( +
+ props.parent.setState({[props.name] : e.target.value})} + name={props.name} + defaultValue="" + variant="outlined" + /> + + ); +} diff --git a/src/views/Auth/Profile/index.js b/src/views/Auth/Profile/index.js index ee1794e..2c0ee1e 100644 --- a/src/views/Auth/Profile/index.js +++ b/src/views/Auth/Profile/index.js @@ -1,26 +1,77 @@ import React, { Component } from "react"; +import Select from "./Select/index"; +import Input from "./Input/index"; +import TextArea from "./TextArea/index"; import logo from "../../../assets/icons/logo.png"; +import pic from "../../../assets/images/pic.png"; +import AddAPhotoIcon from "@material-ui/icons/AddAPhoto"; -import './index.scss'; +import "./index.scss"; export default class Profile extends Component { + state = { + file: null, + }; + onChange = (e) => { + this.setState({ + [e.target.name]: e.target.value, + }); + }; render() { + const {user} = this.props; return ( <> - { - window.innerWidth > 1000 ? -
- -
: null - } - { - window.innerWidth < 1000 ? + {window.innerWidth > 1000 ? ( +
+ ) : null} + {window.innerWidth < 1000 ? (
- دانوین -
: null - } + دانوین +

حساب کاربری

+

لطفا مشحصات خود را به صورت کامل وارد نمایید

+
+ {this.state.file === null ? ( + <> + this.onChange(e)} + /> + + + ) : ( + <> + this.onChange(e)} + /> + {"کاربر"} + + )} +
+ + + + +