Skip to content

Commit

Permalink
settings account pro
Browse files Browse the repository at this point in the history
  • Loading branch information
bukinoshita committed Feb 13, 2018
1 parent c0a11fb commit 76de148
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
15 changes: 9 additions & 6 deletions renderer/components/settings/identity.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,29 @@ import ButtonLink from './../../ui/button-link'
// Theme
import { colors, typography } from './../../theme'

const Identity = ({ username, email }) => {
const Identity = ({ user }) => {
return (
<div className="user">
<div>
{username && email ? (
{user &&
user.username &&
user.email &&
!user.subscription.trial.ended ? (
<div>
<div className="avatar">
{renderHTML(
reactHashAvatar(username, { size: 75, radius: '50px' })
reactHashAvatar(user.username, { size: 75, radius: '50px' })
)}
<h4>{username.substring(0, 2)}</h4>
<h4>{user.username.substring(0, 2)}</h4>

<div className="badge">Pro</div>
</div>

<h3>
Your username is <span className="strong">{username}</span>
Your username is <span className="strong">{user.username}</span>
</h3>

<span className="email">{email}</span>
<span className="email">{user.email}</span>
</div>
) : (
<div>
Expand Down
9 changes: 5 additions & 4 deletions renderer/pages/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ class Settings extends Component {
const { createOn } = user
const tabSelected = tab ? tab : 'Identity'

console.log(user)

this.setState({
defaultOption: createOn,
tabSelected,
email: user.email,
username: user.username
user
})
}

Expand Down Expand Up @@ -92,7 +93,7 @@ class Settings extends Component {

render() {
let content
const { tabSelected, defaultOption, username, email } = this.state
const { tabSelected, defaultOption, user } = this.state
const list = [
{ name: 'Identity', href: '/settings?tab=Identity' },
{ name: 'Account', href: '/settings?tab=Account' },
Expand All @@ -102,7 +103,7 @@ class Settings extends Component {

switch (tabSelected) {
case 'Identity':
content = <Identity username={username} email={email} />
content = <Identity user={user} />
break

case 'Account':
Expand Down

0 comments on commit 76de148

Please sign in to comment.