parent
9368cfcf96
commit
1e2ab85cdc
35 changed files with 729 additions and 461 deletions
@ -1,37 +1,53 @@ |
|||||||
import proxy from '../proxy'; |
import proxy from "../proxy"; |
||||||
const user = { |
const user = { |
||||||
otp: (data, history) => async (dispatch) => |
otp: (data, history) => async (dispatch) => |
||||||
await proxy.login('public/sendOTP', data, { history, dispatch }), |
await proxy.login("public/sendOTP", data, { history, dispatch }), |
||||||
otp_login: (data, history) => async (dispatch) => |
otp_login: (data, history) => async (dispatch) => |
||||||
await proxy.login('user/otp/login', data, { history, dispatch }), |
await proxy.login("user/otp/login", data, { history, dispatch }), |
||||||
register: (data, history) => async (dispatch) => |
register: (data, history) => async (dispatch) => |
||||||
await proxy.login('user/register', data, { history, dispatch }), |
await proxy.login("user/register", data, { history, dispatch }), |
||||||
switchRole: (data, history) => async (dispatch) => |
switchRole: (data, history) => async (dispatch) => |
||||||
await proxy.login('user/switchRole', data, { history, dispatch }), |
await proxy.login("user/switchRole", data, { history, dispatch }), |
||||||
logout: (data, history) => async (dispatch) => |
logout: (data, history) => async (dispatch) => |
||||||
await proxy.logout('user/logout', data, { history, dispatch }), |
await proxy.logout("user/logout", data, { history, dispatch }), |
||||||
getUserRole: (data) => async (dispatch) => |
getUserRole: (data) => async (dispatch) => |
||||||
await proxy.get('user/getUserRole', data, { dispatch }), |
await proxy.get("user/getUserRole", data, { dispatch }), |
||||||
list: (data = {}) => async (dispatch) => |
list: |
||||||
await proxy.get('user/list', data, { dispatch }), |
(data = {}) => |
||||||
domains: (data = {}) => async (dispatch) => |
async (dispatch) => |
||||||
await proxy.get('user/domains', data, { dispatch }), |
await proxy.get("user/list", data, { dispatch }), |
||||||
getmothers: (data = {}) => async (dispatch) => |
domains: |
||||||
await proxy.get2('mothers/list', data, { |
(data = {}) => |
||||||
dispatch, |
async (dispatch) => |
||||||
}), |
await proxy.get("user/domains", data, { dispatch }), |
||||||
update: (data = {}, data2 = {}) => async (dispatch) => { |
getmothers: |
||||||
await proxy.put('user/update', data); |
(data = {}) => |
||||||
await proxy.get('user/list', data2, { dispatch }); |
async (dispatch) => |
||||||
}, |
await proxy.get2("mothers/list", data, { |
||||||
add: (data = {}, data2 = {}) => async (dispatch) => { |
dispatch, |
||||||
await proxy.post('user/add', data); |
}), |
||||||
await proxy.get('user/list', data2, { dispatch }); |
getProfile: |
||||||
}, |
(data = {}) => |
||||||
del: (data = {}, data2 = {}) => async (dispatch) => { |
async (dispatch) => |
||||||
await proxy.delete('user/delete', data); |
await proxy.get("user/getProfile", data, { dispatch }), |
||||||
await proxy.get('user/list', data2, { dispatch }); |
setProfile: |
||||||
}, |
(data = {}, data2 = {}) => |
||||||
|
async (dispatch) => { |
||||||
|
await proxy.put("user/setProfile", data, { dispatch }); |
||||||
|
await proxy.get("user/getProfile", data2, { dispatch }); |
||||||
|
}, |
||||||
|
add: |
||||||
|
(data = {}, data2 = {}) => |
||||||
|
async (dispatch) => { |
||||||
|
await proxy.post("user/add", data); |
||||||
|
await proxy.get("user/list", data2, { dispatch }); |
||||||
|
}, |
||||||
|
del: |
||||||
|
(data = {}, data2 = {}) => |
||||||
|
async (dispatch) => { |
||||||
|
await proxy.delete("user/delete", data); |
||||||
|
await proxy.get("user/list", data2, { dispatch }); |
||||||
|
}, |
||||||
}; |
}; |
||||||
|
|
||||||
export default user; |
export default user; |
||||||
|
After Width: | Height: | Size: 6.8 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 2.5 KiB |
@ -1,6 +1,7 @@ |
|||||||
.timer{ |
.timer { |
||||||
flex-direction: row; |
flex-direction: row; |
||||||
direction: rtl !important; |
direction: rtl !important; |
||||||
margin-right: 10px; |
margin-right: 10px; |
||||||
color: #6CBE44; |
color: #6cbe44; |
||||||
} |
font-family: numeralLight; |
||||||
|
} |
||||||
|
@ -0,0 +1,20 @@ |
|||||||
|
import React from "react"; |
||||||
|
|
||||||
|
export default function GenderSwitch(props) { |
||||||
|
return ( |
||||||
|
<> |
||||||
|
{window.innerWidth > 1000 ? ( |
||||||
|
<div className="gender d-flex"> |
||||||
|
<button onClick={}>پسر</button> |
||||||
|
<button>دختر</button> |
||||||
|
</div> |
||||||
|
) : null} |
||||||
|
{window.innerWidth < 1000 ? ( |
||||||
|
<div className="mobile-gender d-flex"> |
||||||
|
<button>پسر</button> |
||||||
|
<button>دختر</button> |
||||||
|
</div> |
||||||
|
) : null} |
||||||
|
</> |
||||||
|
); |
||||||
|
} |
@ -1,27 +1,40 @@ |
|||||||
import React from 'react'; |
import React from "react"; |
||||||
import TextField from '@material-ui/core/TextField'; |
import TextField from "@material-ui/core/TextField"; |
||||||
import { makeStyles } from '@material-ui/core/styles'; |
import { makeStyles } from "@material-ui/core/styles"; |
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({ |
export default function FormPropsTextFields(props) { |
||||||
root: { |
const useStyles = makeStyles((theme) => ({ |
||||||
'& .MuiTextField-root': { |
root: { |
||||||
|
"& .MuiTextField-root": { |
||||||
width: '100%', |
width: "100%", |
||||||
position : 'relative', |
position: "relative", |
||||||
marginRight : 10, |
marginRight: 10, |
||||||
|
"& input": { |
||||||
|
textAlign: props.align, |
||||||
|
direction: props.align === "right" ? "rtl" : "ltr", |
||||||
|
}, |
||||||
|
}, |
||||||
}, |
}, |
||||||
}, |
})); |
||||||
})); |
|
||||||
|
|
||||||
export default function FormPropsTextFields(props) { |
|
||||||
const classes = useStyles(); |
const classes = useStyles(); |
||||||
|
const { parent, defaultValue } = props; |
||||||
return ( |
return ( |
||||||
<form className={classes.root} noValidate autoComplete="off"> |
<form className={classes.root} noValidate autoComplete="off"> |
||||||
<div> |
<div> |
||||||
<TextField id="outlined-basic" name={props.name} label={props.label} variant="outlined" /> |
<TextField |
||||||
|
id="outlined-basic" |
||||||
|
name={props.name} |
||||||
|
label={props.label} |
||||||
|
variant="outlined" |
||||||
|
onChange={(e) => parent.onChange(e.target.name, e.target.value)} |
||||||
|
defaultValue={defaultValue} |
||||||
|
/> |
||||||
</div> |
</div> |
||||||
</form> |
</form> |
||||||
); |
); |
||||||
} |
} |
||||||
|
|
||||||
|
FormPropsTextFields.defaultProps = { |
||||||
|
align: "right", |
||||||
|
}; |
||||||
|
@ -1,32 +1,32 @@ |
|||||||
import React from 'react'; |
import React from "react"; |
||||||
import { makeStyles } from '@material-ui/core/styles'; |
import { makeStyles } from "@material-ui/core/styles"; |
||||||
import TextField from '@material-ui/core/TextField'; |
import TextField from "@material-ui/core/TextField"; |
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({ |
const useStyles = makeStyles((theme) => ({ |
||||||
root: { |
root: { |
||||||
'& .MuiTextField-root': { |
"& .MuiTextField-root": { |
||||||
margin: theme.spacing(0), |
margin: theme.spacing(0), |
||||||
width: '100%', |
width: "100%", |
||||||
}, |
}, |
||||||
}, |
}, |
||||||
})); |
})); |
||||||
|
|
||||||
export default function MultilineTextFields(props) { |
export default function MultilineTextFields(props) { |
||||||
const classes = useStyles(); |
const classes = useStyles(); |
||||||
const [value, setValue] = React.useState('Controlled'); |
const [value, setValue] = React.useState("Controlled"); |
||||||
|
const { parent } = props; |
||||||
return ( |
return ( |
||||||
<form className={classes.root} noValidate autoComplete="off"> |
<form className={classes.root} noValidate autoComplete="off"> |
||||||
<TextField |
<TextField |
||||||
id="outlined-multiline-static" |
id="outlined-multiline-static" |
||||||
label={props.label} |
label={props.label} |
||||||
multiline |
multiline |
||||||
rows={4} |
rows={4} |
||||||
onChange={(e) => props.parent.setState({[props.name] : e.target.value})} |
onChange={(e) => parent.onChange(e.target.name, e.target.value)} |
||||||
name={props.name} |
name={props.name} |
||||||
defaultValue="" |
defaultValue="" |
||||||
variant="outlined" |
variant="outlined" |
||||||
/> |
/> |
||||||
</form> |
</form> |
||||||
); |
); |
||||||
} |
} |
||||||
|
@ -0,0 +1,79 @@ |
|||||||
|
import React from "react"; |
||||||
|
import AddAPhotoIcon from "@material-ui/icons/AddAPhoto"; |
||||||
|
|
||||||
|
const maxDesktopSize = 1250; |
||||||
|
const maxMobileSize = 550; |
||||||
|
|
||||||
|
const fontSize = { |
||||||
|
desktop: { |
||||||
|
span: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 80, |
||||||
|
}, |
||||||
|
}; |
||||||
|
|
||||||
|
export default function Upload(props) { |
||||||
|
const { parent } = props; |
||||||
|
return ( |
||||||
|
<> |
||||||
|
{window.innerWidth < 1000 ? ( |
||||||
|
<div className="mobile-auth-profile__upload d-flex justify-content-center align-items-center mb-3"> |
||||||
|
{parent.state.file === null ? ( |
||||||
|
<> |
||||||
|
<input |
||||||
|
type="file" |
||||||
|
name="file" |
||||||
|
onChange={(e) => parent.onChange(e.target.name, e.target.value)} |
||||||
|
/> |
||||||
|
<AddAPhotoIcon |
||||||
|
style={{ width: 40, height: 40, color: "white" }} |
||||||
|
/> |
||||||
|
</> |
||||||
|
) : ( |
||||||
|
<> |
||||||
|
<input |
||||||
|
type="file" |
||||||
|
name="file" |
||||||
|
onChange={(e) => parent.onChange(e.target.name, e.target.value)} |
||||||
|
/> |
||||||
|
<img src={this.props.user.icon} alt={"کاربر"} /> |
||||||
|
</> |
||||||
|
)} |
||||||
|
</div> |
||||||
|
) : null} |
||||||
|
{window.innerWidth > 1000 ? ( |
||||||
|
<div className="auth-profile__upload d-flex justify-content-center-align-items-center"> |
||||||
|
{parent.state.file === null ? ( |
||||||
|
<> |
||||||
|
<input |
||||||
|
label={props.label} |
||||||
|
onChange={(e) => parent.onChange(e.target.name, e.target.value)} |
||||||
|
name={props.name} |
||||||
|
defaultValue="" |
||||||
|
type="file" |
||||||
|
/> |
||||||
|
<AddAPhotoIcon |
||||||
|
style={{ |
||||||
|
width: 40, |
||||||
|
height: 40, |
||||||
|
color: "grey", |
||||||
|
position: "absolute", |
||||||
|
left: "calc(50% - 20px)", |
||||||
|
top: "calc(50% - 20px)", |
||||||
|
}} |
||||||
|
/> |
||||||
|
</> |
||||||
|
) : ( |
||||||
|
<> |
||||||
|
<input |
||||||
|
label={props.label} |
||||||
|
onChange={(e) => parent.onChange(e.target.name, e.target.value)} |
||||||
|
name={props.name} |
||||||
|
defaultValue="" |
||||||
|
type="file" |
||||||
|
/> |
||||||
|
</> |
||||||
|
)} |
||||||
|
</div> |
||||||
|
) : null} |
||||||
|
</> |
||||||
|
); |
||||||
|
} |
@ -1,19 +1,18 @@ |
|||||||
.home{ |
.home { |
||||||
width: 100vw; |
width: 100vw; |
||||||
max-width: 1250px; |
max-width: 1250px; |
||||||
margin: 0px auto; |
margin: 0px auto; |
||||||
padding : 0px 10px; |
padding: 0px 10px; |
||||||
direction: rtl; |
direction: rtl; |
||||||
padding-top: 100px; |
padding-top: 100px; |
||||||
} |
} |
||||||
|
|
||||||
|
.mobile-home { |
||||||
.mobile-home{ |
|
||||||
width: 100vw; |
width: 100vw; |
||||||
max-width: 600px; |
max-width: 600px; |
||||||
margin: 0px auto; |
margin: 0px auto; |
||||||
padding: 0px 10px; |
padding: 0px 10px; |
||||||
direction: rtl; |
direction: rtl; |
||||||
overflow-x: hidden; |
overflow-x: hidden; |
||||||
padding-top: 70px; |
padding-top: 90px; |
||||||
} |
} |
||||||
|
@ -1,32 +1,57 @@ |
|||||||
import React from 'react'; |
import React from "react"; |
||||||
|
|
||||||
import './index.scss'; |
import "./index.scss"; |
||||||
export default function Links(props){ |
|
||||||
return( |
const maxDesktopSize = 1250; |
||||||
<> |
const maxMobileSize = 550; |
||||||
{ |
|
||||||
window.innerWidth > 1000 ?
|
const fontSize = { |
||||||
<div className="links-box d-flex flex-column" id="links"> |
mobile: { |
||||||
<h2>{props.data.title}</h2> |
h2: window.innerWidth > maxMobileSize ? 16 : window.innerWidth / 25, |
||||||
</div> : null |
a: window.innerWidth > maxMobileSize ? 16 : window.innerWidth / 32, |
||||||
} |
}, |
||||||
{ |
desktop: { |
||||||
window.innerWidth < 1000 ?
|
h2: window.innerWidth > maxMobileSize ? 16 : window.innerWidth / 75, |
||||||
<div className="mobile-links-box d-flex flex-column" id="links">
|
a: window.innerWidth > maxMobileSize ? 16 : window.innerWidth / 95, |
||||||
<h2><span></span>لینکها</h2> |
}, |
||||||
<ul> |
}; |
||||||
{props.data.links.map((item,i) => ( |
|
||||||
<Item data={item} key={i} /> |
export default function Links(props) { |
||||||
) )} |
return ( |
||||||
</ul> |
<> |
||||||
</div> : null |
{window.innerWidth > 1000 ? ( |
||||||
}
|
<div className="links-box d-flex flex-column" id="links"> |
||||||
</> |
<h2 style={{ fontSize: fontSize.desktop.h2 }}>{props.data.title}</h2> |
||||||
); |
</div> |
||||||
|
) : null} |
||||||
|
{window.innerWidth < 1000 ? ( |
||||||
|
<div className="mobile-links-box d-flex flex-column" id="links"> |
||||||
|
<h2 style={{ fontSize: fontSize.mobile.h2 }}> |
||||||
|
<span></span>لینکها |
||||||
|
</h2> |
||||||
|
<ul> |
||||||
|
{props.data.links.map((item, i) => ( |
||||||
|
<Item data={item} key={i} /> |
||||||
|
))} |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
) : null} |
||||||
|
</> |
||||||
|
); |
||||||
} |
} |
||||||
|
|
||||||
const Item = (props) => { |
const Item = (props) => { |
||||||
return( |
return ( |
||||||
<li><a href={props.data.link}>{props.data.title}</a></li> |
<li> |
||||||
); |
<a |
||||||
} |
style={{ |
||||||
|
fontSize: |
||||||
|
window.innerWidth > 1000 ? fontSize.desktop.a : fontSize.mobile.a, |
||||||
|
}} |
||||||
|
href={props.data.link} |
||||||
|
> |
||||||
|
{props.data.title} |
||||||
|
</a> |
||||||
|
</li> |
||||||
|
); |
||||||
|
}; |
||||||
|
Loading…
Reference in new issue