From 1cb862e957214ceada905ab87b1771a95597e2e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Tue, 3 Jul 2018 21:09:58 +0200 Subject: [PATCH] centralize all the support urls to a same place --- src/components/Onboarding/steps/Finish.js | 7 ++++--- .../Onboarding/steps/GenuineCheck/index.js | 5 ++--- src/components/Onboarding/steps/NoDevice.js | 7 ++++--- src/components/SettingsPage/sections/About.js | 5 +++-- src/config/support.js | 15 +++++++++++++++ 5 files changed, 28 insertions(+), 11 deletions(-) create mode 100644 src/config/support.js diff --git a/src/components/Onboarding/steps/Finish.js b/src/components/Onboarding/steps/Finish.js index 360d70ae..630a5e20 100644 --- a/src/components/Onboarding/steps/Finish.js +++ b/src/components/Onboarding/steps/Finish.js @@ -4,6 +4,7 @@ import React, { Component } from 'react' import { shell } from 'electron' import styled from 'styled-components' import { i } from 'helpers/staticPath' +import { urls } from 'config/support' import Box from 'components/base/Box' import Button from 'components/base/Button' @@ -32,19 +33,19 @@ const socialMedia = [ // FIXME it should just be vdom in place { key: 'twitter', - url: 'https://twitter.com/LedgerHQ', + url: urls.twitter, icon: , onClick: url => shell.openExternal(url), }, { key: 'github', - url: 'https://github.com/LedgerHQ/ledger-live-desktop', + url: urls.github, icon: , onClick: url => shell.openExternal(url), }, { key: 'reddit', - url: 'https://www.reddit.com/r/ledgerwallet/', + url: urls.reddit, icon: , onClick: url => shell.openExternal(url), }, diff --git a/src/components/Onboarding/steps/GenuineCheck/index.js b/src/components/Onboarding/steps/GenuineCheck/index.js index 6ac42156..42ee7376 100644 --- a/src/components/Onboarding/steps/GenuineCheck/index.js +++ b/src/components/Onboarding/steps/GenuineCheck/index.js @@ -5,6 +5,7 @@ import { shell } from 'electron' import { connect } from 'react-redux' import styled from 'styled-components' import { colors } from 'styles/theme' +import { urls } from 'config/support' import { updateGenuineCheck } from 'reducers/onboarding' @@ -143,9 +144,7 @@ class GenuineCheck extends PureComponent { } contactSupport = () => { - const contactSupportUrl = - 'https://support.ledgerwallet.com/hc/en-us/requests/new?ticket_form_id=248165' - shell.openExternal(contactSupportUrl) + shell.openExternal(urls.genuineCheckContactSupport) } handlePrevStep = () => { diff --git a/src/components/Onboarding/steps/NoDevice.js b/src/components/Onboarding/steps/NoDevice.js index ad05e7de..8a9af8a2 100644 --- a/src/components/Onboarding/steps/NoDevice.js +++ b/src/components/Onboarding/steps/NoDevice.js @@ -7,6 +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 IconCart from 'icons/Cart' import IconTruck from 'icons/Truck' import IconInfoCircle from 'icons/InfoCircle' @@ -26,7 +27,7 @@ class NoDevice extends PureComponent { icon: , title: t('onboarding:noDevice.buyNew.title'), onClick: () => { - shell.openExternal('https://www.ledgerwallet.com/') + shell.openExternal(urls.noDeviceBuyNew) }, }, { @@ -34,7 +35,7 @@ class NoDevice extends PureComponent { icon: , title: t('onboarding:noDevice.trackOrder.title'), onClick: () => { - shell.openExternal('http://order.ledgerwallet.com/') + shell.openExternal(urls.noDeviceTrackOrder) }, }, { @@ -42,7 +43,7 @@ class NoDevice extends PureComponent { icon: , title: t('onboarding:noDevice.learnMore.title'), onClick: () => { - shell.openExternal('https://www.ledgerwallet.com/') + shell.openExternal(urls.noDeviceLearnMore) }, }, ] diff --git a/src/components/SettingsPage/sections/About.js b/src/components/SettingsPage/sections/About.js index 17b9ffeb..4e89356e 100644 --- a/src/components/SettingsPage/sections/About.js +++ b/src/components/SettingsPage/sections/About.js @@ -6,6 +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 ExportLogsBtn from 'components/ExportLogsBtn' import CleanButton from '../CleanButton' @@ -66,13 +67,13 @@ class SectionAbout extends PureComponent { diff --git a/src/config/support.js b/src/config/support.js new file mode 100644 index 00000000..19e9232a --- /dev/null +++ b/src/config/support.js @@ -0,0 +1,15 @@ +// @flow + +export const urls = { + twitter: 'https://twitter.com/LedgerHQ', + github: 'https://github.com/LedgerHQ/ledger-live-desktop', + reddit: 'https://www.reddit.com/r/ledgerwallet/', + faq: 'https://support.ledgerwallet.com/hc/en-us', + terms: 'https://www.ledgerwallet.com/terms', + noDeviceBuyNew: 'https://www.ledgerwallet.com/', + noDeviceTrackOrder: 'https://order.ledgerwallet.com/', + noDeviceLearnMore: 'https://www.ledgerwallet.com/', + genuineCheckContactSupport: + 'https://support.ledgerwallet.com/hc/en-us/requests/new?ticket_form_id=248165', + // feesMoreInfo: 'https://www.ledgerwallet.com/', +}