diff --git a/client/react-native/common/components/Screens/Contacts/Add/ByBump.js b/client/react-native/common/components/Screens/Contacts/Add/ByBump.js index e2cd813cca..61f91db7a8 100644 --- a/client/react-native/common/components/Screens/Contacts/Add/ByBump.js +++ b/client/react-native/common/components/Screens/Contacts/Add/ByBump.js @@ -3,6 +3,6 @@ import { Text } from '../../../Library' export default class ByBump extends PureComponent { render () { - return Hello World ! + return Bump! } } diff --git a/client/react-native/common/components/Screens/Contacts/Add/ByQRCode.js b/client/react-native/common/components/Screens/Contacts/Add/ByQRCode.js index 51b7df1978..c9e8c042ec 100644 --- a/client/react-native/common/components/Screens/Contacts/Add/ByQRCode.js +++ b/client/react-native/common/components/Screens/Contacts/Add/ByQRCode.js @@ -1,7 +1,41 @@ import { PureComponent } from 'react' +import createTabNavigator from 'react-navigation-deprecated-tab-navigator/src/createTabNavigator' +import { colors } from '../../../../constants' +import { + borderBottom, +} from '../../../../styles' -export default class ByQRCode extends PureComponent { +class ByQRCode extends PureComponent { render () { return null } } + +export default createTabNavigator( + { + 'Scan a QR code': ByQRCode, + 'View my QR code': ByQRCode, + }, + { + initialRouteName: 'Scan a QR code', + swipeEnabled: true, + animationEnabled: true, + tabBarPosition: 'top', + + tabBarOptions: { + labelStyle: { + color: colors.black, + }, + indicatorStyle: { + backgroundColor: colors.black, + }, + style: [ + { + backgroundColor: colors.white, + borderTopWidth: 0, + }, + borderBottom, + ], + }, + } +) diff --git a/client/react-native/common/components/Screens/Contacts/Add/Choice.js b/client/react-native/common/components/Screens/Contacts/Add/Choice.js index 5fd5ac4bb4..dbee359e36 100644 --- a/client/react-native/common/components/Screens/Contacts/Add/Choice.js +++ b/client/react-native/common/components/Screens/Contacts/Add/Choice.js @@ -1,7 +1,84 @@ -import { PureComponent } from 'react' +import React, { PureComponent } from 'react' +import { TouchableOpacity } from 'react-native' +import { Text, Flex } from '../../../Library' +import { colors } from '../../../../constants' +import { + padding, + borderTop, +} from '../../../../styles' export default class Choice extends PureComponent { render () { - return null + const { navigation } = this.props + return ( + + + + + + + + + ) } } + +const Item = ({ + color, + name, + link, + navigation, +}) => ( + navigation.push(link)} + style={[{ + borderRadius: 8, + height: 100, + width: 300, + backgroundColor: color, + justifyContent: 'center', + alignItems: 'center', + }]} + > + + { name } + + +) diff --git a/client/react-native/common/components/Screens/Contacts/Add/Request.js b/client/react-native/common/components/Screens/Contacts/Add/Request.js new file mode 100644 index 0000000000..87a88f854e --- /dev/null +++ b/client/react-native/common/components/Screens/Contacts/Add/Request.js @@ -0,0 +1,77 @@ +import React, { PureComponent } from 'react' +import { FlatList, TouchableOpacity, Image } from 'react-native' +import { Screen, Flex, Text, Separator } from '../../../Library' +import { colors } from '../../../../constants' +import { + borderTop, + marginHorizontal, +} from '../../../../styles' +import { QueryReducer } from '../../../../relay' +import { queries } from '../../../../graphql' + +const Item = ({ + data: { id, displayName, overrideDisplayName }, + navigation, +}) => ( + navigation.push('RequestValidation', { id })} + style={[ + { + backgroundColor: colors.white, + paddingVertical: 16, + height: 71, + }, + marginHorizontal, + ]} + > + + + + + + + {overrideDisplayName || displayName} + + + Request received 3 hours ago ... + + + + +) + +export default class Request extends PureComponent { + render () { + const { navigation } = this.props + return ( + + + {(state, retry) => ( + entry.status === 'RequestedMe')} + ItemSeparatorComponent={({ highlighted }) => ( + )} refreshing={state.type === state.loading} + onRefresh={retry} + renderItem={data => ( + + )} + /> + )} + + + ) + } +} diff --git a/client/react-native/common/components/Screens/Contacts/Add/RequestValidation.js b/client/react-native/common/components/Screens/Contacts/Add/RequestValidation.js new file mode 100644 index 0000000000..e9a7decada --- /dev/null +++ b/client/react-native/common/components/Screens/Contacts/Add/RequestValidation.js @@ -0,0 +1,71 @@ +import React, { PureComponent } from 'react' +import { TouchableOpacity } from 'react-native' +import { Text, Flex } from '../../../Library' +import { colors } from '../../../../constants' +import { + borderTop, + padding, +} from '../../../../styles' + +export default class RequestValidation extends PureComponent { + render () { + return ( + + + console.log('Accept')} + style={[{ + borderRadius: 8, + height: 100, + width: 300, + backgroundColor: colors.blue, + justifyContent: 'center', + alignItems: 'center', + }]} + > + + Accept + + + console.log('Decline')} + style={[{ + borderRadius: 8, + height: 100, + width: 300, + backgroundColor: colors.red, + justifyContent: 'center', + alignItems: 'center', + }]} + > + + Decline + + + + + ) + } +} diff --git a/client/react-native/common/components/Screens/Contacts/Add/index.js b/client/react-native/common/components/Screens/Contacts/Add/index.js index 19d9c8ec7b..9160144eaa 100644 --- a/client/react-native/common/components/Screens/Contacts/Add/index.js +++ b/client/react-native/common/components/Screens/Contacts/Add/index.js @@ -3,6 +3,8 @@ import Choice from './Choice' import ByBump from './ByBump' import ByPublicKey from './ByPublicKey' import ByQRCode from './ByQRCode' +import Request from './Request' +import RequestValidation from './RequestValidation' import React from 'react' import { Text, Button } from '../../../Library' @@ -12,10 +14,12 @@ export default createSubStackNavigator( ByBump, ByPublicKey, ByQRCode, + Request, + RequestValidation, Choice, }, { - initialRouteName: 'ByPublicKey', + initialRouteName: 'Choice', navigationOptions: params => ({ headerTitle: ( diff --git a/client/react-native/common/components/Screens/Landing/index.js b/client/react-native/common/components/Screens/Landing/index.js index 51e42e2b12..8f06f36b15 100644 --- a/client/react-native/common/components/Screens/Landing/index.js +++ b/client/react-native/common/components/Screens/Landing/index.js @@ -16,4 +16,3 @@ export default createStackNavigator( }, { initialRouteName: '1' } ) - diff --git a/client/react-native/common/constants/colors.js b/client/react-native/common/constants/colors.js index e67c9f8eb8..970c16ace5 100644 --- a/client/react-native/common/constants/colors.js +++ b/client/react-native/common/constants/colors.js @@ -3,6 +3,9 @@ export default { white: '#ffffff', black: '#000000', blue: '#2D6FE2', + red: '#E94E6B', + orange: '#F7B352', + yellow: '#F7E552', grey1: '#243132', grey2: '#314243', diff --git a/client/react-native/common/graphql/queries/ContactList.js b/client/react-native/common/graphql/queries/ContactList.js index 5362e34164..795971af51 100644 --- a/client/react-native/common/graphql/queries/ContactList.js +++ b/client/react-native/common/graphql/queries/ContactList.js @@ -6,6 +6,7 @@ export default graphql` id displayName overrideDisplayName + status } } ` diff --git a/core/api/node/graphql/converts.go b/core/api/node/graphql/converts.go index 15577e2070..b452fcb80d 100644 --- a/core/api/node/graphql/converts.go +++ b/core/api/node/graphql/converts.go @@ -12,12 +12,12 @@ import ( func convertContactStatus(value entity.Contact_Status) *model.BertyEntityContactStatus { ret, ok := map[entity.Contact_Status]model.BertyEntityContactStatus{ entity.Contact_Unknown: model.BertyEntityContactStatusUnknown, - entity.Contact_IsFriend: model.BertyEntityContactStatusUnknown, - entity.Contact_IsTrustedFriend: model.BertyEntityContactStatusUnknown, - entity.Contact_IsRequested: model.BertyEntityContactStatusUnknown, - entity.Contact_RequestedMe: model.BertyEntityContactStatusUnknown, - entity.Contact_IsBlocked: model.BertyEntityContactStatusUnknown, - entity.Contact_Myself: model.BertyEntityContactStatusUnknown, + entity.Contact_IsFriend: model.BertyEntityContactStatusIsFriend, + entity.Contact_IsTrustedFriend: model.BertyEntityContactStatusIsTrustedFriend, + entity.Contact_IsRequested: model.BertyEntityContactStatusIsRequested, + entity.Contact_RequestedMe: model.BertyEntityContactStatusRequestedMe, + entity.Contact_IsBlocked: model.BertyEntityContactStatusIsBlocked, + entity.Contact_Myself: model.BertyEntityContactStatusMyself, }[value] if !ok {