Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rn): added 'About' screen and subscreens
- Loading branch information
Showing
24 changed files
with
800 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
client/react-native/common/components/Screens/Settings/About/Changelog.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React, { PureComponent } from 'react' | ||
import { Header, Text, Flex } from '../../../Library' | ||
|
||
export default class Changelog extends PureComponent { | ||
static navigationOptions = ({ navigation }) => ({ | ||
header: <Header navigation={navigation} title='Changelog' backBtn />, | ||
}) | ||
render () { | ||
return ( | ||
<Flex.Cols size={1} align='center' justify='between'> | ||
<Flex.Rows size={1} align='center' justify='between'> | ||
<Text big>Changelog</Text> | ||
</Flex.Rows> | ||
</Flex.Cols> | ||
) | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
client/react-native/common/components/Screens/Settings/About/List.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import React, { PureComponent } from 'react' | ||
import { Image } from 'react-native' | ||
import { Header, Menu, Flex } from '../../../Library' | ||
import { AppVersion } from '../../../../graphql/queries' | ||
|
||
export default class List extends PureComponent { | ||
static navigationOptions = ({ navigation }) => ({ | ||
header: <Header navigation={navigation} title='About Berty' backBtn />, | ||
tabBarVisible: false, | ||
}) | ||
|
||
state = { | ||
version: null, | ||
} | ||
|
||
componentDidMount () { | ||
AppVersion.then(data => { | ||
this.setState({ version: data.AppVersion.version }) | ||
}) | ||
} | ||
|
||
render () { | ||
const { navigation } = this.props | ||
const { version } = this.state | ||
return ( | ||
<Menu style={{ marginTop: 42 }}> | ||
<Flex.Cols size={1} align='center' justify='between'> | ||
<Flex.Rows size={1} align='center' justify='between'> | ||
<Image | ||
resizeMode='contain' | ||
style={{ width: 300, height: 300 }} | ||
source={require('../../../../static/img/square_about.svg')} | ||
/> | ||
</Flex.Rows> | ||
</Flex.Cols> | ||
<Menu.Section> | ||
<Menu.Item | ||
icon='smartphone' | ||
title='App version' | ||
description={version} | ||
/> | ||
<Menu.Item | ||
icon='check-circle' | ||
title='Changelog' | ||
onPress={() => navigation.push('about/changelog')} | ||
/> | ||
</Menu.Section> | ||
<Menu.Section> | ||
<Menu.Item | ||
icon='info' | ||
title='Learn more about Berty' | ||
onPress={() => navigation.push('about/more')} | ||
/> | ||
</Menu.Section> | ||
</Menu> | ||
) | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
client/react-native/common/components/Screens/Settings/About/More.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React, { PureComponent } from 'react' | ||
import { Header, Text, Flex } from '../../../Library' | ||
|
||
export default class More extends PureComponent { | ||
static navigationOptions = ({ navigation }) => ({ | ||
header: <Header navigation={navigation} title='More about Berty' backBtn />, | ||
}) | ||
render () { | ||
return ( | ||
<Flex.Cols size={1} align='center' justify='between'> | ||
<Flex.Rows size={1} align='center' justify='between'> | ||
<Text big>Display Berty whitepaper?</Text> | ||
</Flex.Rows> | ||
</Flex.Cols> | ||
) | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
client/react-native/common/components/Screens/Settings/About/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { createSubStackNavigator } from '../../../../helpers/react-navigation' | ||
import List from './List' | ||
import Changelog from './Changelog' | ||
import More from './More' | ||
|
||
export default createSubStackNavigator( | ||
{ | ||
'about/list': List, | ||
'about/changelog': Changelog, | ||
'about/more': More, | ||
}, | ||
{ | ||
initialRouteName: 'about/list', | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { fetchQuery, graphql } from 'relay-runtime' | ||
import environment from '../../relay/environment' | ||
|
||
const query = graphql` | ||
query AppVersionQuery($t: Bool!) { | ||
AppVersion(T: $t) { | ||
version | ||
} | ||
} | ||
` | ||
|
||
export default fetchQuery(environment, query, { t: true }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.