Skip to content

Commit

Permalink
iOS support added, toast adaptation for both Androd and iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Simbad Marino authored and Simbad Marino committed Feb 19, 2022
1 parent 6f2248d commit ecd5729
Show file tree
Hide file tree
Showing 30 changed files with 2,515 additions and 50 deletions.
108 changes: 59 additions & 49 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import { QRCode } from 'react-native-custom-qr-codes';
import prompt from 'react-native-prompt-android';
import AsyncStorage from '@react-native-async-storage/async-storage';
import Clipboard from '@react-native-clipboard/clipboard';
import { RootSiblingParent } from 'react-native-root-siblings';
import Toast from 'react-native-root-toast';
//import Toast from "./components/Toast.js";


Expand Down Expand Up @@ -296,7 +298,9 @@ async function getBalanceBTT(){
console.log('There has been a problem with your fetch operation: ' + error.message);
//Alert.alert("Error", "Password already set, use cli to change it if needed");
console.log("BTFS daemon not running in background...")
ToastAndroid.show("dCloud failed to connect to BTFS...", ToastAndroid.SHORT);
// Add a Toast on screen.
Toast.show('dCloud failed to connect to BTFS...', {duration: Toast.durations.LONG,});
//ToastAndroid.show("dCloud failed to connect to BTFS...", ToastAndroid.SHORT);
// ADD THIS THROW error
//throw error;
});
Expand Down Expand Up @@ -666,55 +670,61 @@ state = {
render() {




return (
<AppearanceProvider>
<NavigationContainer theme={DarkTheme}>
<Tab.Navigator screenOptions={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => {
let iconName;

if (route.name === 'Wallet') {
iconName = focused ? 'account-balance-wallet' : 'account-balance-wallet';
}
else if (route.name === 'Settings') {
iconName = focused ? 'settings' : 'settings';
}
else if (route.name === 'Files') {
iconName = focused ? 'storage' : 'storage';
}
else if (route.name === 'Terminal') {
iconName = focused ? 'code' : 'code';
}
else if (route.name === 'dWeb') {
iconName = focused ? 'cloud' : 'cloud';
}



// You can return any component that you like here!
return <Icon name={iconName} size={size} color={color} />;
},
})}
tabBarOptions={{
activeTintColor: 'white',
inactiveTintColor: 'gray',
}}
>

<Tab.Screen name="Files" component={RenterScreen} />
<Tab.Screen name="Wallet" component={WalletScreen} />
<Tab.Screen name="Terminal" component={TerminalScreen} />
<Tab.Screen name="dWeb" component={dWebScreen} />
<Tab.Screen name="Settings" component={SettingsScreen} />




</Tab.Navigator>
</NavigationContainer>
</AppearanceProvider>



<RootSiblingParent>
<AppearanceProvider>

<NavigationContainer theme={DarkTheme}>
<Tab.Navigator screenOptions={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => {
let iconName;

if (route.name === 'Wallet') {
iconName = focused ? 'account-balance-wallet' : 'account-balance-wallet';
}
else if (route.name === 'Settings') {
iconName = focused ? 'settings' : 'settings';
}
else if (route.name === 'Files') {
iconName = focused ? 'storage' : 'storage';
}
else if (route.name === 'Terminal') {
iconName = focused ? 'code' : 'code';
}
else if (route.name === 'dWeb') {
iconName = focused ? 'cloud' : 'cloud';
}



// You can return any component that you like here!
return <Icon name={iconName} size={size} color={color} />;
},
})}
tabBarOptions={{
activeTintColor: 'white',
inactiveTintColor: 'gray',
}}
>

<Tab.Screen name="Files" component={RenterScreen} />
<Tab.Screen name="Wallet" component={WalletScreen} />
<Tab.Screen name="Terminal" component={TerminalScreen} />
<Tab.Screen name="dWeb" component={dWebScreen} />
<Tab.Screen name="Settings" component={SettingsScreen} />

</Tab.Navigator>
</NavigationContainer>

</AppearanceProvider>
</RootSiblingParent>


);

}
Expand Down Expand Up @@ -824,4 +834,4 @@ tabsButton:{
justifyContent: 'space-evenly'
}

});
});

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"images" : [
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
6 changes: 6 additions & 0 deletions dCloud_ios.swiftpm/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
12 changes: 12 additions & 0 deletions dCloud_ios.swiftpm/ContentView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import SwiftUI

struct ContentView: View {
var body: some View {
VStack {
Image(systemName: "cloud")
.imageScale(.large)
.foregroundColor(.accentColor)
Text("Hello, dCloud!")
}
}
}
10 changes: 10 additions & 0 deletions dCloud_ios.swiftpm/MyApp.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import SwiftUI

@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
42 changes: 42 additions & 0 deletions dCloud_ios.swiftpm/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// swift-tools-version: 5.5

// WARNING:
// This file is automatically generated.
// Do not edit it by hand because the contents will be replaced.

import PackageDescription
import AppleProductTypes

let package = Package(
name: "dCloud_ios",
platforms: [
.iOS("15.2")
],
products: [
.iOSApplication(
name: "dCloud_ios",
targets: ["AppModule"],
bundleIdentifier: "cctechmx.dCloud-ios",
displayVersion: "1.0",
bundleVersion: "1",
iconAssetName: "AppIcon",
accentColorAssetName: "AccentColor",
supportedDeviceFamilies: [
.pad,
.phone
],
supportedInterfaceOrientations: [
.portrait,
.landscapeRight,
.landscapeLeft,
.portraitUpsideDown(.when(deviceFamilies: [.pad]))
]
)
],
targets: [
.executableTarget(
name: "AppModule",
path: "."
)
]
)
33 changes: 33 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'

target 'justshare' do
config = use_native_modules!

use_react_native!(:path => config["reactNativePath"])

target 'justshareTests' do
inherit! :complete
# Pods for testing
end

# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
#use_flipper!
#post_install do |installer|
# flipper_post_install(installer)
#end
end

target 'justshare-tvOS' do
# Pods for justshare-tvOS

target 'justshare-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
Loading

0 comments on commit ecd5729

Please sign in to comment.