Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/v0.29.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
yknl committed Jun 28, 2018
2 parents 98a5650 + 57134b6 commit 5b905ce
Show file tree
Hide file tree
Showing 18 changed files with 550 additions and 281 deletions.
15 changes: 11 additions & 4 deletions app/js/account/store/account/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@ import log4js from 'log4js'

const logger = log4js.getLogger('account/store/account/actions.js')

const doVerifyRecoveryCode = () => dispatch =>
dispatch({
type: types.RECOVERY_CODE_VERIFIED
})

const doVerifyRecoveryCode = () => (dispatch) => dispatch({
type: types.RECOVERY_CODE_VERIFIED
})
const updateEmail = email => dispatch =>
dispatch({
type: types.UPDATE_EMAIL_ADDRESS,
email
})

function createAccount(
encryptedBackupPhrase,
Expand Down Expand Up @@ -522,7 +528,8 @@ const AccountActions = {
incrementIdentityAddressIndex,
usedIdentityAddress,
displayedRecoveryCode,
newIdentityAddress
newIdentityAddress,
updateEmail
}

export default AccountActions
5 changes: 5 additions & 0 deletions app/js/account/store/account/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ function AccountReducer(state = initialState, action) {
balances: state.bitcoinAccount.balances
}
})
case types.UPDATE_EMAIL_ADDRESS:
return {
...state,
email: action.email
}
case types.RECOVERY_CODE_VERIFIED:
return {
...state,
Expand Down
1 change: 1 addition & 0 deletions app/js/account/store/account/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ export const VIEWED_RECOVERY_CODE = 'account/VIEWED_RECOVERY_CODE' // legacy
export const RECOVERY_CODE_VERIFIED = 'account/RECOVERY_CODE_VERIFIED'
export const INCREMENT_IDENTITY_ADDRESS_INDEX = 'account/INCREMENT_IDENTITY_ADDRESS_INDEX'
export const CONNECTED_STORAGE = 'account/CONNECTED_STORAGE'
export const UPDATE_EMAIL_ADDRESS = 'account/UPDATE_EMAIL_ADDRESS'
2 changes: 1 addition & 1 deletion app/js/components/ui/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const trans = css`

const firstLetter = string => string.charAt(0)

const stringToColor = string => {
const stringToColor = (string = 'undefined_default_color') => {
let hash = 0
let color = '#'

Expand Down
71 changes: 39 additions & 32 deletions app/js/profiles/components/SocialAccountItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ class SocialAccountItem extends Component {
if (webAccountTypes[this.props.service].hasOwnProperty('urlTemplate')) {
const urlTemplate = webAccountTypes[this.props.service].urlTemplate
if (urlTemplate) {
accountUrl = urlTemplate.replace('{identifier}', this.props.identifier)
accountUrl = urlTemplate.replace(
'{identifier}',
this.props.identifier
)
}
}
}
Expand All @@ -66,21 +69,19 @@ class SocialAccountItem extends Component {
}

getPlaceholderText(service) {
if(service === 'bitcoin' || service === 'ethereum') {
if (service === 'bitcoin' || service === 'ethereum') {
return (
<span className="app-account-service font-weight-normal">
Prove your <span className="text-capitalize">{service}</span> address
</span>
)
}
else if (service === 'pgp' || service === 'ssh') {
} else if (service === 'pgp' || service === 'ssh') {
return (
<span className="app-account-service font-weight-normal">
Prove your {service.toUpperCase()} key
</span>
)
}
else {
} else {
return (
<span className="app-account-service font-weight-normal">
Prove your <span className="text-capitalize">{service}</span> account
Expand All @@ -93,26 +94,34 @@ class SocialAccountItem extends Component {
this.props.onClick(this.props.service)
}

onVerifiedCheckmarkClick = (e) => {
onVerifiedCheckmarkClick = e => {
e.preventDefault()
e.stopPropagation()
openInNewTab(this.props.proofUrl)
}

render() {
const { verified, pending, placeholder } = this.props
const webAccountTypes = getWebAccountTypes(this.props.api)
const webAccountType = webAccountTypes[this.props.service]
const verified = this.props.verified
const pending = this.props.pending
const verifiedClass = verified ? 'verified' : 'pending'
const placeholderClass = this.props.placeholder ? 'placeholder' : ''
const placeholderClass = placeholder ? 'placeholder' : ''

const EditButton = () => (
<span className="">
<i className="fa fa-fw fa-pencil" />
</span>
)

if (webAccountType) {
const accountServiceName = webAccountType.label
if (this.props.listItem === true) {
return (
<li className={`clickable ${verifiedClass} ${placeholderClass}`} onClick={this.onClick}>
{!pending &&
<li
className={`clickable ${verifiedClass} ${placeholderClass}`}
onClick={this.onClick}
>
{!pending && (
<ReactTooltip
place="top"
type="dark"
Expand All @@ -122,7 +131,7 @@ class SocialAccountItem extends Component {
>
{verified && 'Verified'}
</ReactTooltip>
}
)}

<span className="app-account-icon">
<i className={`fa fa-fw ${this.getIconClass()} fa-lg`} />
Expand All @@ -134,25 +143,21 @@ class SocialAccountItem extends Component {
</span>
)}

{(!this.props.placeholder && this.props.editing) && (
<span className="">
<i className="fa fa-fw fa-pencil" />
</span>
)}
{!this.props.placeholder && this.props.editing && <EditButton />}

{!this.props.placeholder && (
{!placeholder && (
<span className="app-account-service font-weight-normal">
{`@${accountServiceName}`}
</span>
)}

{this.props.placeholder && (
{placeholder && (
<span className="app-account-service font-weight-normal">
{this.getPlaceholderText(this.props.service)}
</span>
)}

{verified &&
{verified && (
<span
className="float-right status"
data-tip
Expand All @@ -161,13 +166,18 @@ class SocialAccountItem extends Component {
>
<i className="fa fa-fw fa-check-circle fa-lg" />
</span>
}
{!verified &&
(this.props.placeholder) ?
<span className="float-right star">+1<i className="fa fa-w fa-star-o" /></span>
:
<span className="float-right badge badge-danger badge-verification">Unverified</span>
}
)}
{!verified && placeholder ? (
<span className="float-right star">
+1<i className="fa fa-w fa-star-o" />
</span>
) : (
!verified && (
<span className="float-right badge badge-danger badge-verification">
Unverified
</span>
)
)}
</li>
)
} else {
Expand All @@ -179,10 +189,7 @@ class SocialAccountItem extends Component {
)
}
} else {
return (
<span>
</span>
)
return <span />
}
}
}
Expand Down
Loading

0 comments on commit 5b905ce

Please sign in to comment.