Skip to content

Commit

Permalink
chore(refactor): start signup cleanup (#6221)
Browse files Browse the repository at this point in the history
  • Loading branch information
mperdomo-bc committed Jan 23, 2024
1 parent ddb3cc0 commit 5cae227
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 177 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,56 +71,54 @@ const BuyGoal = (props: InjectedFormProps<{}> & SubviewProps) => {
}, [])

return (
<>
<CardsWrapper>
<BuyCard>
<PaddingWrapper>
<CardHeader>
<Text size='24px' color='textBlack' weight={600}>
<CardsWrapper>
<BuyCard>
<PaddingWrapper>
<CardHeader>
<Text size='24px' color='textBlack' weight={600}>
<FormattedMessage
defaultMessage='Sign Up to Continue Your Crypto Purchase.'
id='scenes.register.simplebuy.signup'
/>
</Text>
</CardHeader>
{showBuyHeader && isCoinDataLoaded && (
<>
<BuyItemWrapper>
<AmountWrapper>
<SimpleWrapper>
<Text size='16px' color='grey400' weight={500}>
{Currencies[fiatCurrency].units[fiatCurrency].symbol}
</Text>
<Amount size='16px' color='black' weight={500}>
{amount}
</Amount>
</SimpleWrapper>
</AmountWrapper>
<CryptoWrapper>
<Icon color={crypto} name={crypto} size='24px' weight={400} />
<Text capitalize color='black' size='16px' weight={500}>
{window.coins[crypto].coinfig.name}
</Text>
<Text color='grey400' size='16px' uppercase weight={500}>
{crypto}
</Text>
</CryptoWrapper>
</BuyItemWrapper>

<Text size='14px' color='grey600' weight={500}>
<FormattedMessage
defaultMessage='Sign Up to Continue Your Crypto Purchase.'
id='scenes.register.simplebuy.signup'
id='scenes.register.simplebuy.change'
defaultMessage='You will be able to change your amount later.'
/>
</Text>
</CardHeader>
{showBuyHeader && isCoinDataLoaded && (
<>
<BuyItemWrapper>
<AmountWrapper>
<SimpleWrapper>
<Text size='16px' color='grey400' weight={500}>
{Currencies[fiatCurrency].units[fiatCurrency].symbol}
</Text>
<Amount size='16px' color='black' weight={500}>
{amount}
</Amount>
</SimpleWrapper>
</AmountWrapper>
<CryptoWrapper>
<Icon color={crypto} name={crypto} size='24px' weight={400} />
<Text capitalize color='black' size='16px' weight={500}>
{window.coins[crypto].coinfig.name}
</Text>
<Text color='grey400' size='16px' uppercase weight={500}>
{crypto}
</Text>
</CryptoWrapper>
</BuyItemWrapper>

<Text size='14px' color='grey600' weight={500}>
<FormattedMessage
id='scenes.register.simplebuy.change'
defaultMessage='You will be able to change your amount later.'
/>
</Text>
</>
)}
<SignupForm {...props} />
</PaddingWrapper>
<LoginLink />
</BuyCard>
</CardsWrapper>
</>
</>
)}
<SignupForm {...props} />
</PaddingWrapper>
<LoginLink />
</BuyCard>
</CardsWrapper>
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import React from 'react'
import { FormattedMessage } from 'react-intl'
import { useDispatch } from 'react-redux'
import styled from 'styled-components'

import { Button, Image, Text } from 'blockchain-info-components'
import { Image, Text } from 'blockchain-info-components'
import { Wrapper } from 'components/Public'
import { actions, selectors } from 'data'
import { useRemote } from 'hooks'
import { isMobile } from 'services/styles'

const ContentWrapper = styled.div`
display: flex;
Expand All @@ -17,15 +13,6 @@ const ContentWrapper = styled.div`
`

const MigrationError = () => {
// Add check here to make sure that there is wallet data
// route should navigate to login if there's no wallet data

const {
data: isMigrated,
hasError: isAssociatedError,
isLoading: isAssociatedLoading
} = useRemote(selectors.modules.profile.getSofiAssociateNabuUserStatus)

return (
<Wrapper>
<ContentWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Icon, Text } from 'blockchain-info-components'
import { isMobile } from 'services/styles'

import { SubviewProps } from '../../types'
import { Card, CardTitle, CardWrapper, InfoItem, InfoTitle } from '..'
import { Card, CardTitle, CardWrapper } from '..'
import QRsModal, { QRModalType } from '../SignupForm/QRsModal'
import SofiSignupForm from '../SofiSignupForm'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,11 @@ const SofiSignupForm = (props: Props) => {
bakktRedirectUSStates,
formActions,
formValues,
goals,
initialValues,
invalid,
isFormSubmitting,
onSignupSubmit,
routerActions,
setShowModal
routerActions
} = props

const { sofiJwtPayload } = useSelector(selectors.modules.profile.getSofiUserData).getOrElse(
Expand Down Expand Up @@ -244,6 +242,6 @@ const SofiSignupForm = (props: Props) => {
)
}

type Props = InjectedFormProps<{}> & SubviewProps & { setShowModal?: (e) => void }
type Props = InjectedFormProps<{}> & SubviewProps

export default SofiSignupForm

0 comments on commit 5cae227

Please sign in to comment.