Gaëtan Renaudeau
7 years ago
26 changed files with 280 additions and 82 deletions
@ -0,0 +1,72 @@ |
|||
// @flow
|
|||
|
|||
import React, { PureComponent } from 'react' |
|||
import { translate } from 'react-i18next' |
|||
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' |
|||
import ResetButton from '../ResetButton' |
|||
import AboutRowItem from '../AboutRowItem' |
|||
|
|||
import { |
|||
SettingsSection as Section, |
|||
SettingsSectionHeader as Header, |
|||
SettingsSectionBody as Body, |
|||
SettingsSectionRow as Row, |
|||
} from '../SettingsSection' |
|||
|
|||
type Props = { |
|||
t: T, |
|||
} |
|||
|
|||
class SectionHelp extends PureComponent<Props> { |
|||
render() { |
|||
const { t } = this.props |
|||
|
|||
return ( |
|||
<Section> |
|||
<TrackPage category="Settings" name="Help" /> |
|||
|
|||
<Header |
|||
icon={<IconHelp size={16} />} |
|||
title={t('app:settings.tabs.help')} |
|||
desc={t('app:settings.help.desc')} |
|||
/> |
|||
|
|||
<Body> |
|||
<Row |
|||
title={t('app:settings.profile.softResetTitle')} |
|||
desc={t('app:settings.profile.softResetDesc')} |
|||
> |
|||
<CleanButton /> |
|||
</Row> |
|||
<Row |
|||
title={t('app:settings.profile.hardResetTitle')} |
|||
desc={t('app:settings.profile.hardResetDesc')} |
|||
> |
|||
<ResetButton /> |
|||
</Row> |
|||
<Row |
|||
title={t('app:settings.exportLogs.title')} |
|||
desc={t('app:settings.exportLogs.desc', { logsDirectory: resolveLogsDirectory() })} |
|||
> |
|||
<ExportLogsBtn /> |
|||
</Row> |
|||
|
|||
<AboutRowItem |
|||
title={t('app:settings.help.faq')} |
|||
desc={t('app:settings.help.faqDesc')} |
|||
url={urls.faq} |
|||
/> |
|||
</Body> |
|||
</Section> |
|||
) |
|||
} |
|||
} |
|||
|
|||
export default translate()(SectionHelp) |
@ -1,7 +1,24 @@ |
|||
// @flow
|
|||
|
|||
import type { Account, AccountRaw } from '@ledgerhq/live-common/lib/types' |
|||
|
|||
type SplitConfig = { |
|||
coinType: number, |
|||
} |
|||
|
|||
export const isSegwitPath = (path: string): boolean => path.startsWith("49'") |
|||
|
|||
export const isSegwitAccount = (account: Account | AccountRaw): boolean => |
|||
isSegwitPath(account.freshAddressPath) |
|||
|
|||
export const isUnsplitPath = (path: string, splitConfig: SplitConfig) => { |
|||
try { |
|||
const coinType = parseInt(path.split('/')[1], 10) |
|||
return coinType === splitConfig.coinType |
|||
} catch (e) { |
|||
return false |
|||
} |
|||
} |
|||
|
|||
export const isUnsplitAccount = (account: Account | AccountRaw, splitConfig: ?SplitConfig) => |
|||
!!splitConfig && isUnsplitPath(account.freshAddressPath, splitConfig) |
|||
|
Loading…
Reference in new issue