From 2af291057ad3182eb6466898cc70929e1ff9a4a4 Mon Sep 17 00:00:00 2001 From: Jaco Date: Tue, 21 Dec 2021 16:44:30 +0100 Subject: [PATCH] Remove RN example app (no maintainer) (#566) * Remove RN example app (no maintainer) * Adjust tsconfig.json * yarn.lock --- packages/exampleReactNative/.gitignore | 64 -- packages/exampleReactNative/.skip-npm | 0 packages/exampleReactNative/App.tsx | 165 ---- packages/exampleReactNative/README.md | 29 - packages/exampleReactNative/android/app/_BUCK | 55 -- .../android/app/build.gradle | 202 ---- .../android/app/build_defs.bzl | 19 - .../android/app/debug.keystore | Bin 2257 -> 0 bytes .../android/app/proguard-rules.pro | 10 - .../android/app/src/debug/AndroidManifest.xml | 8 - .../android/app/src/main/AndroidManifest.xml | 26 - .../com/examplereactnative/MainActivity.java | 15 - .../examplereactnative/MainApplication.java | 74 -- .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 3056 -> 0 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 5024 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 2096 -> 0 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 2858 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 4569 -> 0 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 7098 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 6464 -> 0 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 10676 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 9250 -> 0 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 15523 -> 0 bytes .../app/src/main/res/values/strings.xml | 3 - .../app/src/main/res/values/styles.xml | 9 - .../exampleReactNative/android/build.gradle | 38 - .../android/gradle.properties | 21 - .../android/gradle/wrapper/gradle-wrapper.jar | Bin 55616 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 5 - packages/exampleReactNative/android/gradlew | 188 ---- .../exampleReactNative/android/gradlew.bat | 100 -- .../android/settings.gradle | 5 - packages/exampleReactNative/app.json | 4 - packages/exampleReactNative/babel.config.js | 6 - packages/exampleReactNative/index.js | 11 - packages/exampleReactNative/ios/Podfile | 54 - .../ios/exampleReactNative-tvOS/Info.plist | 53 - .../exampleReactNative-tvOSTests/Info.plist | 24 - .../project.pbxproj | 923 ------------------ .../exampleReactNative-tvOS.xcscheme | 129 --- .../xcschemes/exampleReactNative.xcscheme | 129 --- .../contents.xcworkspacedata | 10 - .../ios/exampleReactNative/AppDelegate.h | 15 - .../ios/exampleReactNative/AppDelegate.m | 42 - .../Base.lproj/LaunchScreen.xib | 42 - .../AppIcon.appiconset/Contents.json | 38 - .../Images.xcassets/Contents.json | 6 - .../ios/exampleReactNative/Info.plist | 57 -- .../ios/exampleReactNative/main.m | 16 - .../ios/exampleReactNativeTests/Info.plist | 24 - .../exampleReactNativeTests.m | 72 -- packages/exampleReactNative/metro.config.js | 37 - .../exampleReactNative/nodeGlobalsShim.js | 51 - packages/exampleReactNative/package.json | 61 -- packages/exampleReactNative/tsconfig.json | 13 - tsconfig.eslint.json | 9 +- tsconfig.json | 1 - yarn.lock | 418 +------- 58 files changed, 32 insertions(+), 3249 deletions(-) delete mode 100755 packages/exampleReactNative/.gitignore delete mode 100644 packages/exampleReactNative/.skip-npm delete mode 100644 packages/exampleReactNative/App.tsx delete mode 100644 packages/exampleReactNative/README.md delete mode 100755 packages/exampleReactNative/android/app/_BUCK delete mode 100755 packages/exampleReactNative/android/app/build.gradle delete mode 100644 packages/exampleReactNative/android/app/build_defs.bzl delete mode 100644 packages/exampleReactNative/android/app/debug.keystore delete mode 100644 packages/exampleReactNative/android/app/proguard-rules.pro delete mode 100644 packages/exampleReactNative/android/app/src/debug/AndroidManifest.xml delete mode 100755 packages/exampleReactNative/android/app/src/main/AndroidManifest.xml delete mode 100644 packages/exampleReactNative/android/app/src/main/java/com/examplereactnative/MainActivity.java delete mode 100644 packages/exampleReactNative/android/app/src/main/java/com/examplereactnative/MainApplication.java delete mode 100644 packages/exampleReactNative/android/app/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 packages/exampleReactNative/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png delete mode 100644 packages/exampleReactNative/android/app/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 packages/exampleReactNative/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png delete mode 100644 packages/exampleReactNative/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 packages/exampleReactNative/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png delete mode 100644 packages/exampleReactNative/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 packages/exampleReactNative/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png delete mode 100644 packages/exampleReactNative/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 packages/exampleReactNative/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png delete mode 100755 packages/exampleReactNative/android/app/src/main/res/values/strings.xml delete mode 100644 packages/exampleReactNative/android/app/src/main/res/values/styles.xml delete mode 100644 packages/exampleReactNative/android/build.gradle delete mode 100644 packages/exampleReactNative/android/gradle.properties delete mode 100644 packages/exampleReactNative/android/gradle/wrapper/gradle-wrapper.jar delete mode 100644 packages/exampleReactNative/android/gradle/wrapper/gradle-wrapper.properties delete mode 100755 packages/exampleReactNative/android/gradlew delete mode 100644 packages/exampleReactNative/android/gradlew.bat delete mode 100755 packages/exampleReactNative/android/settings.gradle delete mode 100644 packages/exampleReactNative/app.json delete mode 100644 packages/exampleReactNative/babel.config.js delete mode 100644 packages/exampleReactNative/index.js delete mode 100644 packages/exampleReactNative/ios/Podfile delete mode 100644 packages/exampleReactNative/ios/exampleReactNative-tvOS/Info.plist delete mode 100644 packages/exampleReactNative/ios/exampleReactNative-tvOSTests/Info.plist delete mode 100644 packages/exampleReactNative/ios/exampleReactNative.xcodeproj/project.pbxproj delete mode 100644 packages/exampleReactNative/ios/exampleReactNative.xcodeproj/xcshareddata/xcschemes/exampleReactNative-tvOS.xcscheme delete mode 100644 packages/exampleReactNative/ios/exampleReactNative.xcodeproj/xcshareddata/xcschemes/exampleReactNative.xcscheme delete mode 100644 packages/exampleReactNative/ios/exampleReactNative.xcworkspace/contents.xcworkspacedata delete mode 100644 packages/exampleReactNative/ios/exampleReactNative/AppDelegate.h delete mode 100644 packages/exampleReactNative/ios/exampleReactNative/AppDelegate.m delete mode 100644 packages/exampleReactNative/ios/exampleReactNative/Base.lproj/LaunchScreen.xib delete mode 100644 packages/exampleReactNative/ios/exampleReactNative/Images.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 packages/exampleReactNative/ios/exampleReactNative/Images.xcassets/Contents.json delete mode 100644 packages/exampleReactNative/ios/exampleReactNative/Info.plist delete mode 100644 packages/exampleReactNative/ios/exampleReactNative/main.m delete mode 100644 packages/exampleReactNative/ios/exampleReactNativeTests/Info.plist delete mode 100644 packages/exampleReactNative/ios/exampleReactNativeTests/exampleReactNativeTests.m delete mode 100644 packages/exampleReactNative/metro.config.js delete mode 100644 packages/exampleReactNative/nodeGlobalsShim.js delete mode 100644 packages/exampleReactNative/package.json delete mode 100644 packages/exampleReactNative/tsconfig.json diff --git a/packages/exampleReactNative/.gitignore b/packages/exampleReactNative/.gitignore deleted file mode 100755 index aadce1a1..00000000 --- a/packages/exampleReactNative/.gitignore +++ /dev/null @@ -1,64 +0,0 @@ -# OSX -# -.DS_Store - -# Xcode -# -build/ -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata -*.xccheckout -*.moved-aside -DerivedData -*.hmap -*.ipa -*.xcuserstate -project.xcworkspace - -# Android/IntelliJ -# -build/ -.idea -.gradle -local.properties -*.iml - -# Visual Studio Code -# -.vscode/ - -# node.js -# -node_modules/ -npm-debug.log -yarn-error.log - -# BUCK -buck-out/ -\.buckd/ -*.keystore -!debug.keystore - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://docs.fastlane.tools/best-practices/source-control/ - -*/fastlane/report.xml -*/fastlane/Preview.html -*/fastlane/screenshots - -# Bundle artifact -*.jsbundle - -# CocoaPods -/ios/Pods/ diff --git a/packages/exampleReactNative/.skip-npm b/packages/exampleReactNative/.skip-npm deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/exampleReactNative/App.tsx b/packages/exampleReactNative/App.tsx deleted file mode 100644 index 0304f697..00000000 --- a/packages/exampleReactNative/App.tsx +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright 2017-2021 @polkadot/example-react authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import React, { useCallback, useEffect, useState } from 'react'; -import { Button, SafeAreaView, ScrollView, StatusBar, StyleSheet, Text, View } from 'react-native'; -import { Colors } from 'react-native/Libraries/NewAppScreen'; - -import Identicon from '@polkadot/reactnative-identicon'; -import { keyring } from '@polkadot/ui-keyring'; -import { settings } from '@polkadot/ui-settings'; -import { cryptoWaitReady, mnemonicGenerate } from '@polkadot/util-crypto'; - -const styles = StyleSheet.create({ - body: { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access - backgroundColor: Colors.white - }, - buttonContainer: { - alignItems: 'flex-start', - flex: 1, - flexDirection: 'column' - }, - mainTitle: { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access - color: Colors.black, - fontSize: 28, - fontWeight: '600' - }, - scrollView: { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access - backgroundColor: Colors.lighter - }, - sectionContainer: { - marginTop: 32, - paddingHorizontal: 24 - }, - sectionDescription: { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access - color: Colors.dark, - fontSize: 18, - fontWeight: '400', - marginTop: 8 - }, - sectionTitle: { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access - color: Colors.black, - fontSize: 24, - fontWeight: '600' - } -}); - -const globalAny = global as unknown as Window; - -export default function App (): React.ReactElement | null { - const [isReady, setReady] = useState(false); - const [address, setAddress] = useState(null); - const [phrase, setPhrase] = useState(null); - const [ss58Format, setSS58Format] = useState(42); - - const _onClickNew = useCallback( - (): void => { - const phrase = mnemonicGenerate(12); - const { address } = keyring.createFromUri(phrase); - - setAddress(keyring.encodeAddress(address, ss58Format)); - setPhrase(phrase); - }, - [ss58Format] - ); - - const _onChangeSS58Format = useCallback( - (value: string) => - () => setSS58Format(parseInt(value, 10)), - [] - ); - - useEffect((): void => { - isReady && _onClickNew(); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [isReady]); - - useEffect((): void => { - isReady && address && setAddress(keyring.encodeAddress(address, ss58Format)); - }, [address, isReady, ss58Format]); - - const initialize = async (): Promise => { - try { - keyring.loadAll({ ss58Format: 42, type: 'sr25519' }); - } catch (e) { - console.log('Error loading keyring ', e); - } - - // eslint-disable-next-line @typescript-eslint/no-unsafe-call - await globalAny.localStorage.init(); - await cryptoWaitReady(); - - setReady(true); - _onClickNew(); - }; - - if (!isReady) { - // eslint-disable-next-line @typescript-eslint/no-floating-promises - initialize(); - } - - if (!isReady || !address || !phrase) { - return null; - } - - return ( - <> - - - - - - React-Native Example - - -