Adds phone svg

Updates design of payment methods
This commit is contained in:
apane 2019-10-08 16:38:03 -03:00 committed by David Sun
parent 5130259552
commit 1cf8663f20
4 changed files with 47 additions and 16 deletions

View File

@ -1,5 +1,6 @@
import * as React from 'react'; import * as React from 'react';
import PhoneIconSvg from '../assets/icons/phone.svg';
import { ColorOption } from '../style/theme'; import { ColorOption } from '../style/theme';
import { Account, AccountState, Network, ProviderType } from '../types'; import { Account, AccountState, Network, ProviderType } from '../types';
import { envUtil } from '../util/env'; import { envUtil } from '../util/env';
@ -11,7 +12,6 @@ import { SectionHeader } from './section_header';
import { Circle } from './ui/circle'; import { Circle } from './ui/circle';
import { Container } from './ui/container'; import { Container } from './ui/container';
import { Flex } from './ui/flex'; import { Flex } from './ui/flex';
import { Icon } from './ui/icon';
import { Text } from './ui/text'; import { Text } from './ui/text';
import { WalletPrompt } from './wallet_prompt'; import { WalletPrompt } from './wallet_prompt';
@ -30,7 +30,6 @@ export class PaymentMethod extends React.PureComponent<PaymentMethodProps> {
<Container marginBottom="12px"> <Container marginBottom="12px">
<Flex justify="space-between"> <Flex justify="space-between">
<SectionHeader>{this._renderTitleText()}</SectionHeader> <SectionHeader>{this._renderTitleText()}</SectionHeader>
{this._renderTitleLabel()}
</Flex> </Flex>
</Container> </Container>
<Container>{this._renderMainContent()}</Container> <Container>{this._renderMainContent()}</Container>
@ -70,7 +69,7 @@ export class PaymentMethod extends React.PureComponent<PaymentMethodProps> {
const { account, network } = this.props; const { account, network } = this.props;
const isMobile = envUtil.isMobileOperatingSystem(); const isMobile = envUtil.isMobileOperatingSystem();
const logo = isMobile ? <CoinbaseWalletLogo width={22} /> : <MetaMaskLogo width={19} height={18} />; const logo = isMobile ? <CoinbaseWalletLogo width={22} /> : <MetaMaskLogo width={19} height={18} />;
const primaryColor = isMobile ? ColorOption.darkBlue : ColorOption.darkOrange; const primaryColor = isMobile ? ColorOption.darkBlue : ColorOption.grey;
const secondaryColor = isMobile ? ColorOption.lightBlue : ColorOption.lightOrange; const secondaryColor = isMobile ? ColorOption.lightBlue : ColorOption.lightOrange;
const colors = { primaryColor, secondaryColor }; const colors = { primaryColor, secondaryColor };
const onUnlockGenericWallet = () => { const onUnlockGenericWallet = () => {
@ -82,25 +81,32 @@ export class PaymentMethod extends React.PureComponent<PaymentMethodProps> {
return null; return null;
case AccountState.Locked: case AccountState.Locked:
return ( return (
<Flex direction="column" justify="space-between" height="100%"> <Flex direction="column">
<WalletPrompt <WalletPrompt
onClick={onUnlockGenericWallet} onClick={onUnlockGenericWallet}
display="flex"
alignText={'flex-start'}
image={ image={
<Container position="relative" top="2px"> <Container position="relative" display="flex">
<Icon width={13} icon="lock" color={ColorOption.black} /> <MetaMaskLogo width={16} height={19} />
</Container> </Container>
} }
{...colors} {...colors}
> >
Click to Connect Metamask Metamask
</WalletPrompt> </WalletPrompt>
<WalletPrompt <WalletPrompt
onClick={onUnlockFormatic} onClick={onUnlockFormatic}
primaryColor={ColorOption.fortmaticPrimary}
secondaryColor={ColorOption.fortmaticSecondary}
marginTop="5px" marginTop="5px"
image={
<Container position="relative" display="flex">
<PhoneIconSvg />
</Container>
}
display="flex"
{...colors}
> >
Connect with Fortmatic Use phone number
</WalletPrompt> </WalletPrompt>
</Flex> </Flex>
); );
@ -112,11 +118,16 @@ export class PaymentMethod extends React.PureComponent<PaymentMethodProps> {
</WalletPrompt> </WalletPrompt>
<WalletPrompt <WalletPrompt
onClick={onUnlockFormatic} onClick={onUnlockFormatic}
primaryColor={ColorOption.fortmaticPrimary}
secondaryColor={ColorOption.fortmaticSecondary}
marginTop="5px" marginTop="5px"
image={
<Container position="relative" display="flex">
<PhoneIconSvg />
</Container>
}
display="flex"
{...colors}
> >
Connect with Fortmatic Use phone number
</WalletPrompt> </WalletPrompt>
</Flex> </Flex>
); );

View File

@ -75,6 +75,7 @@ export const Container = styled.div<ContainerProps>`
${props => cssRuleIfExists(props, 'opacity')} ${props => cssRuleIfExists(props, 'opacity')}
${props => cssRuleIfExists(props, 'cursor')} ${props => cssRuleIfExists(props, 'cursor')}
${props => cssRuleIfExists(props, 'overflow')} ${props => cssRuleIfExists(props, 'overflow')}
${props => cssRuleIfExists(props, 'alignSelf')}
${props => (props.overflow === 'scroll' ? `-webkit-overflow-scrolling: touch` : '')}; ${props => (props.overflow === 'scroll' ? `-webkit-overflow-scrolling: touch` : '')};
${props => (props.hasBoxShadow ? `box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1)` : '')}; ${props => (props.hasBoxShadow ? `box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1)` : '')};
${props => props.display && stylesForMedia<string>('display', props.display)} ${props => props.display && stylesForMedia<string>('display', props.display)}

View File

@ -19,6 +19,7 @@ interface IconInfoMapping {
failed: IconInfo; failed: IconInfo;
success: IconInfo; success: IconInfo;
chevron: IconInfo; chevron: IconInfo;
chevronRight: IconInfo;
search: IconInfo; search: IconInfo;
lock: IconInfo; lock: IconInfo;
} }
@ -52,6 +53,14 @@ const ICONS: IconInfoMapping = {
strokeLinecap: 'round', strokeLinecap: 'round',
strokeLinejoin: 'round', strokeLinejoin: 'round',
}, },
chevronRight: {
viewBox: '0 0 7 13',
path: 'M1 1.5L6 6.5L1 11.5',
strokeOpacity: 0.5,
strokeWidth: 1.5,
strokeLinecap: 'round',
strokeLinejoin: 'round',
},
search: { search: {
viewBox: '0 0 14 14', viewBox: '0 0 14 14',
fillRule: 'evenodd', fillRule: 'evenodd',
@ -89,6 +98,7 @@ const PlainIcon: React.StatelessComponent<IconProps> = props => {
viewBox={iconInfo.viewBox} viewBox={iconInfo.viewBox}
fill="none" fill="none"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
stroke={props.stroke}
> >
<path <path
d={iconInfo.path} d={iconInfo.path}

View File

@ -4,6 +4,7 @@ import { ColorOption } from '../style/theme';
import { Container } from './ui/container'; import { Container } from './ui/container';
import { Flex } from './ui/flex'; import { Flex } from './ui/flex';
import {Icon} from './ui/icon';
import { Text } from './ui/text'; import { Text } from './ui/text';
export interface WalletPromptProps { export interface WalletPromptProps {
@ -12,6 +13,8 @@ export interface WalletPromptProps {
primaryColor: ColorOption; primaryColor: ColorOption;
secondaryColor: ColorOption; secondaryColor: ColorOption;
marginTop?: string; marginTop?: string;
display?: string;
alignText?: string;
} }
export const WalletPrompt: React.StatelessComponent<WalletPromptProps> = ({ export const WalletPrompt: React.StatelessComponent<WalletPromptProps> = ({
@ -21,11 +24,13 @@ export const WalletPrompt: React.StatelessComponent<WalletPromptProps> = ({
secondaryColor, secondaryColor,
primaryColor, primaryColor,
marginTop, marginTop,
display,
alignText,
}) => ( }) => (
<Container <Container
padding="10px" padding="10px"
border={`1px solid`} border={`1px solid`}
borderColor={primaryColor} borderColor={ColorOption.feintGrey}
backgroundColor={secondaryColor} backgroundColor={secondaryColor}
width="100%" width="100%"
borderRadius="4px" borderRadius="4px"
@ -33,14 +38,18 @@ export const WalletPrompt: React.StatelessComponent<WalletPromptProps> = ({
cursor={onClick ? 'pointer' : undefined} cursor={onClick ? 'pointer' : undefined}
boxShadowOnHover={!!onClick} boxShadowOnHover={!!onClick}
marginTop={marginTop} marginTop={marginTop}
display={display}
> >
<Flex> <Flex width="100%">
{image} {image}
<Container marginLeft="10px"> <Container marginLeft="10px" display={display} width="100%" alignSelf={alignText}>
<Text fontSize="16px" fontColor={primaryColor} fontWeight="500"> <Text fontSize="16px" fontColor={primaryColor} fontWeight="500">
{children} {children}
</Text> </Text>
</Container> </Container>
<Container position="relative" top="2px" display={display}>
<Icon width={13} icon="chevronRight" stroke="#AAAAAA" />
</Container>
</Flex> </Flex>
</Container> </Container>
); );