Skip to content

Commit

Permalink
Merge branch 'development' into fix/mobile-login-camera-close
Browse files Browse the repository at this point in the history
  • Loading branch information
schnogz committed Mar 1, 2019
2 parents 4e14552 + 5e081e3 commit 23429dc
Show file tree
Hide file tree
Showing 15 changed files with 695 additions and 310 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const Footer = styled.div`

const FooterShadowWrapper = ({ fields, footer, ...rest }) => (
<Container {...rest}>
<Fields>{fields}</Fields>
<Fields id={rest.scrollRefId}>{fields}</Fields>
<Footer>{footer}</Footer>
</Container>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ exports[`TierCard renders correctly with column view 1`] = `
nature="primary"
>
<FormattedMessage
defaultMessage="Unlock Gold"
id="components.identityverification.tiercard.goldcta"
defaultMessage="Unlock Gold 🥇"
id="components.identityverification.tiercard.goldctamedal"
values={Object {}}
/>
</TierCard__ActionButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ export const ctas = {
),
GOLD: (
<FormattedMessage
id='components.identityverification.tiercard.goldcta'
defaultMessage='Unlock Gold'
id='components.identityverification.tiercard.goldctamedal'
defaultMessage='Unlock Gold 🥇'
/>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,23 @@ export const ORDER_ERROR = 'Amount exceeds maximum trade size'
export const LATEST_TX_ERROR = 'Unconfirmed tx pending'
export const LATEST_TX_FETCH_FAILED_ERROR = 'Failed to fetch latest tx data'
export const MISSING_DEVICE_ERROR = 'missing_device'
export const NO_TRADE_PERMISSION = 'NO_TRADE_PERMISSION'
export const CREATE_ACCOUNT_ERROR = 'Not enough funds to create new account'
export const NO_ACCOUNT_ERROR = 'Account does not exist'
export const RESERVE_ERROR = 'Reserve exceeds remaining funds'
export const NO_TRADE_PERMISSION = 'NO_TRADE_PERMISSION'
export const ORDER_BELOW_MIN_LIMIT = 'ORDER_BELOW_MIN_LIMIT'
export const ORDER_ABOVE_MAX_LIMIT = 'ORDER_ABOVE_MAX_LIMIT'
export const DAILY_LIMIT_EXCEEDED = 'DAILY_LIMIT_EXCEEDED'
export const WEEKLY_LIMIT_EXCEEDED = 'WEEKLY_LIMIT_EXCEEDED'
export const ANNUAL_LIMIT_EXCEEDED = 'ANNUAL_LIMIT_EXCEEDED'

export const SWAP_ERROR_CODES = {
41: ORDER_BELOW_MIN_LIMIT,
43: ORDER_ABOVE_MAX_LIMIT,
45: DAILY_LIMIT_EXCEEDED,
46: WEEKLY_LIMIT_EXCEEDED,
47: ANNUAL_LIMIT_EXCEEDED
}

const currenciesOrder = ['BTC', 'ETH', 'BCH', 'XLM', 'BSV']
export const sortByOrder = sortBy(flip(indexOf)(currenciesOrder))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import Personal from './template'
import Loading from './template.loading'
import DataError from 'components/DataError'

export const SCROLL_REF_ID = 'scroll-ref-id'

const getCountryElements = countries => [
{
group: '',
Expand All @@ -36,6 +38,11 @@ class PersonalContainer extends React.PureComponent {
this.fetchData()
}

scrollTop = () => {
const overflowElement = document.getElementById(SCROLL_REF_ID)
overflowElement.scrollTop = 0
}

fetchData = () => {
this.props.actions.fetchSupportedCountries()
this.props.actions.fetchStates()
Expand All @@ -52,6 +59,12 @@ class PersonalContainer extends React.PureComponent {
this.props.formActions.clearFields(PERSONAL_FORM, false, false, 'state')
}

onPromptForEmailVerification = e => {
e.preventDefault()
this.scrollTop()
this.setState({ showEmailError: true })
}

editEmail = () => {
this.props.actions.setEmailStep(EMAIL_STEPS.edit)
}
Expand Down Expand Up @@ -88,6 +101,7 @@ class PersonalContainer extends React.PureComponent {
email: initialEmail
}}
showEmail={!this.state.initialEmailVerified}
showEmailError={!emailVerified && this.state.showEmailError}
emailVerified={emailVerified}
email={email}
emailStep={emailStep}
Expand All @@ -103,7 +117,8 @@ class PersonalContainer extends React.PureComponent {
activeFieldError={activeFieldError}
editEmail={this.editEmail}
updateEmail={actions.updateEmail}
sendEmailVerification={actions.sendEmailVerification}
sendEmailVerification={this.onSendEmailVerification}
onPromptForEmailVerification={this.onPromptForEmailVerification}
onAddressSelect={this.selectAddress}
onCountrySelect={this.onCountryChange}
onSubmit={handleSubmit}
Expand Down
Loading

0 comments on commit 23429dc

Please sign in to comment.