parent
f2cebef2bf
commit
b92aa90c4f
14 changed files with 275 additions and 1073 deletions
@ -1,111 +0,0 @@ |
||||
import React from "react"; |
||||
import "./index.scss"; |
||||
|
||||
const maxDesktopSize = 1250; |
||||
const maxMobileSize = 550; |
||||
|
||||
const fontSize = { |
||||
desktop: { |
||||
span: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 80, |
||||
}, |
||||
mobile: { |
||||
span: window.innerWidth > maxMobileSize ? 14 : window.innerWidth / 30, |
||||
}, |
||||
}; |
||||
|
||||
export default function Document(props) { |
||||
const { parent, name } = props; |
||||
return ( |
||||
<> |
||||
{window.innerWidth < 1000 ? ( |
||||
<div className="mobile-auth-profile__document d-flex justify-content-center align-items-center mb-3"> |
||||
{parent.state[name] === "" ? ( |
||||
<> |
||||
<input |
||||
type="file" |
||||
// parent.onChange(e.target.name, e.target.value)
|
||||
name={name} |
||||
onChange={(e) => |
||||
parent.onChange(e.target.name, e.target.files[0]) |
||||
} |
||||
/> |
||||
<span style={{ fontSize: fontSize.mobile.span }}> |
||||
گواهی تدریس خود را آپلود کنید. |
||||
</span> |
||||
</> |
||||
) : ( |
||||
<> |
||||
<input |
||||
type="file" |
||||
name="file" |
||||
onChange={(e) => |
||||
parent.onChange(e.target.name, e.target.files[0]) |
||||
} |
||||
/> |
||||
<span |
||||
style={{ |
||||
fontSize: fontSize.mobile.span, |
||||
width: "100%", |
||||
textAlign: "center", |
||||
margin: "auto", |
||||
}} |
||||
> |
||||
{parent.state[name].name || |
||||
"گواهی تدریس ثبت شده و درحال بررسی می باشد"} |
||||
</span> |
||||
</> |
||||
)} |
||||
</div> |
||||
) : null} |
||||
{window.innerWidth > 1000 ? ( |
||||
<div className="mobile-auth-profile__document d-flex justify-content-center-align-items-center"> |
||||
{parent.state[name] === "" ? ( |
||||
<> |
||||
<input |
||||
type="file" |
||||
// parent.onChange(e.target.name, e.target.value)
|
||||
name={name} |
||||
onChange={(e) => |
||||
parent.onChange(e.target.name, e.target.files[0]) |
||||
} |
||||
/> |
||||
<span |
||||
style={{ |
||||
fontSize: fontSize.mobile.span, |
||||
width: "100%", |
||||
textAlign: "center", |
||||
margin: "auto", |
||||
}} |
||||
> |
||||
گواهی تدریس خود را آپلود کنید. |
||||
</span> |
||||
</> |
||||
) : ( |
||||
<> |
||||
<input |
||||
label={props.label} |
||||
onChange={(e) => |
||||
parent.onChange(e.target.name, e.target.files[0]) |
||||
} |
||||
name={props.name} |
||||
defaultValue="" |
||||
type="file" |
||||
/> |
||||
<span |
||||
style={{ |
||||
fontSize: fontSize.mobile.span, |
||||
width: "100%", |
||||
textAlign: "center", |
||||
margin: "auto", |
||||
}} |
||||
> |
||||
{parent.state[name].name || |
||||
"گواهی تدریس ثبت شده و درحال بررسی می باشد"} |
||||
</span> |
||||
</> |
||||
)} |
||||
</div> |
||||
) : null} |
||||
</> |
||||
); |
||||
} |
@ -0,0 +1,38 @@ |
||||
import React from "react"; |
||||
import "./index.scss"; |
||||
|
||||
export default function Document({ defaultValue, name, onChange } : any) { |
||||
return ( |
||||
<div className="mobile-auth-profile__document d-flex justify-content-center align-items-center mb-3"> |
||||
{defaultValue?.docFileIds === "" ? ( |
||||
<> |
||||
<input |
||||
type="file" |
||||
// parent.onChange(e.target.name, e.target.value)
|
||||
name={name} |
||||
// onChange={(e) => onChange(e.target.name, e.target.files[0])}
|
||||
/> |
||||
<span>گواهی تدریس خود را آپلود کنید.</span> |
||||
</> |
||||
) : ( |
||||
<> |
||||
<input |
||||
type="file" |
||||
name="file" |
||||
// onChange={(e) => onChange(e.target.name, e.target.files[0])}
|
||||
/> |
||||
<span |
||||
style={{ |
||||
width: "100%", |
||||
textAlign: "center", |
||||
margin: "auto", |
||||
}} |
||||
> |
||||
{defaultValue?.docFileIds.name || |
||||
"گواهی تدریس ثبت شده و درحال بررسی می باشد"} |
||||
</span> |
||||
</> |
||||
)} |
||||
</div> |
||||
); |
||||
} |
Loading…
Reference in new issue