Skip to content

Commit

Permalink
Merge pull request #70 from kryptokrona/feat/components
Browse files Browse the repository at this point in the history
feat(components): add components
  • Loading branch information
f-r00t authored May 16, 2024
2 parents d22c61f + 25934c5 commit 40ef4a8
Show file tree
Hide file tree
Showing 38 changed files with 13,225 additions and 13,672 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
25 changes: 12 additions & 13 deletions App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { StatusBar } from 'expo-status-bar';
import React, { useEffect, useState } from 'react';
import { ActivityIndicator, FlatList, Text, View, StyleSheet } from 'react-native';

Expand All @@ -10,14 +9,14 @@ export default function App() {
const [data, setData] = useState([]);


function fromHex(hex,str){
try{
str = decodeURIComponent(hex.replace(/(..)/g,'%$1'))
function fromHex(hex, str) {
try {
str = decodeURIComponent(hex.replace(/(..)/g, '%$1'))
str = JSON.parse(str)
setData(str)
setLoading(false)
}
catch(e){
catch (e) {
return
//str = hex
//console.log('invalid hex input: ' + hex)
Expand All @@ -34,12 +33,12 @@ export default function App() {
body: JSON.stringify({
jsonrpc: '2.0',
method: 'f_transaction_json',
params: {hash: transactions[tx].hash}
params: { hash: transactions[tx].hash }
})
})
.then((response) => response.json())
.then((json) => fromHex(json.result.tx.extra.substring(66)))
.catch((error) => console.error(error))
.then((response) => response.json())
.then((json) => fromHex(json.result.tx.extra.substring(66)))
.catch((error) => console.error(error))
}
}

Expand All @@ -49,7 +48,7 @@ export default function App() {
body: JSON.stringify({
jsonrpc: '2.0',
method: 'f_block_json',
params: {hash: blockHash}
params: { hash: blockHash }
})
})
.then((response) => response.json())
Expand All @@ -59,7 +58,7 @@ export default function App() {

const getBlockHashes = (blockCount) => {
let i;
for (i = 0; i < 100; i++) {
for (i = 0; i < 100; i++) {
fetch(nodeURL, {
method: 'POST',
body: JSON.stringify({
Expand All @@ -86,12 +85,12 @@ export default function App() {
.then((response) => response.json())
.then((json) => getBlockHashes(json.result.count))
.catch((error) => console.error(error))
//.finally(() => setLoading(false));
//.finally(() => setLoading(false));
}, []);

return (
<View style={{ flex: 1, padding: 24 }}>
{isLoading ? <ActivityIndicator/> : (
{isLoading ? <ActivityIndicator /> : (
<Text>{JSON.stringify(data)}</Text>
)}
</View>
Expand Down
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def enableHermes = project.ext.react.get("enableHermes", false);
android {
compileSdkVersion rootProject.ext.compileSdkVersion

compileOptions {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs')
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 20
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 33
supportLibVersion = "28.0.0"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,4 @@
"vm": "vm-browserify",
"tls": false
}
}
}
Loading

0 comments on commit 40ef4a8

Please sign in to comment.