parent
9368cfcf96
commit
1e2ab85cdc
35 changed files with 729 additions and 461 deletions
@ -1,37 +1,53 @@ |
||||
import proxy from '../proxy'; |
||||
const user = { |
||||
import proxy from "../proxy"; |
||||
const user = { |
||||
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) => |
||||
await proxy.login('user/otp/login', data, { history, dispatch }), |
||||
await proxy.login("user/otp/login", data, { history, 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) => |
||||
await proxy.login('user/switchRole', data, { history, dispatch }), |
||||
await proxy.login("user/switchRole", data, { history, 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) => |
||||
await proxy.get('user/getUserRole', data, { dispatch }), |
||||
list: (data = {}) => async (dispatch) => |
||||
await proxy.get('user/list', data, { dispatch }), |
||||
domains: (data = {}) => async (dispatch) => |
||||
await proxy.get('user/domains', data, { dispatch }), |
||||
getmothers: (data = {}) => async (dispatch) => |
||||
await proxy.get2('mothers/list', data, { |
||||
dispatch, |
||||
}), |
||||
update: (data = {}, data2 = {}) => async (dispatch) => { |
||||
await proxy.put('user/update', data); |
||||
await proxy.get('user/list', 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 }); |
||||
}, |
||||
await proxy.get("user/getUserRole", data, { dispatch }), |
||||
list: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.get("user/list", data, { dispatch }), |
||||
domains: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.get("user/domains", data, { dispatch }), |
||||
getmothers: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.get2("mothers/list", data, { |
||||
dispatch, |
||||
}), |
||||
getProfile: |
||||
(data = {}) => |
||||
async (dispatch) => |
||||
await proxy.get("user/getProfile", data, { 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; |
||||
direction: rtl !important; |
||||
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 TextField from '@material-ui/core/TextField'; |
||||
import { makeStyles } from '@material-ui/core/styles'; |
||||
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 useStyles = makeStyles((theme) => ({ |
||||
root: { |
||||
"& .MuiTextField-root": { |
||||
width: "100%", |
||||
position: "relative", |
||||
marginRight: 10, |
||||
"& input": { |
||||
textAlign: props.align, |
||||
direction: props.align === "right" ? "rtl" : "ltr", |
||||
}, |
||||
}, |
||||
}, |
||||
}, |
||||
})); |
||||
})); |
||||
|
||||
export default function FormPropsTextFields(props) { |
||||
const classes = useStyles(); |
||||
|
||||
const { parent, defaultValue } = props; |
||||
return ( |
||||
<form className={classes.root} noValidate autoComplete="off"> |
||||
<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> |
||||
</form> |
||||
); |
||||
} |
||||
|
||||
FormPropsTextFields.defaultProps = { |
||||
align: "right", |
||||
}; |
||||
|
@ -1,32 +1,32 @@ |
||||
import React from 'react'; |
||||
import { makeStyles } from '@material-ui/core/styles'; |
||||
import TextField from '@material-ui/core/TextField'; |
||||
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': { |
||||
"& .MuiTextField-root": { |
||||
margin: theme.spacing(0), |
||||
width: '100%', |
||||
width: "100%", |
||||
}, |
||||
}, |
||||
})); |
||||
|
||||
export default function MultilineTextFields(props) { |
||||
const classes = useStyles(); |
||||
const [value, setValue] = React.useState('Controlled'); |
||||
|
||||
const [value, setValue] = React.useState("Controlled"); |
||||
const { parent } = props; |
||||
return ( |
||||
<form className={classes.root} noValidate autoComplete="off"> |
||||
<TextField |
||||
id="outlined-multiline-static" |
||||
label={props.label} |
||||
multiline |
||||
rows={4} |
||||
onChange={(e) => props.parent.setState({[props.name] : e.target.value})} |
||||
name={props.name} |
||||
defaultValue="" |
||||
variant="outlined" |
||||
/> |
||||
<TextField |
||||
id="outlined-multiline-static" |
||||
label={props.label} |
||||
multiline |
||||
rows={4} |
||||
onChange={(e) => parent.onChange(e.target.name, e.target.value)} |
||||
name={props.name} |
||||
defaultValue="" |
||||
variant="outlined" |
||||
/> |
||||
</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; |
||||
max-width: 1250px; |
||||
margin: 0px auto; |
||||
padding : 0px 10px; |
||||
padding: 0px 10px; |
||||
direction: rtl; |
||||
padding-top: 100px; |
||||
} |
||||
|
||||
|
||||
.mobile-home{ |
||||
.mobile-home { |
||||
width: 100vw; |
||||
max-width: 600px; |
||||
margin: 0px auto; |
||||
padding: 0px 10px; |
||||
direction: rtl; |
||||
overflow-x: hidden; |
||||
padding-top: 70px; |
||||
} |
||||
padding-top: 90px; |
||||
} |
||||
|
@ -1,32 +1,57 @@ |
||||
import React from 'react'; |
||||
import React from "react"; |
||||
|
||||
import './index.scss'; |
||||
export default function Links(props){ |
||||
return( |
||||
<> |
||||
{ |
||||
window.innerWidth > 1000 ?
|
||||
<div className="links-box d-flex flex-column" id="links"> |
||||
<h2>{props.data.title}</h2> |
||||
</div> : null |
||||
} |
||||
{ |
||||
window.innerWidth < 1000 ?
|
||||
<div className="mobile-links-box d-flex flex-column" id="links">
|
||||
<h2><span></span>لینکها</h2> |
||||
<ul> |
||||
{props.data.links.map((item,i) => ( |
||||
<Item data={item} key={i} /> |
||||
) )} |
||||
</ul> |
||||
</div> : null |
||||
}
|
||||
</> |
||||
); |
||||
import "./index.scss"; |
||||
|
||||
const maxDesktopSize = 1250; |
||||
const maxMobileSize = 550; |
||||
|
||||
const fontSize = { |
||||
mobile: { |
||||
h2: window.innerWidth > maxMobileSize ? 16 : window.innerWidth / 25, |
||||
a: window.innerWidth > maxMobileSize ? 16 : window.innerWidth / 32, |
||||
}, |
||||
desktop: { |
||||
h2: window.innerWidth > maxMobileSize ? 16 : window.innerWidth / 75, |
||||
a: window.innerWidth > maxMobileSize ? 16 : window.innerWidth / 95, |
||||
}, |
||||
}; |
||||
|
||||
export default function Links(props) { |
||||
return ( |
||||
<> |
||||
{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) => { |
||||
return( |
||||
<li><a href={props.data.link}>{props.data.title}</a></li> |
||||
); |
||||
} |
||||
return ( |
||||
<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