sbx-react-personal
Advanced tools
Comparing version 2.4.1 to 2.4.3
@@ -1,6 +0,6 @@ | ||
import './styles.scss' | ||
import './styles.scss'; | ||
import React from 'react'; | ||
import TwoFA from './elements/2FA/2FA'; | ||
import avatarImg from "./assets/img/user.png"; | ||
import {userMe} from './actions'; | ||
import avatarImg from './assets/img/user.png'; | ||
import { userMe } from './actions'; | ||
@@ -10,123 +10,123 @@ import KYC from './elements/KYC/KYC'; | ||
import ChangePassword from './elements/ChangePassword/ChangePassword'; | ||
import Sessions from "./elements/Sessions/Sessions"; | ||
import Sessions from './elements/Sessions/Sessions'; | ||
class defaultToken extends React.Component { | ||
render() { | ||
return this.props.children; | ||
} | ||
} | ||
const defaultTranslate = (value) => value; | ||
export default class Personal extends React.Component { | ||
state = { | ||
profile: this.props.profile | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
profile: props.profile, | ||
}; | ||
this.language = { | ||
translate: props.translate || defaultTranslate, | ||
Token: props.Token || defaultToken, | ||
}; | ||
} | ||
componentDidMount() { | ||
if (!this.props.profile) { | ||
userMe().then(resp => { | ||
this.setState({profile: resp}) | ||
}) | ||
} | ||
componentDidMount() { | ||
if (!this.props.profile) { | ||
userMe().then((resp) => { | ||
this.setState({ profile: resp }); | ||
}); | ||
} | ||
} | ||
render() { | ||
let {profile} = this.state; | ||
if (!profile) | ||
return null; | ||
render() { | ||
let { profile } = this.state; | ||
if (!profile) return null; | ||
let avatar; | ||
if (profile.avatar) { | ||
avatar = `${__config.connections.REST}/v1/storage/${profile.avatar}`; | ||
} else { | ||
avatar = avatarImg | ||
} | ||
let avatar; | ||
if (profile.avatar) { | ||
avatar = `${__config.connections.REST}/v1/storage/${profile.avatar}`; | ||
} else { | ||
avatar = avatarImg; | ||
} | ||
return <div className="sbxPersonal"> | ||
<UploadAvatar | ||
ref={e => this.uploadAvatar = e} | ||
onChange={resp => { | ||
this.setState({profile: resp}) | ||
}} | ||
/> | ||
<h1 className="sbxPersonal__title"> | ||
Personal data | ||
</h1> | ||
<div className="sbxPersonal__container"> | ||
<div className="sbxPersonal__form"> | ||
<KYC/> | ||
<hr/> | ||
<div className="sbxPersonal__infoText"> | ||
Please provide a photo of you, holding your identity Card front side. In the same picture, make | ||
a reference to <b>{window.location.host}</b> and today's date displayed. Make sure your face is clearly | ||
visible and that all passports details are clearly readable. | ||
let { Token, translate } = this.language; | ||
<ul> | ||
<li> | ||
Face clearly visible | ||
</li> | ||
<li> | ||
Photo ID clearly visible | ||
</li> | ||
<li> | ||
Note with word <b>{window.location.host}</b> | ||
</li> | ||
<li> | ||
Note with today's date | ||
</li> | ||
</ul> | ||
</div> | ||
return ( | ||
<div className="sbxPersonal"> | ||
<UploadAvatar | ||
ref={(e) => (this.uploadAvatar = e)} | ||
onChange={(resp) => { | ||
this.setState({ profile: resp }); | ||
}} | ||
/> | ||
<h1 className="sbxPersonal__title"> | ||
<Token>PERSONAL_DATA</Token> | ||
</h1> | ||
<div className="sbxPersonal__container"> | ||
<div className="sbxPersonal__form"> | ||
<KYC /> | ||
<hr /> | ||
<div className="sbxPersonal__infoText"> | ||
<Token | ||
html | ||
replace={[ | ||
{ | ||
target: '{HOST}', | ||
value: window.location.host, | ||
}, | ||
]} | ||
> | ||
PROVIDE_PHOTO_DESCRIPTION | ||
</Token> | ||
</div> | ||
</div> | ||
<div className="sbxPersonal__info"> | ||
<div> | ||
<div className="sbxPersonal__row"> | ||
<div><Token>AVATAR</Token>:</div> | ||
<div className="sbxPersonal__infoAvatar"> | ||
<img | ||
src={avatar} | ||
alt="" | ||
onClick={(e) => this.uploadAvatar.show()} | ||
/> | ||
</div> | ||
<div className="sbxPersonal__info"> | ||
<div> | ||
<div className="sbxPersonal__row"> | ||
<div> | ||
Avatar: | ||
</div> | ||
<div | ||
className="sbxPersonal__infoAvatar" | ||
> | ||
<img | ||
src={avatar} | ||
alt="" | ||
onClick={e => this.uploadAvatar.show()} | ||
/> | ||
</div> | ||
</div> | ||
<div className="sbxPersonal__row"> | ||
<div> | ||
E-mail: | ||
<br/> | ||
<small> | ||
The Email you provided during registration | ||
</small> | ||
</div> | ||
<span>{profile.email}</span> | ||
</div> | ||
<div className="sbxPersonal__row"> | ||
<div> | ||
2FA: | ||
<br/> | ||
<small> | ||
Google 2fa | ||
</small> | ||
</div> | ||
<TwoFA/> | ||
</div> | ||
<div className="sbxPersonal__row"> | ||
<div> | ||
Password: | ||
</div> | ||
<ChangePassword/> | ||
</div> | ||
<hr/> | ||
<Sessions/> | ||
</div> | ||
</div> | ||
<div className="sbxPersonal__row"> | ||
<div> | ||
<Token>E-MAIL</Token>: | ||
<br /> | ||
<small><Token>E-MAIL_DESCRIPTION</Token></small> | ||
</div> | ||
</div> | ||
<hr/> | ||
<div className="sbxPersonal__footer"> | ||
<div className="sbxPersonal__footerText"> | ||
Date registered: {profile.regTime} | ||
<span>{profile.email}</span> | ||
</div> | ||
<div className="sbxPersonal__row"> | ||
<div> | ||
<Token>2FA</Token>: | ||
<br /> | ||
<small><Token>GOOGLE_2FA</Token></small> | ||
</div> | ||
<div className="sbxPersonal__footerText"> | ||
Profile ID: {profile.id} | ||
</div> | ||
<TwoFA /> | ||
</div> | ||
<div className="sbxPersonal__row"> | ||
<div><Token>PASSWORD</Token>:</div> | ||
<ChangePassword /> | ||
</div> | ||
<hr /> | ||
<Sessions /> | ||
</div> | ||
</div> | ||
</div> | ||
} | ||
<hr /> | ||
<div className="sbxPersonal__footer"> | ||
<div className="sbxPersonal__footerText"> | ||
<Token>DATE_REGISTERED</Token>: {profile.regTime} | ||
</div> | ||
<div className="sbxPersonal__footerText"> | ||
<Token>PROFILE_ID</Token>: {profile.id} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} |
{ | ||
"name": "sbx-react-personal", | ||
"version": "2.4.1", | ||
"version": "2.4.3", | ||
"description": "sbx-react-personal", | ||
@@ -5,0 +5,0 @@ "author": "Vladislav Fisher", |
@@ -6,3 +6,3 @@ import './index.scss' | ||
localStorage.setItem('authorization', 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJwcm9qZWN0SWQiOjQ3LCJyb2xlcyI6WyJjbGllbnQiLCJ1c2VyIl0sImlkIjoxMjM0MywiZXhwIjoxNjI4NDI3NDA0LCJpYXQiOjE2MjgyNTQ2MDR9.NEKn0PN1p1cZ6NGQgWeJ8OeOjnEO0O4aaZf-h1H3G9iKiYpFa4uwyjo59yE9rsRdVyFy9rhfWLB9b-0WhvIPLA') | ||
localStorage.setItem('authorization', 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJwcm9qZWN0SWQiOjQ3LCJyb2xlcyI6WyJjbGllbnQiLCJ1c2VyIl0sImlkIjoxMjYyNCwiZXhwIjoxNjM1NDEwMjk1LCJpYXQiOjE2MzUyMzc0OTV9.thmdSfvh_YQjenTIwBOhS52GxHiZ4AzY7PJqneOGHu8WNYoSXgePA5b1zk1wR-r5SllTWj9xMT72UnBMzbIKLg') | ||
@@ -9,0 +9,0 @@ import SBXRequest from "sbx-client-request"; |
180430
1950