Browse Source

Pixel push session for Settings page and other stuff

master
meriadec 7 years ago
parent
commit
2b52c17ec4
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  1. 16
      src/components/CurrentAddress/index.js
  2. 2
      src/components/DeviceConnect/index.js
  3. 1
      src/components/OperationsList/index.js
  4. 6
      src/components/SettingsPage/SettingsSection.js
  5. 40
      src/components/SettingsPage/sections/Display.js
  6. 17
      src/components/SettingsPage/sections/Profile.js
  7. 2
      src/components/base/SideBar/SideBarListItem.js
  8. 4
      static/i18n/en/settings.yml

16
src/components/CurrentAddress/index.js

@ -19,7 +19,6 @@ import QRCode from 'components/base/QRCode'
import IconCheck from 'icons/Check' import IconCheck from 'icons/Check'
import IconCopy from 'icons/Copy' import IconCopy from 'icons/Copy'
import IconInfoCircle from 'icons/InfoCircle' import IconInfoCircle from 'icons/InfoCircle'
import IconShare from 'icons/Share'
import IconShield from 'icons/Shield' import IconShield from 'icons/Shield'
const Container = styled(Box).attrs({ const Container = styled(Box).attrs({
@ -64,6 +63,8 @@ const Label = styled(Box).attrs({
` `
const Footer = styled(Box).attrs({ const Footer = styled(Box).attrs({
justify: 'center',
flow: 4,
horizontal: true, horizontal: true,
mt: 4, mt: 4,
})` })`
@ -82,13 +83,17 @@ const FooterButtonWrapper = styled(Box).attrs({
width: 55px; width: 55px;
&:hover { &:hover {
background-color: rgba(100, 144, 241, 0.1); background-color: ${p => rgba(p.theme.colors.wallet, 0.1)};
color: ${p => p.theme.colors.dark}; color: ${p => p.theme.colors.dark};
svg { svg {
color: ${p => p.theme.colors.wallet}; color: ${p => p.theme.colors.wallet};
} }
} }
&:active {
background-color: ${p => rgba(p.theme.colors.wallet, 0.15)};
}
` `
const FooterButton = ({ const FooterButton = ({
@ -100,7 +105,7 @@ const FooterButton = ({
label: string, label: string,
onClick: Function, onClick: Function,
}) => ( }) => (
<Box grow alignItems="center" justifyContent="center"> <Box alignItems="center" justifyContent="center">
<FooterButtonWrapper onClick={onClick}> <FooterButtonWrapper onClick={onClick}>
{icon} {icon}
<Box fontSize={3} ff="Museo Sans|Bold" mt={1}> <Box fontSize={3} ff="Museo Sans|Bold" mt={1}>
@ -203,16 +208,13 @@ class CurrentAddress extends PureComponent<Props> {
)} )}
{withFooter && ( {withFooter && (
<Footer> <Footer>
{withVerify && ( <FooterButton icon={<IconCheck size={16} />} label="Verify" onClick={onVerify} />
<FooterButton icon={<IconCheck size={16} />} label="Verify" onClick={onVerify} />
)}
<CopyToClipboard <CopyToClipboard
data={address} data={address}
render={copy => ( render={copy => (
<FooterButton icon={<IconCopy size={16} />} label="Copy" onClick={copy} /> <FooterButton icon={<IconCopy size={16} />} label="Copy" onClick={copy} />
)} )}
/> />
<FooterButton icon={<IconShare size={16} />} label="Share" onClick={onShare} />
</Footer> </Footer>
)} )}
</Container> </Container>

2
src/components/DeviceConnect/index.js

@ -202,7 +202,7 @@ class DeviceConnect extends PureComponent<Props> {
const hasMultipleDevices = devices.length > 1 const hasMultipleDevices = devices.length > 1
return ( return (
<Box flow={4}> <Box flow={4} ff="Open Sans">
<Step validated={hasDevice}> <Step validated={hasDevice}>
<StepContent> <StepContent>
<StepIcon> <StepIcon>

1
src/components/OperationsList/index.js

@ -13,7 +13,6 @@ import {
import type { Account } from '@ledgerhq/live-common/lib/types' import type { Account } from '@ledgerhq/live-common/lib/types'
import noop from 'lodash/noop'
import keyBy from 'lodash/keyBy' import keyBy from 'lodash/keyBy'
import type { T } from 'types/common' import type { T } from 'types/common'

6
src/components/SettingsPage/SettingsSection.js

@ -62,7 +62,7 @@ export function SettingsSectionHeader({
<Box ff="Museo Sans|Regular" color="dark"> <Box ff="Museo Sans|Regular" color="dark">
{title} {title}
</Box> </Box>
<Box ff="Open Sans" fontSize={3}> <Box ff="Open Sans" fontSize={3} mt={1}>
{desc} {desc}
</Box> </Box>
</Box> </Box>
@ -101,11 +101,11 @@ export function SettingsSectionRow({
}) { }) {
return ( return (
<SettingsSectionRowContainer onClick={onClick}> <SettingsSectionRowContainer onClick={onClick}>
<Box grow> <Box grow shrink>
<Box ff="Open Sans|SemiBold" color="dark" fontSize={4}> <Box ff="Open Sans|SemiBold" color="dark" fontSize={4}>
{title} {title}
</Box> </Box>
<Box ff="Open Sans" fontSize={3} color="grey"> <Box ff="Open Sans" fontSize={3} color="grey" mt={1} mr={1}>
{desc} {desc}
</Box> </Box>
</Box> </Box>

40
src/components/SettingsPage/sections/Display.js

@ -13,6 +13,7 @@ import {
import type { SettingsState as Settings } from 'reducers/settings' import type { SettingsState as Settings } from 'reducers/settings'
import type { T } from 'types/common' import type { T } from 'types/common'
import Box from 'components/base/Box'
import ExchangeSelect from 'components/SelectExchange' import ExchangeSelect from 'components/SelectExchange'
import Select from 'components/base/Select' import Select from 'components/base/Select'
import RadioGroup from 'components/base/RadioGroup' import RadioGroup from 'components/base/RadioGroup'
@ -152,29 +153,30 @@ class TabProfile extends PureComponent<Props, State> {
title={t('settings:display.counterValue')} title={t('settings:display.counterValue')}
desc={t('settings:display.counterValueDesc')} desc={t('settings:display.counterValueDesc')}
> >
<Select <Box horizontal flow={2}>
small <Select
minWidth={250} small
onChange={this.handleChangeCounterValue} minWidth={250}
itemToString={item => (item ? item.name : '')} onChange={this.handleChangeCounterValue}
renderSelected={item => item && item.name} itemToString={item => (item ? item.name : '')}
options={fiats} renderSelected={item => item && item.name}
value={cvOption} options={fiats}
/> value={cvOption}
/>
<ExchangeSelect
small
from={intermediaryCurrency}
to={counterValueCurrency}
exchangeId={counterValueExchange}
onChange={this.handleChangeExchange}
minWidth={150}
/>
</Box>
</Row> </Row>
<Row <Row
title={`Exchange (${intermediaryCurrency.ticker}${counterValueCurrency.ticker})`} title={`Exchange (${intermediaryCurrency.ticker}${counterValueCurrency.ticker})`}
desc="The exchange to use for countervalue conversion" desc="The exchange to use for countervalue conversion"
> />
<ExchangeSelect
small
from={intermediaryCurrency}
to={counterValueCurrency}
exchangeId={counterValueExchange}
onChange={this.handleChangeExchange}
minWidth={200}
/>
</Row>
<Row title={t('settings:display.language')} desc={t('settings:display.languageDesc')}> <Row title={t('settings:display.language')} desc={t('settings:display.languageDesc')}>
<Select <Select
small small

17
src/components/SettingsPage/sections/Profile.js

@ -118,7 +118,7 @@ class TabProfile extends PureComponent<Props, State> {
} }
render() { render() {
const { t, settings } = this.props const { t, settings, saveSettings } = this.props
const { const {
isSoftResetModalOpened, isSoftResetModalOpened,
isHardResetModalOpened, isHardResetModalOpened,
@ -150,6 +150,21 @@ class TabProfile extends PureComponent<Props, State> {
> >
<CheckBox isChecked={settings.developerMode} onChange={this.handleDeveloperMode} /> <CheckBox isChecked={settings.developerMode} onChange={this.handleDeveloperMode} />
</Row> </Row>
<Row
title={t('settings:profile.reportErrors')}
desc={t('settings:profile.reportErrorsDesc')}
>
<CheckBox
isChecked={settings.sentryLogs}
onChange={sentryLogs => saveSettings({ sentryLogs })}
/>
</Row>
<Row title={t('settings:profile.analytics')} desc={t('settings:profile.analyticsDesc')}>
<CheckBox
isChecked={settings.shareAnalytics}
onChange={shareAnalytics => saveSettings({ shareAnalytics })}
/>
</Row>
<Row <Row
title={t('settings:profile.softResetTitle')} title={t('settings:profile.softResetTitle')}
desc={t('settings:profile.softResetDesc')} desc={t('settings:profile.softResetDesc')}

2
src/components/base/SideBar/SideBarListItem.js

@ -63,7 +63,7 @@ const Container = styled(Tabbable).attrs({
py: 2, py: 2,
})` })`
cursor: ${p => (p.isActive ? 'default' : 'pointer')}; cursor: ${p => (p.isActive ? 'default' : 'pointer')};
color: ${p => p.theme.colors.smoke}; color: ${p => (p.isActive ? p.theme.colors.dark : p.theme.colors.smoke)};
background: ${p => (p.isActive ? p.theme.colors.lightGrey : '')}; background: ${p => (p.isActive ? p.theme.colors.lightGrey : '')};
&:active { &:active {

4
static/i18n/en/settings.yml

@ -51,6 +51,10 @@ profile:
hardReset: Hard reset hardReset: Hard reset
developerMode: Developer Mode developerMode: Developer Mode
developerModeDesc: Enable visibility of developer apps & currencies like Bitcoin Testnet developerModeDesc: Enable visibility of developer apps & currencies like Bitcoin Testnet
analytics: Share analytics
analyticsDesc: Help Ledger improve its products and services by automatically sending diagnostics and usage data.
reportErrors: Sentry Logs
reportErrorsDesc: Help Ledger improve its products and services by automatically sending diagnostics and usage data.
about: about:
faq: FAQ faq: FAQ
faqDesc: Lorem ipsum dolor sit amet faqDesc: Lorem ipsum dolor sit amet

Loading…
Cancel
Save