Skip to content

Commit

Permalink
chore(rn): refactor MyAccount files and folders
Browse files Browse the repository at this point in the history
  • Loading branch information
aeddi committed Oct 25, 2018
1 parent 031b773 commit 5dc99bd
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 25 deletions.
@@ -1,9 +1,9 @@
import React, { PureComponent } from 'react'
import { Image, ActivityIndicator } from 'react-native'
import { Screen, Menu, Header, Text, Badge, Flex } from '../../Library'
import { colors } from '../../../constants'
import { QueryReducer } from '../../../relay'
import { choosePicture } from '../../../helpers/react-native-image-picker'
import { Screen, Menu, Header, Text, Badge, Flex } from '../../../Library'
import { colors } from '../../../../constants'
import { QueryReducer } from '../../../../relay'
import { choosePicture } from '../../../../helpers/react-native-image-picker'
import { graphql } from 'react-relay'

export default class MyAccount extends PureComponent {
Expand Down Expand Up @@ -78,16 +78,12 @@ export default class MyAccount extends PureComponent {
<Menu.Item
icon='awesome-qrcode'
title='View QR code'
onPress={() =>
navigation.push('settings/my-account/my-qr-code', { data })
}
onPress={() => navigation.push('my-account/my-qrcode', { data })}
/>
<Menu.Item
icon='eye'
title='View public key'
onPress={() =>
navigation.push('settings/my-account/my-public-key', { data })
}
onPress={() => navigation.push('my-account/my-publickey', { data })}
/>
</Menu.Section>
<Menu.Section>
Expand Down
@@ -1,14 +1,20 @@
import React, { PureComponent } from 'react'
import { Clipboard } from 'react-native'
import { colors } from '../../../constants'
import { Flex, Screen, Header, Button, TextInputMultilineFix } from '../../Library'
import { colors } from '../../../../constants'
import {
Flex,
Screen,
Header,
Button,
TextInputMultilineFix,
} from '../../../Library'
import {
padding,
paddingVertical,
textTiny,
marginTop,
rounded,
} from '../../../styles'
} from '../../../../styles'
import { atob } from 'b64-lite'

export default class MyPublicKey extends PureComponent {
Expand Down
@@ -1,9 +1,9 @@
import React, { PureComponent } from 'react'
import { Clipboard } from 'react-native'
import { colors } from '../../../constants'
import { Flex, Screen, Button, Header } from '../../Library'
import { padding, paddingVertical } from '../../../styles'
import QRGenerator from '../../Library/QRGenerator/QRGenerator'
import { colors } from '../../../../constants'
import { Flex, Screen, Button, Header } from '../../../Library'
import { padding, paddingVertical } from '../../../../styles'
import QRGenerator from '../../../Library/QRGenerator/QRGenerator'
import { atob } from 'b64-lite'

export default class MyQRCode extends PureComponent {
Expand All @@ -15,7 +15,7 @@ export default class MyQRCode extends PureComponent {
state = {
myID:
'MEkwEwYHKoZIzj0CAQYIKoZIzj0DAQMDMgAE+Y+qPqI3geo2hQH8eK7Rn+YWG09TejZ5QFoj9fmxFrUyYhFap6XmTdJtEi8myBmW',
logo: require('../../../static/img/logo-border.png'),
logo: require('../../../../static/img/logo-border.png'),
}

share = () => {
Expand Down
@@ -0,0 +1,15 @@
import { createSubStackNavigator } from '../../../../helpers/react-navigation'
import MyAccount from './MyAccount'
import MyPublicKey from './MyPublicKey'
import MyQRCode from './MyQRCode'

export default createSubStackNavigator(
{
'my-account/list': MyAccount,
'my-account/my-qrcode': MyPublicKey,
'my-account/my-publickey': MyQRCode,
},
{
initialRouteName: 'my-account/list',
}
)
Expand Up @@ -2,9 +2,7 @@ import React from 'react'
import { createSubStackNavigator } from '../../../helpers/react-navigation'
import { Header } from '../../Library'
import List from './List'
import MyAccount from './MyAccount'
import MyPublicKey from './MyPublicKey'
import MyQRCode from './MyQRCode'
import MyAccount from './MyAccount/index.js'
import About from './About/index.js'
import Help from './Help/index.js'
import Legal from './Legal/index.js'
Expand All @@ -13,11 +11,7 @@ import Devtools from './Devtools/index.js'
export default createSubStackNavigator(
{
'settings/list': List,
// Should be better to put MyAccount related files in a subfolder
'settings/my-account': MyAccount,
'settings/my-account/my-public-key': MyPublicKey,
'settings/my-account/my-qr-code': MyQRCode,
// ////////////////////////////////////
'settings/about': About,
'settings/help': Help,
'settings/legal': Legal,
Expand Down

0 comments on commit 5dc99bd

Please sign in to comment.