Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "59 display wal lib transactions (#60)"
Browse files Browse the repository at this point in the history
This reverts commit f979097.
2byrds authored Jun 30, 2022

Verified

This commit was signed with the committer’s verified signature.
beausmith Beau Smith
1 parent 6c6884e commit cf290de
Showing 29 changed files with 233 additions and 429 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -238,7 +238,7 @@ dependencies {
} else {
implementation jscFlavor
}
implementation("com.rootsid.wal:wal-library:1.0.1-SNAPSHOT") {
implementation("com.rootsid.wal:wal-library:1.0.2-LANCE") {
exclude group: 'io.github.vincenzopalazzo', module: 'material-ui-swing'
exclude group: 'javax.annotation', module: 'jsr250-api'
exclude group: 'org.didcommx', module: 'didcomm'
25 changes: 9 additions & 16 deletions android/app/src/main/java/com/rootswallet/PrismModule.kt
Original file line number Diff line number Diff line change
@@ -23,23 +23,16 @@ class PrismModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaM
}

@ReactMethod(isBlockingSynchronousMethod = true)
fun setNetwork(host: String = "ppp.atalaprism.io", port: String = "50053") {
Log.d("PRISM_TAG","Setting GrpcConfig host "+host+" w/port "+port);
GrpcConfig.host = host
GrpcConfig.port = port
}
fun test() {Log.d("test","test")}

// @ReactMethod(isBlockingSynchronousMethod = true)
// fun test() {Log.d("test","test")}
//
// @ReactMethod(isBlockingSynchronousMethod = true)
// fun testNode() {
// val wal = newWallet("walletname1", "", "password1")
// val didAlias1 = "didAlias1"
// val walAfterDid = newDid(wal, didAlias1, true)
// Log.d("LANCETAG", "Testing node publish....")
// val output = publishDid(walAfterDid, didAlias1).toString()
// }
@ReactMethod(isBlockingSynchronousMethod = true)
fun testNode() {
val wal = newWallet("walletname1", "", "password1")
val didAlias1 = "didAlias1"
val walAfterDid = newDid(wal, didAlias1, true)
Log.d("LANCETAG", "Testing node publish....")
val output = publishDid(walAfterDid, didAlias1).toString()
}

@ReactMethod(isBlockingSynchronousMethod = true)
fun newDID(walJson: String, didAlias: String): String {
Binary file modified android/app/src/main/res/drawable-hdpi/splashscreen_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-mdpi/splashscreen_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-xhdpi/splashscreen_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-xxhdpi/splashscreen_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/drawable-xxxhdpi/splashscreen_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
"splash": {
"image": "./src/assets/WhiteTextExtraGlow.png",
"resizeMode": "contain",
"backgroundColor": "#000000"
"backgroundColor": "#111111"
},
"updates": {
"enabled": true,
@@ -26,7 +26,7 @@
"adaptiveIcon": {

"foregroundImage": "./src/assets/LogoOnly1024.png",
"backgroundColor": "#000000"
"backgroundColor": "#111111"
},
"package": "com.rootswallet"
},
Binary file modified assets/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@
"@babel/preset-env": "^7.1.6",
"@react-native-async-storage/async-storage": "~1.15.0",
"@react-native-community/masked-view": "0.1.10",
"@react-native-picker/picker": "^2.4.1",
"@react-navigation/bottom-tabs": "^6.3.1",
"@react-navigation/core": "6.2.1",
"@react-navigation/devtools": "6.0.7",
@@ -38,7 +37,6 @@
"react-native": "0.64.3",
"react-native-gesture-handler": "~2.1.0",
"react-native-gifted-chat": "1.0.0-beta-3",
"react-native-hyperlink": "^0.0.19",
"react-native-localize": "^2.1.7",
"react-native-paper": "^4.12.1",
"react-native-qrcode-svg": "^6.1.2",
@@ -60,5 +58,5 @@
},
"private": true,
"name": "rootswallet",
"version": "0.0.1-alpha"
"version": "1.0.0"
}
Binary file added src/assets/adaptive-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 0 additions & 7 deletions src/components/IconActions.js
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ export default function IconActions(...props) {
const navigation = props[0]["nav"]
const add = props[0]["add"]
const scan = props[0]["scan"]
const settings = props[0]["settings"]
return (
<View style={{flexDirection:'row',}}>
<IconButton
@@ -22,12 +21,6 @@ export default function IconActions(...props) {
color="#e69138"
onPress={() => navigation.navigate(scan)}
/>
<IconButton
icon="cog-outline"
size={28}
color="#e69138"
onPress={() => navigation.navigate(settings)}
/>
</View>
)
}
2 changes: 1 addition & 1 deletion src/components/LogoTitle.js
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ export default function LogoTitle(...props) {
style={{ width: 50, height: 50 }}
source={require('../assets/LogoOnly1024.png')}
/>
<Text style={{ color: '#eeeeee',fontSize: 22,fontWeight: 'normal',textAlignVertical: "center",textAlign: "center", }}>
<Text style={{ color: '#ff9138',fontSize: 22,fontWeight: 'normal',textAlignVertical: "center",textAlign: "center", }}>
{props[0]["title"]}
</Text>
</View>
7 changes: 3 additions & 4 deletions src/models/index.ts
Original file line number Diff line number Diff line change
@@ -5,11 +5,10 @@ const ID_SEPARATOR = "_"

//these types must be unique enough to use in regex without conflict
export const MODEL_TYPE_CHAT = "rootsChatType"
export const MODEL_TYPE_MESSAGE = "rootsMsgType"
export const MODEL_TYPE_CREDENTIAL = "rootsCredentialType"
export const MODEL_TYPE_CRED_REQUEST = "rootsCredRequestType"
export const MODEL_TYPE_MESSAGE = "rootsMsgType"
export const MODEL_TYPE_REL = "rootsRelType"
export const MODEL_TYPE_SETTING = "rootsSettingType"

//TODO refactor away this general file to specific files, like 'chat'

@@ -25,15 +24,15 @@ export function createChat(chatAlias: string, fromDidAlias: string, toIds: strin
return chat;
}

export function createMessage(idText: string,bodyText: string,statusText: string,timeInMillis: number,relId: string,system?: boolean=false,data?: Object=undefined) {
export function createMessage(idText: string,bodyText: string,statusText: string,timeInMillis: number,relId: string,system?: boolean=false,cred?: Object=undefined) {
const msg = {
id: idText,
body: bodyText,
type: statusText,
createdTime: timeInMillis,
rel: relId,
system: system,
data: data,
cred: cred,
}
logger("models - created msg model w/keys",Object.keys(msg))
return msg;
31 changes: 13 additions & 18 deletions src/navigation/AuthStack.js
Original file line number Diff line number Diff line change
@@ -33,8 +33,7 @@ import ScanQRCodeScreen from '../screens/ScanQRCodeScreen'
import ShowQRCodeScreen from '../screens/ShowQRCodeScreen'
import StartChatScreen from '../screens/StartChatScreen';

import { getChatItem, getRootsWallet, storageStatus,
hasWallet, loadSettings, TEST_WALLET_NAME } from '../roots'
import { getChatItem, getRootsWallet, storageStatus, hasWallet, TEST_WALLET_NAME } from '../roots'

const Stack = createStackNavigator();
const Tab = createBottomTabNavigator()
@@ -76,19 +75,16 @@ export default function AuthStack() {
try {
console.log("AuthStack - getting RootsWallet")
await storageStatus()
const settingsLoaded = await loadSettings()
if(settingsLoaded) {
//TODO ditch test wallet name
const walFound = await hasWallet(walletName)
console.log("AuthStack - wallet found?",walFound)
setWalletFound(walFound)
if(walFound) {
//TODO ditch test wallet name
console.log("AuthStack - since wallet found, getting rootsWallet")
userToken = getRootsWallet(walletName)
} else {
console.log("AuthStack - since wallet NOT found, auth token not set")
}
//TODO ditch test wallet name
const walFound = await hasWallet(walletName)
console.log("AuthStack - wallet found?",walFound)
setWalletFound(walFound)
if(walFound) {
//TODO ditch test wallet name
console.log("AuthStack - since wallet found, getting rootsWallet")
userToken = getRootsWallet(walletName)
} else {
console.log("AuthStack - since wallet NOT found, auth token not set")
}
} catch (e) {
// Restoring token failed
@@ -147,15 +143,15 @@ export default function AuthStack() {
initialParams={{walletName: walletName}}
options={ ({ navigation, route }) => ({
headerTitle: (props) => <LogoTitle {...props} title="Relationships:"/>,
headerRight: (props) => <IconActions {...props} nav={navigation} add="Create Rel" scan='Scan QR Code' settings='Settings'/>,
headerRight: (props) => <IconActions {...props} nav={navigation} add="Create Rel" scan='Scan QR Code'/>,
})}
/>
<Stack.Screen
name="Chat"
component={ChatScreen}
options={ ({ navigation, route }) => ({
headerTitle: (props) => <LogoTitle {...props} title={getChatItem(route.params.chatId).title}/>,
headerRight: (props) => <IconActions {...props} nav={navigation} add="Add Rel" scan='Scan QR Code' settings='Settings'/>,
headerRight: (props) => <IconActions {...props} nav={navigation} add="Add Rel" scan='Scan QR Code'/>,
})}
/>
</Stack.Group>
@@ -259,7 +255,6 @@ export default function AuthStack() {
<Stack.Screen name="Help" component={HelpScreen}/>
<Stack.Screen name="Create Rel" component={CreateRelScreen}/>
<Stack.Screen name="Create Secure Chat" component={StartChatScreen} />
<Stack.Screen name="Settings" component={SettingsScreen}/>
<Stack.Screen name="Show QR Code" component={ShowQRCodeScreen} />
<Stack.Screen name="Scan QR Code" component={ScanQRCodeScreen} />
<Stack.Screen name="Relationship Details" component={RelationshipDetailScreen}/>
32 changes: 16 additions & 16 deletions src/relationships/index.ts
Original file line number Diff line number Diff line change
@@ -22,9 +22,9 @@ export const rootsLogo = rwLogo;
export const starLogo = starPng;

export const YOU_ALIAS = "You"
export const ROOTS_BOT = "RootsWallet Bot";
export const PRISM_BOT = "Prism Bot";

export const ROOTS_BOT = "rootsbot1";
export const PRISM_BOT = "prismbot1";
export const LIBRARY_BOT = "did:prism:librarybot1";
const IOG_TECH = "did:prism:iogtech1";
const ROOTSID = "did:prism:rootsid";
@@ -85,17 +85,17 @@ export function getRelItem(relId) {
}
}

// export async function initDemoRels() {
// logger("rels - init demo rels")
// await createRelItem(ROOTS_BOT,"RootsWallet",rootsLogo,ROOTS_BOT)
// await createRelItem(PRISM_BOT,"Atala Prism",prismLogo,PRISM_BOT)
// await createRelItem(LIBRARY_BOT,"Library",personLogo,LIBRARY_BOT)
// await createRelItem(IOG_TECH, "IOG Tech Community",iogLogo,IOG_TECH);
// await createRelItem(ROOTSID, "RootsID",rootsLogo,ROOTSID);
// await createRelItem(LANCE, "MeGrimLance",lanceLogo,LANCE);
// await createRelItem(TONY,"Tony.Rose",tonyLogo,TONY)
// await createRelItem(DARRELL,"Darrell O'Donnell",darrellLogo,DARRELL)
// await createRelItem(BUTCH,"Butch Clark",butchLogo,BUTCH)
// await createRelItem(ESTEBAN,"Esteban Garcia",estebanLogo,ESTEBAN)
// await createRelItem(RODO,"Rodolfo Miranda",rodoLogo,RODO)
// }
export async function initDemoRels() {
logger("rels - init demo rels")
await createRelItem(ROOTS_BOT,"RootsWallet",rootsLogo,ROOTS_BOT)
await createRelItem(PRISM_BOT,"Atala Prism",prismLogo,PRISM_BOT)
await createRelItem(LIBRARY_BOT,"Library",personLogo,LIBRARY_BOT)
await createRelItem(IOG_TECH, "IOG Tech Community",iogLogo,IOG_TECH);
await createRelItem(ROOTSID, "RootsID",rootsLogo,ROOTSID);
await createRelItem(LANCE, "MeGrimLance",lanceLogo,LANCE);
await createRelItem(TONY,"Tony.Rose",tonyLogo,TONY)
await createRelItem(DARRELL,"Darrell O'Donnell",darrellLogo,DARRELL)
await createRelItem(BUTCH,"Butch Clark",butchLogo,BUTCH)
await createRelItem(ESTEBAN,"Esteban Garcia",estebanLogo,ESTEBAN)
await createRelItem(RODO,"Rodolfo Miranda",rodoLogo,RODO)
}
177 changes: 61 additions & 116 deletions src/roots/index.ts

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions src/schemas/WalletSchema.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
export const CRED_ISSUE_TX = "ISSUE_CREDENTIAL"

export const DID_ALIAS = "alias";
export const DID_PUBLISH_TX = "PUBLISH_DID"
export const DID_URI_CANONICAL_FORM = "uriCanonical"
export const DID_URI_LONG_FORM = "uriLongForm"

export const WALLET_DIDS = "dids";
export const WALLET_TX_LOGS = "blockchainTxLogEntry";

45 changes: 10 additions & 35 deletions src/screens/ChatScreen.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useContext, useEffect, useState } from 'react';
import { KeyboardAvoidingView, Linking, NativeModules, StyleSheet, Text, View } from 'react-native';
import { KeyboardAvoidingView, NativeModules, StyleSheet, Text, View } from 'react-native';
import { Actions, ActionsProps, Bubble, ChatInput,
Composer, GiftedChat, InputToolbar, Message, SendButton } from 'react-native-gifted-chat';

@@ -219,21 +219,6 @@ export default function ChatScreen({ route, navigation }) {
// )
// }

function processBubbleClick(context,message) {
console.log("bubble pressed",context,message)
switch(message.type) {
case roots.BLOCKCHAIN_URL_MSG_TYPE:
console.log("Clicked blockchain url msg",message.data)
Linking.openURL(message.data)
break;
case roots.DID_MSG_TYPE:
console.log("Clickable did msg",message.data)
showQR(message.data)
default:
console.log("Clicked non-active message type",message.type)
}
}

//#fad58b
function renderBubble(props) {
//console.log("render bubble with props",props.currentMessage)
@@ -390,12 +375,12 @@ export default function ChatScreen({ route, navigation }) {
<GiftedChat
isTyping={processing}
messages={messages.sort((a, b) => b.createdAt - a.createdAt)}
onPress={ (context, message) => processBubbleClick(context,message)}
onPress={ (context, message) => console.log("bubble pressed",context,message)}
onQuickReply={reply => handleQuickReply(reply)}
onSend={messages => handleSend(messages)}
parsePatterns={(linkStyle) => [
{
pattern: /Your DID was added to Prism/,
pattern: /Published to Prism/,
style: styles.prism,
onPress: (tag) => setShowSystem(!showSystem),
},
@@ -405,36 +390,26 @@ export default function ChatScreen({ route, navigation }) {
onPress: (tag) => showQR(roots.getDid(chat.fromAlias).uriLongForm),
},
{
pattern: /did:prism:[\S]*/,
pattern: /did:prism:*/,
style: styles.prism,
onPress: (tag) => showQR(tag),
},
{
type: 'url',
style: styles.clickableListTitle,
onPress: (tag) => Linking.openURL(tag),
},
{
pattern: /Click to see the blockchain details/,
style: styles.prism,
}
]}
//quickReplyStyle={{backgroundColor: '#e69138',borderColor: '#e69138',elevation: 3}}
placeholder={"Make a note..."}
//{type: 'url', style: styles.url, onPress: onUrlPress},
]}
//placeholder={"Type your message"}
renderInputToolbar={props => renderInputToolbar(props)}
//renderActions={renderActions}
renderAllAvatars={true}
renderAvatarOnTop={true}
renderBubble={renderBubble}
renderQuickReplySend={() => <Text style={{color: '#e69138',fontSize: 18}}>Confirm</Text>}
renderUsernameOnMessage={true}
showAvatarForEveryMessage={true}
user={mapUser(getRelItem(chat.id))}
/>
</View>
);
// {
// Platform.OS === 'android' && <KeyboardAoidingView behavior="padding" />
// Platform.OS === 'android' && <KeyboardAvoidingView behavior="padding" />
// }

//, ...(message.type === BLOCKCHAIN_URI_MSG_TYPE) && {system: true}
@@ -459,8 +434,8 @@ export default function ChatScreen({ route, navigation }) {
mappedMsg["text"] = "more details available"
}
}
if(message["data"]) {
mappedMsg["data"] = message["data"]
if(message["cred"]) {
mappedMsg["cred"] = message["cred"]
}
//image: 'https://www.google.com/images/branding/googlelogo/1x/googlelogo_light_color_272x92dp.png',
// You can also add a video prop:
6 changes: 2 additions & 4 deletions src/screens/CreateRelScreen.js
Original file line number Diff line number Diff line change
@@ -3,21 +3,19 @@ import { NativeModules, StyleSheet, Text, View } from 'react-native';
import { IconButton, Title } from 'react-native-paper';
import { v4 as uuidv4 } from 'uuid';

import { YOU_ALIAS } from '../relationships';
import { initRoot } from '../roots';
import { createRel } from '../roots';
import FormButton from '../components/FormButton';
import FormInput from '../components/FormInput';

const { PrismModule } = NativeModules;

export default function CreateRelScreen({ navigation }) {
const [relDid, setRelDid] = useState('did:prism:'+Date.now());
const [relName, setRelName] = useState('');
const [problemDisabled, setProblemDisabled] = useState(true)

async function handleButtonPress() {
if (relName.length > 0) {
const rel = await initRoot(relName,YOU_ALIAS,relDid)
const rel = await createRel(relName)
if(rel) {
console.log("Created rel",rel)
setProblemDisabled(true)
18 changes: 1 addition & 17 deletions src/screens/CreateWalletScreen.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useState } from 'react';
import { Button, StyleSheet, Text, TextInput, View } from 'react-native';
import Hyperlink from 'react-native-hyperlink'
import { Title } from 'react-native-paper';

import FormButton from '../components/FormButton';
@@ -19,7 +18,6 @@ export default function CreateWalletScreen({ navigation }) {
// const [loading, setLoading] = useState(true);
const [mnemonic, setMnemonic] = useState('');
const [password, setPassword] = useState('');
const [confirmPassword, setConfirmPassword] = useState('');
const [walletName, setWalletName] = useState(TEST_WALLET_NAME);
const [problemDisabled, setProblemDisabled] = useState(true)
console.log("CreateWalletScreen - start")
@@ -51,7 +49,7 @@ export default function CreateWalletScreen({ navigation }) {
while(!initialized) {
return (
<View style={styles.modalContainer}>
<Title style={styles.titleText}>Create wallet password:</Title>
<Title style={styles.titleText}>Creating new wallet with password:</Title>
<FormInput
labelName="Wallet Name"
value={walletName}
@@ -64,12 +62,6 @@ export default function CreateWalletScreen({ navigation }) {
secureTextEntry={true}
onChangeText={(userPassword) => setPassword(userPassword)}
/>
<FormInput
labelName="Confirm Password"
value={confirmPassword}
secureTextEntry={true}
onChangeText={(userPassword) => setConfirmPassword(userPassword)}
/>
<Text disable={problemDisabled} style={displayProblem(problemDisabled)}>Could not create wallet</Text>
<FormButton
title="Create Wallet"
@@ -88,14 +80,6 @@ export default function CreateWalletScreen({ navigation }) {
}
}}
/>
<View>
<Hyperlink linkStyle={ { color: '#2980b9', fontSize: 20 } }
linkText={ url => url === 'https://rootswallet.com/help' ? 'Need help?' : url }>
<Text style={ { fontSize: 15 } }>
https://rootswallet.com/help
</Text>
</Hyperlink>
</View>
</View>
);
}
25 changes: 18 additions & 7 deletions src/screens/RelationshipDetailScreen.js
Original file line number Diff line number Diff line change
@@ -47,7 +47,6 @@ export default function RelationshipDetailScreen({ route, navigation }) {
justifyContent: 'center',
}}
>

<Pressable
style={[
StyleSheet.absoluteFill,
@@ -75,12 +74,6 @@ export default function RelationshipDetailScreen({ route, navigation }) {
],
}}
>
<IconButton
icon="close-circle"
size={36}
color="#5b3a70"
onPress={() => navigation.goBack()}
/>
<Image source={rel.displayPictureUrl}
style={{
width:130,
@@ -93,6 +86,24 @@ export default function RelationshipDetailScreen({ route, navigation }) {
<Text style={styles.subText}>{rel.displayName}</Text>
<Divider/>
<Text style={styles.subText}>{rel.did}</Text>
<IconActions nav={navigation} add="Create Secure Chat" scan='Scan QR Code'/>
<Title style={styles.headingText}>Chats:</Title>
<FlatList
data={getChatsByRel(rel.id)}
keyExtractor={(item) => item.id.toString()}
ItemSeparatorComponent={() => <Divider />}
renderItem={({ item }) => (
<List.Item
title={item.title}
titleNumberOfLines={1}
titleStyle={styles.listTitle}
descriptionStyle={styles.listDescription}
descriptionNumberOfLines={1}
left={props => <Text style={styles.prism}>{item.title}</Text>}
onPress={() => navigation.navigate('Chat', { chatId: item.id })}
/>
)}
/>
</Animated.View>
</View>
);
9 changes: 3 additions & 6 deletions src/screens/RelationshipsScreen.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, {useState} from 'react';
import {FlatList, Image, SafeAreaView, StyleSheet, Text, View, TouchableOpacity} from 'react-native';
import { Divider, List } from 'react-native-paper';
import {getRelationships, YOU_ALIAS, PRISM_BOT, ROOTS_BOT} from '../relationships'
import {getRelationships} from '../relationships'
import Relationship from '../models/relationship'
import { getChatItem } from '../roots'
import styles from "../styles/styles";
@@ -11,10 +11,7 @@ const RelationshipsScreen = ({route,navigation}) => {
const {walletName} = route.params
console.log(`walletName: ${walletName}`)

const relationships = getRelationships(walletName).filter(
rel => rel.displayName !== YOU_ALIAS &&
rel.displayName !== PRISM_BOT &&
rel.displayName !== ROOTS_BOT)
const relationships = getRelationships(walletName).filter(rel => rel.displayName !== 'You')

const showRel = (rel) => {
console.log(`> RelationshipsScr.pressHandler( ${rel})`)
@@ -53,7 +50,7 @@ const RelationshipsScreen = ({route,navigation}) => {
<List.Item
title={item.displayName}
titleNumberOfLines={1}
titleStyle={styles.clickableListTitle}
titleStyle={styles.listTitle}
descriptionStyle={styles.listDescription}
descriptionNumberOfLines={1}
onPress={() => navigation.navigate('Chat', { chatId: getChatItem(item.id).id })}
42 changes: 7 additions & 35 deletions src/screens/ScanQRCodeScreen.js
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ import {
Button,
StyleSheet,
} from 'react-native';
import { IconButton } from 'react-native-paper';
import { useTheme } from '@react-navigation/native';
import { useCardAnimation } from '@react-navigation/stack';
import { BarCodeScanner } from 'expo-barcode-scanner';
@@ -36,7 +35,7 @@ export default function ScanQRCodeScreen({ route, navigation }) {
};

if (hasPermission === null) {
return <Text>Requesting camera permission</Text>;
return <Text>Requesting for camera permission</Text>;
}
if (hasPermission === false) {
return <Text>No access to camera</Text>;
@@ -57,46 +56,19 @@ export default function ScanQRCodeScreen({ route, navigation }) {
]}
onPress={navigation.goBack}
/>
<Animated.View
style={{
padding: 16,
width: '90%',
maxWidth: 400,
borderRadius: 3,
backgroundColor: colors.card,
alignItems: 'center',
justifyContent: 'center',
transform: [
{
scale: current.progress.interpolate({
inputRange: [0, 1],
outputRange: [0.9, 1],
extrapolate: 'clamp',
}),
},
],
}}
>
<IconButton
icon="close-circle"
size={36}
color="#5b3a70"
onPress={() => navigation.goBack()}
/>
<View style={{

alignItems: 'center',
justifyContent: 'center',
width: 250,
height: 250,
}}>
<BarCodeScanner
onBarCodeScanned={scanned ? undefined : handleBarCodeScanned}
style={StyleSheet.absoluteFillObject}
/>
{scanned && <Button title={'Tap to Scan Again'} onPress={() => setScanned(false)} />}
</View>
</Animated.View>
<BarCodeScanner
onBarCodeScanned={scanned ? undefined : handleBarCodeScanned}
style={StyleSheet.absoluteFillObject}
/>
{scanned && <Button title={'Tap to Scan Again'} onPress={() => setScanned(false)} />}
</View>
</View>
);
}
159 changes: 76 additions & 83 deletions src/screens/SettingsScreen.js
Original file line number Diff line number Diff line change
@@ -1,90 +1,83 @@
import React, { useEffect, useState } from 'react';
import {
Animated,
Button,
FlatList,
Image,
Text,
Pressable,
SafeAreaView,
StyleSheet,
View,
} from 'react-native';
import { useTheme } from '@react-navigation/native';
import {Picker} from '@react-native-picker/picker';
import { useCardAnimation } from '@react-navigation/stack';
import React, {useState} from 'react';
// import {withNavigation} from "react-navigation";
import {TouchableOpacity, TextInput, View, Text} from 'react-native';
import {HOME_SCREEN, RELATIONSHIPS_SCREEN} from "../constants/navigationConstants";
import styles from '../styles/styles'
import {SimpleLineIcons} from '@expo/vector-icons'
// const { PrismModule } = NativeModules;

import {logger} from '../logging';
import { Divider, IconButton, List, Title,ToggleButton } from 'react-native-paper';
import styles from "../styles/styles";
const Settings = ({navigation}) => {
console.log(`> Settings screen`);
const [tmpName, setTmpName] = useState('')
const [walletName, setWalletName] = useState('')
const [tmpPwd, setTmpPwd] = useState('')
const [walletPwd, setWalletPwd] = useState('')

import * as roots from '../roots'
const endEditing = () =>{
console.log('> endEditing()')
setWalletName(tmpName)
setWalletPwd(tmpPwd)
navigation.navigate(
RELATIONSHIPS_SCREEN,
{walletName: tmpName}
)
}

import IconActions from '../components/IconActions';
return (
<View>

export default function RelationshipDetailScreen({ route, navigation }) {
const [host, setHost] = useState(roots.getPrismHost());
const { colors } = useTheme();
const { current } = useCardAnimation();
<Text style={styles.header}>Enter Wallet Name: {tmpName}</Text>
<View style={styles.walletInputStyle}>
<SimpleLineIcons
name="wallet"
style={styles.walletIconStyle}
/>
<TextInput
style={styles.inputStyle}
onChangeText={(val) => setTmpName(val)}
onEndEditing={endEditing}
placeholder='Wallet Name'
/>
</View>

useEffect(() => {
roots.setPrismHost(host)
}, [host]);

return (
<View
style={{
flex: 1,
alignItems: 'center',
justifyContent: 'center',
}}
>
<Pressable
style={[
StyleSheet.absoluteFill,
{ backgroundColor: 'rgba(0, 0, 0, 0.5)' },
]}
onPress={navigation.goBack}
/>
<Animated.View
style={{
alignItems: 'center',
padding: 16,
width: '90%',
borderRadius: 3,
backgroundColor: "#bfafba",
justifyContent: 'center',
transform: [
{
scale: current.progress.interpolate({
inputRange: [0, 1],
outputRange: [0.9, 1],
extrapolate: 'clamp',
}),
},
],
}}
>
<IconButton
icon="close-circle"
size={36}
color="#5b3a70"
onPress={() => navigation.goBack()}
/>
<Text style={{fontSize: 18}}>Select Prism Node:</Text>
<View style={{backgroundColor: '#251520',width: "20%"}}>
<Picker
style={styles.clickableListTitle}
mode="dropdown"
dropdownIconColor="#e69138"
numberOfLines={5}
selectedValue={host}
onValueChange={(itemValue) => setHost(itemValue)}>
<Picker.Item label="Prism Test Net" value="ppp.atalaprism.io"/>
<Picker.Item label="Local Dev" value="ppp-node-test.atalaprism.io"/>
</Picker>

<Text style={styles.header}>Enter Password</Text>
<View style={styles.walletInputStyle}>
<TextInput
style={styles.inputStyle}
onChangeText={(val) => setTmpPwd(val)}
onEndEditing={endEditing}
placeholder='Wallet Password'
/>
</View>
<View style={styles.button}>
<TouchableOpacity
color='gold'
style={styles.button}
onPress={()=>{
console.log('in onPress handler...')
setWalletName(tmpName)
setWalletPwd(tmpPwd)
navigation.navigate(
RELATIONSHIPS_SCREEN,
{walletName: tmpName})
}
}
>
<Text style={styles.buttonText}>Create Wallet</Text>
</TouchableOpacity>
</View>



<Text>Final Name: {walletName}</Text>
</View>
</Animated.View>
</View>
);
}



);
};

// export default withNavigation(Settings)
export default Settings
8 changes: 1 addition & 7 deletions src/screens/ShowQRCodeScreen.js
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import { useTheme } from '@react-navigation/native';
import { useCardAnimation } from '@react-navigation/stack';

import {logger} from '../logging';
import { IconButton, ToggleButton } from 'react-native-paper';
import { ToggleButton } from 'react-native-paper';
import QRCode from 'react-native-qrcode-svg';
import { prismLogo } from '../roots'
import styles from "../styles/styles";
@@ -88,12 +88,6 @@ export default function ShowQRCodeScreen({ route, navigation }) {
],
}}
>
<IconButton
icon="close-circle"
size={36}
color="#5b3a70"
onPress={() => navigation.goBack()}
/>
<ToggleButton
icon={viewIcon}
value="toggle view switch"
25 changes: 8 additions & 17 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
@@ -44,15 +44,6 @@ const styles = StyleSheet.create({
alignSelf: 'center'

},
clickableListTitle: {
fontSize: 22,
color: '#e69138',
},
container: {
backgroundColor: '#251520',
flex: 1,
justifyContent: 'center',
},
detailTitle: {
fontSize: 20,
color: '#111111',
@@ -82,6 +73,11 @@ const styles = StyleSheet.create({
justifyContent: "flex-start"

},
container: {
backgroundColor: '#251520',
flex: 1,
justifyContent: 'center',
},
text: {
fontSize: 30,
},
@@ -131,24 +127,19 @@ const styles = StyleSheet.create({
display: 'none'
},
prism: {
color: '#940000',
textDecorationLine: 'underline',
color: 'red',
},
problem: {
color: 'red',
},
row: {
flexDirection: "row",
flexWrap: "wrap",
},
subText: {
subText: {
fontSize: 16,
marginBottom: 10,
color: '#111111',
fontWeight: 'normal',
alignSelf: "flex-start",
justifyContent: "flex-start"
},
},
})

export default styles
30 changes: 0 additions & 30 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -1507,11 +1507,6 @@
resolved "https://registry.yarnpkg.com/@react-native-community/masked-view/-/masked-view-0.1.10.tgz#5dda643e19e587793bc2034dd9bf7398ad43d401"
integrity sha512-rk4sWFsmtOw8oyx8SD3KSvawwaK7gRBSEIy2TAwURyGt+3TizssXP1r8nx3zY+R7v2vYYHXZ+k2/GULAT/bcaQ==

"@react-native-picker/picker@^2.4.1":
version "2.4.1"
resolved "https://registry.yarnpkg.com/@react-native-picker/picker/-/picker-2.4.1.tgz#92feb7e0672d739624517dae04bf4de1452dfcdc"
integrity sha512-1XWy3IQgwr7MWd30KdY1iUh2gQZD+JiotN1ifj/ptFUYKon/0UFwngKQaWCO/CP/FdLl20/huSSLwKedYrdMMA==

"@react-native/assets@1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@react-native/assets/-/assets-1.0.0.tgz#c6f9bf63d274bafc8e970628de24986b30a55c8e"
@@ -4610,13 +4605,6 @@ lines-and-columns@^1.1.6:
resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632"
integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==

linkify-it@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-2.2.0.tgz#e3b54697e78bf915c70a38acd78fd09e0058b1cf"
integrity sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==
dependencies:
uc.micro "^1.0.1"

locate-path@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e"
@@ -4785,11 +4773,6 @@ mdn-data@2.0.14:
resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50"
integrity sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==

mdurl@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e"
integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=

merge-options@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/merge-options/-/merge-options-3.0.4.tgz#84709c2aa2a4b24c1981f66c179fe5565cc6dbb7"
@@ -5847,14 +5830,6 @@ react-native-gifted-chat@1.0.0-beta-3:
use-memo-one "1.1.1"
uuid "3.4.0"

react-native-hyperlink@^0.0.19:
version "0.0.19"
resolved "https://registry.yarnpkg.com/react-native-hyperlink/-/react-native-hyperlink-0.0.19.tgz#ca375cde1d244bb94c551736852ee0d688c8bb1f"
integrity sha512-x4wuRGDMnnpWcRr5MCK1D2UcEuzD9IHK8lfjEhO/+QqXNaX31HdeD3ss3BXXZgHxpRYtLbTB0TuFcl1HHANp3w==
dependencies:
linkify-it "^2.2.0"
mdurl "^1.0.0"

react-native-iphone-x-helper@1.3.1, react-native-iphone-x-helper@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/react-native-iphone-x-helper/-/react-native-iphone-x-helper-1.3.1.tgz#20c603e9a0e765fd6f97396638bdeb0e5a60b010"
@@ -6912,11 +6887,6 @@ ua-parser-js@^0.7.30:
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.31.tgz#649a656b191dffab4f21d5e053e27ca17cbff5c6"
integrity sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ==

uc.micro@^1.0.1:
version "1.0.6"
resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac"
integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==

uglify-es@^3.1.9:
version "3.3.9"
resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.3.9.tgz#0c1c4f0700bed8dbc124cdb304d2592ca203e677"

0 comments on commit cf290de

Please sign in to comment.