Browse Source

centralize all the support urls to a same place

master
Gaëtan Renaudeau 7 years ago
parent
commit
1cb862e957
  1. 7
      src/components/Onboarding/steps/Finish.js
  2. 5
      src/components/Onboarding/steps/GenuineCheck/index.js
  3. 7
      src/components/Onboarding/steps/NoDevice.js
  4. 5
      src/components/SettingsPage/sections/About.js
  5. 15
      src/config/support.js

7
src/components/Onboarding/steps/Finish.js

@ -4,6 +4,7 @@ import React, { Component } from 'react'
import { shell } from 'electron' import { shell } from 'electron'
import styled from 'styled-components' import styled from 'styled-components'
import { i } from 'helpers/staticPath' import { i } from 'helpers/staticPath'
import { urls } from 'config/support'
import Box from 'components/base/Box' import Box from 'components/base/Box'
import Button from 'components/base/Button' import Button from 'components/base/Button'
@ -32,19 +33,19 @@ const socialMedia = [
// FIXME it should just be vdom in place // FIXME it should just be vdom in place
{ {
key: 'twitter', key: 'twitter',
url: 'https://twitter.com/LedgerHQ', url: urls.twitter,
icon: <IconSocialTwitter size={24} />, icon: <IconSocialTwitter size={24} />,
onClick: url => shell.openExternal(url), onClick: url => shell.openExternal(url),
}, },
{ {
key: 'github', key: 'github',
url: 'https://github.com/LedgerHQ/ledger-live-desktop', url: urls.github,
icon: <IconSocialGithub size={24} />, icon: <IconSocialGithub size={24} />,
onClick: url => shell.openExternal(url), onClick: url => shell.openExternal(url),
}, },
{ {
key: 'reddit', key: 'reddit',
url: 'https://www.reddit.com/r/ledgerwallet/', url: urls.reddit,
icon: <IconSocialReddit size={24} />, icon: <IconSocialReddit size={24} />,
onClick: url => shell.openExternal(url), onClick: url => shell.openExternal(url),
}, },

5
src/components/Onboarding/steps/GenuineCheck/index.js

@ -5,6 +5,7 @@ import { shell } from 'electron'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import styled from 'styled-components' import styled from 'styled-components'
import { colors } from 'styles/theme' import { colors } from 'styles/theme'
import { urls } from 'config/support'
import { updateGenuineCheck } from 'reducers/onboarding' import { updateGenuineCheck } from 'reducers/onboarding'
@ -143,9 +144,7 @@ class GenuineCheck extends PureComponent<StepProps, State> {
} }
contactSupport = () => { contactSupport = () => {
const contactSupportUrl = shell.openExternal(urls.genuineCheckContactSupport)
'https://support.ledgerwallet.com/hc/en-us/requests/new?ticket_form_id=248165'
shell.openExternal(contactSupportUrl)
} }
handlePrevStep = () => { handlePrevStep = () => {

7
src/components/Onboarding/steps/NoDevice.js

@ -7,6 +7,7 @@ import { i } from 'helpers/staticPath'
import Box from 'components/base/Box' import Box from 'components/base/Box'
import GrowScroll from 'components/base/GrowScroll' import GrowScroll from 'components/base/GrowScroll'
import TrackPage from 'analytics/TrackPage' import TrackPage from 'analytics/TrackPage'
import { urls } from 'config/support'
import IconCart from 'icons/Cart' import IconCart from 'icons/Cart'
import IconTruck from 'icons/Truck' import IconTruck from 'icons/Truck'
import IconInfoCircle from 'icons/InfoCircle' import IconInfoCircle from 'icons/InfoCircle'
@ -26,7 +27,7 @@ class NoDevice extends PureComponent<StepProps, *> {
icon: <IconCart size={20} />, icon: <IconCart size={20} />,
title: t('onboarding:noDevice.buyNew.title'), title: t('onboarding:noDevice.buyNew.title'),
onClick: () => { onClick: () => {
shell.openExternal('https://www.ledgerwallet.com/') shell.openExternal(urls.noDeviceBuyNew)
}, },
}, },
{ {
@ -34,7 +35,7 @@ class NoDevice extends PureComponent<StepProps, *> {
icon: <IconTruck size={20} />, icon: <IconTruck size={20} />,
title: t('onboarding:noDevice.trackOrder.title'), title: t('onboarding:noDevice.trackOrder.title'),
onClick: () => { onClick: () => {
shell.openExternal('http://order.ledgerwallet.com/') shell.openExternal(urls.noDeviceTrackOrder)
}, },
}, },
{ {
@ -42,7 +43,7 @@ class NoDevice extends PureComponent<StepProps, *> {
icon: <IconInfoCircle size={20} />, icon: <IconInfoCircle size={20} />,
title: t('onboarding:noDevice.learnMore.title'), title: t('onboarding:noDevice.learnMore.title'),
onClick: () => { onClick: () => {
shell.openExternal('https://www.ledgerwallet.com/') shell.openExternal(urls.noDeviceLearnMore)
}, },
}, },
] ]

5
src/components/SettingsPage/sections/About.js

@ -6,6 +6,7 @@ import type { T } from 'types/common'
import TrackPage from 'analytics/TrackPage' import TrackPage from 'analytics/TrackPage'
import IconHelp from 'icons/Help' import IconHelp from 'icons/Help'
import resolveLogsDirectory from 'helpers/resolveLogsDirectory' import resolveLogsDirectory from 'helpers/resolveLogsDirectory'
import { urls } from 'config/support'
import ExportLogsBtn from 'components/ExportLogsBtn' import ExportLogsBtn from 'components/ExportLogsBtn'
import CleanButton from '../CleanButton' import CleanButton from '../CleanButton'
@ -66,13 +67,13 @@ class SectionAbout extends PureComponent<Props> {
<AboutRowItem <AboutRowItem
title={t('app:settings.about.faq')} title={t('app:settings.about.faq')}
desc={t('app:settings.about.faqDesc')} desc={t('app:settings.about.faqDesc')}
url="https://support.ledgerwallet.com/hc/en-us" url={urls.faq}
/> />
<AboutRowItem <AboutRowItem
title={t('app:settings.about.terms')} title={t('app:settings.about.terms')}
desc={t('app:settings.about.termsDesc')} desc={t('app:settings.about.termsDesc')}
url="https://www.ledgerwallet.com/terms" url={urls.terms}
/> />
</Body> </Body>
</Section> </Section>

15
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/',
}
Loading…
Cancel
Save