From 3e158fb2b4dabecf473f0305f70a4381ce1cf517 Mon Sep 17 00:00:00 2001 From: Anastasia Poupeney Date: Mon, 9 Jul 2018 18:31:33 +0200 Subject: [PATCH] adding 2 new exchanges, extracting urls and making them more general --- src/components/ExchangePage/index.js | 21 +++++++-- src/components/ExchangePage/logos/paybis.js | 46 +++++++++++++++++++ src/components/ExchangePage/logos/simplex.js | 27 +++++++++++ src/components/FeesField/GenericContainer.js | 2 +- src/components/ManagerPage/index.js | 2 +- src/components/Onboarding/steps/Finish.js | 2 +- .../Onboarding/steps/GenuineCheck/index.js | 4 +- src/components/Onboarding/steps/NoDevice.js | 2 +- src/components/SettingsPage/sections/About.js | 2 +- src/components/SettingsPage/sections/Help.js | 2 +- src/components/modals/Receive/index.js | 4 +- .../modals/Send/fields/RecipientField.js | 2 +- src/config/{support.js => urls.js} | 16 +++++-- static/i18n/en/app.yml | 2 + 14 files changed, 115 insertions(+), 19 deletions(-) create mode 100644 src/components/ExchangePage/logos/paybis.js create mode 100644 src/components/ExchangePage/logos/simplex.js rename src/config/{support.js => urls.js} (66%) diff --git a/src/components/ExchangePage/index.js b/src/components/ExchangePage/index.js index f3b770fc..ed5f4ed2 100644 --- a/src/components/ExchangePage/index.js +++ b/src/components/ExchangePage/index.js @@ -4,6 +4,7 @@ import React, { PureComponent } from 'react' import { translate } from 'react-i18next' import type { T } from 'types/common' +import { urls } from 'config/urls' import TrackPage from 'analytics/TrackPage' import Box from 'components/base/Box' @@ -12,6 +13,8 @@ import ExchangeCard from './ExchangeCard' import CoinhouseLogo from './logos/coinhouse' import ChangellyLogo from './logos/changelly' import CoinmamaLogo from './logos/bigmama' +import SimplexLogo from './logos/simplex' +import PaybisLogo from './logos/paybis' type Props = { t: T, @@ -21,21 +24,33 @@ const cards = [ { key: 'coinhouse', id: 'coinhouse', - url: 'https://www.coinhouse.com/r/157530', + url: urls.coinbase, logo: , }, { key: 'changelly', id: 'changelly', - url: 'https://changelly.com/?ref_id=aac789605a01', + url: urls.changelly, logo: , }, { key: 'coinmama', id: 'coinmama', - url: 'http://go.coinmama.com/visit/?bta=51801&nci=5343', + url: urls.coinmama, logo: , }, + { + key: 'simplex', + id: 'simplex', + url: urls.simplex, + logo: , + }, + { + key: 'paybis', + id: 'paybis', + url: urls.paybis, + logo: , + }, ] class ExchangePage extends PureComponent { diff --git a/src/components/ExchangePage/logos/paybis.js b/src/components/ExchangePage/logos/paybis.js new file mode 100644 index 00000000..2c6336ac --- /dev/null +++ b/src/components/ExchangePage/logos/paybis.js @@ -0,0 +1,46 @@ +// @flow + +import React, { Fragment } from 'react' + +const inner = ( + + + + + + + + + + + + + + + + +) + +export default ({ width, height }: { width: number, height: number }) => ( + + {inner} + +) diff --git a/src/components/ExchangePage/logos/simplex.js b/src/components/ExchangePage/logos/simplex.js new file mode 100644 index 00000000..94d68a37 --- /dev/null +++ b/src/components/ExchangePage/logos/simplex.js @@ -0,0 +1,27 @@ +// @flow + +import React, { Fragment } from 'react' + +const inner = ( + + + + + +) + +export default ({ width, height }: { width: number, height: number }) => ( + + {inner} + +) diff --git a/src/components/FeesField/GenericContainer.js b/src/components/FeesField/GenericContainer.js index aa4a857d..af1d9c67 100644 --- a/src/components/FeesField/GenericContainer.js +++ b/src/components/FeesField/GenericContainer.js @@ -6,7 +6,7 @@ import Box from 'components/base/Box' import LabelWithExternalIcon from 'components/base/LabelWithExternalIcon' import { translate } from 'react-i18next' import { openURL } from 'helpers/linking' -import { urls } from 'config/support' +import { urls } from 'config/urls' import { track } from 'analytics/segment' export default translate()(({ children, t }: { children: React$Node, t: * }) => ( diff --git a/src/components/ManagerPage/index.js b/src/components/ManagerPage/index.js index 7a755bbd..956d7c90 100644 --- a/src/components/ManagerPage/index.js +++ b/src/components/ManagerPage/index.js @@ -3,7 +3,7 @@ import React, { PureComponent, Fragment } from 'react' import invariant from 'invariant' import { openURL } from 'helpers/linking' -import { urls } from 'config/support' +import { urls } from 'config/urls' import type { Device } from 'types/common' import type { DeviceInfo } from 'helpers/devices/getDeviceInfo' diff --git a/src/components/Onboarding/steps/Finish.js b/src/components/Onboarding/steps/Finish.js index 80b3c2a1..da9155be 100644 --- a/src/components/Onboarding/steps/Finish.js +++ b/src/components/Onboarding/steps/Finish.js @@ -4,7 +4,7 @@ import React, { Component } from 'react' import { openURL } from 'helpers/linking' import styled from 'styled-components' import { i } from 'helpers/staticPath' -import { urls } from 'config/support' +import { urls } from 'config/urls' import Box from 'components/base/Box' import Button from 'components/base/Button' diff --git a/src/components/Onboarding/steps/GenuineCheck/index.js b/src/components/Onboarding/steps/GenuineCheck/index.js index 0518d0ee..10ed1bbb 100644 --- a/src/components/Onboarding/steps/GenuineCheck/index.js +++ b/src/components/Onboarding/steps/GenuineCheck/index.js @@ -5,7 +5,7 @@ import { openURL } from 'helpers/linking' import { connect } from 'react-redux' import styled from 'styled-components' import { colors } from 'styles/theme' -import { urls } from 'config/support' +import { urls } from 'config/urls' import { updateGenuineCheck } from 'reducers/onboarding' @@ -144,7 +144,7 @@ class GenuineCheck extends PureComponent { } contactSupport = () => { - openURL(urls.genuineCheckContactSupport) + openURL(urls.contactSupport) } handlePrevStep = () => { diff --git a/src/components/Onboarding/steps/NoDevice.js b/src/components/Onboarding/steps/NoDevice.js index abe35227..29c8cfbd 100644 --- a/src/components/Onboarding/steps/NoDevice.js +++ b/src/components/Onboarding/steps/NoDevice.js @@ -7,7 +7,7 @@ import { i } from 'helpers/staticPath' import Box from 'components/base/Box' import GrowScroll from 'components/base/GrowScroll' import TrackPage from 'analytics/TrackPage' -import { urls } from 'config/support' +import { urls } from 'config/urls' import IconCart from 'icons/Cart' import IconTruck from 'icons/Truck' import IconInfoCircle from 'icons/InfoCircle' diff --git a/src/components/SettingsPage/sections/About.js b/src/components/SettingsPage/sections/About.js index 407f29b2..3a5f8a82 100644 --- a/src/components/SettingsPage/sections/About.js +++ b/src/components/SettingsPage/sections/About.js @@ -6,7 +6,7 @@ import { translate } from 'react-i18next' import type { T } from 'types/common' import TrackPage from 'analytics/TrackPage' -import { urls } from 'config/support' +import { urls } from 'config/urls' import IconLoader from 'icons/Loader' import ReleaseNotesButton from '../ReleaseNotesButton' diff --git a/src/components/SettingsPage/sections/Help.js b/src/components/SettingsPage/sections/Help.js index cfd1ceb6..685721af 100644 --- a/src/components/SettingsPage/sections/Help.js +++ b/src/components/SettingsPage/sections/Help.js @@ -6,7 +6,7 @@ import type { T } from 'types/common' import TrackPage from 'analytics/TrackPage' import IconHelp from 'icons/Help' import resolveLogsDirectory from 'helpers/resolveLogsDirectory' -import { urls } from 'config/support' +import { urls } from 'config/urls' import ExportLogsBtn from 'components/ExportLogsBtn' import CleanButton from '../CleanButton' diff --git a/src/components/modals/Receive/index.js b/src/components/modals/Receive/index.js index 77d4e1ca..a025471e 100644 --- a/src/components/modals/Receive/index.js +++ b/src/components/modals/Receive/index.js @@ -13,7 +13,7 @@ import type { Account } from '@ledgerhq/live-common/lib/types' import { MODAL_RECEIVE } from 'config/constants' import { openURL } from 'helpers/linking' -import { urls } from 'config/support' +import { urls } from 'config/urls' import type { T, Device } from 'types/common' import type { StepProps as DefaultStepProps } from 'components/base/Stepper' @@ -133,7 +133,7 @@ class ReceiveModal extends PureComponent { isAppOpened: false, }) handleContactUs = () => { - openURL(urls.receiveFlowContactSupport) + openURL(urls.contactSupport) } handleReset = () => this.setState({ ...INITIAL_STATE }) diff --git a/src/components/modals/Send/fields/RecipientField.js b/src/components/modals/Send/fields/RecipientField.js index 1313d0aa..d1615bea 100644 --- a/src/components/modals/Send/fields/RecipientField.js +++ b/src/components/modals/Send/fields/RecipientField.js @@ -4,7 +4,7 @@ import type { Account } from '@ledgerhq/live-common/lib/types' import type { T } from 'types/common' import type { WalletBridge } from 'bridge/types' import { openURL } from 'helpers/linking' -import { urls } from 'config/support' +import { urls } from 'config/urls' import Box from 'components/base/Box' import LabelWithExternalIcon from 'components/base/LabelWithExternalIcon' import RecipientAddress from 'components/RecipientAddress' diff --git a/src/config/support.js b/src/config/urls.js similarity index 66% rename from src/config/support.js rename to src/config/urls.js index fc642029..07de6762 100644 --- a/src/config/support.js +++ b/src/config/urls.js @@ -1,21 +1,27 @@ // @flow export const urls = { + // Social twitter: 'https://twitter.com/LedgerHQ', github: 'https://github.com/LedgerHQ/ledger-live-desktop', reddit: 'https://www.reddit.com/r/ledgerwallet/', + + // Ledger support faq: 'https://support.ledgerwallet.com/hc/en-us', terms: 'https://www.ledgerwallet.com/terms', noDeviceBuyNew: 'https://www.ledgerwallet.com/', noDeviceTrackOrder: 'http://order.ledgerwallet.com/', noDeviceLearnMore: 'https://www.ledgerwallet.com/', managerHelpRequest: 'https://support.ledgerwallet.com/hc/en-us/articles/360006523674 ', - genuineCheckContactSupport: - 'https://support.ledgerwallet.com/hc/en-us/requests/new?ticket_form_id=248165', + contactSupport: 'https://support.ledgerwallet.com/hc/en-us/requests/new?ticket_form_id=248165', feesMoreInfo: 'https://support.ledgerwallet.com/hc/en-us/articles/360006535873', recipientAddressInfo: 'https://support.ledgerwallet.com/hc/en-us/articles/360006433934', - // should join and generalize naming for the same urls once defined - receiveFlowContactSupport: - 'https://support.ledgerwallet.com/hc/en-us/requests/new?ticket_form_id=248165', privacyPolicy: 'https://www.ledgerwallet.com/privacy-policy', + + // Exchanges + coinbase: 'https://www.coinhouse.com/r/157530', + changelly: 'https://changelly.com/?ref_id=aac789605a01', + coinmama: 'http://go.coinmama.com/visit/?bta=51801&nci=5343', + simplex: 'https://www.simplex.com/', + paybis: 'https://paybis.com/', } diff --git a/static/i18n/en/app.yml b/static/i18n/en/app.yml index 13c73942..c9a8a73c 100644 --- a/static/i18n/en/app.yml +++ b/static/i18n/en/app.yml @@ -152,6 +152,8 @@ exchange: coinhouse: 'Coinhouse is a trusted platform for individuals and institutional investors looking to analyze, acquire, sell and securely store crypto assets.' changelly: 'Changelly is a popular instant crypto asset exchange with 100+ coins and tokens listed.' coinmama: 'Coinmama is a financial service that makes it fast, safe and fun to buy digital assets, anywhere in the world.' + simplex: 'Simplex is a EU licensed financial institution, providing a fraudless credit card payment solution.' + paybis: 'it is safe and easy to Buy Bitcoin with credit card from PayBis. Service operates inĀ US, Canada, Germany, Russia and Saudi Arabia.' genuinecheck: modal: title: Genuine check