From 44bfc55a4b7dc871cbedfa0bf8776be0bd0a49a4 Mon Sep 17 00:00:00 2001 From: a Date: Fri, 31 May 2024 16:19:51 +0200 Subject: [PATCH] first commit --- .bundle/config | 2 + .eslintrc.js | 4 + .gitignore | 74 + .prettierrc.js | 7 + .watchmanconfig | 1 + App.js | 92 + Gemfile | 9 + README.md | 79 + __tests__/App.test.tsx | 17 + android/app/build.gradle | 118 + android/app/debug.keystore | Bin 0 -> 2257 bytes android/app/proguard-rules.pro | 10 + android/app/src/debug/AndroidManifest.xml | 9 + android/app/src/main/AndroidManifest.xml | 25 + .../src/main/java/com/zustand/MainActivity.kt | 22 + .../main/java/com/zustand/MainApplication.kt | 43 + .../res/drawable/rn_edit_text_material.xml | 37 + .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3056 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 5024 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2096 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 2858 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4569 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 7098 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 6464 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 10676 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 9250 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 15523 bytes android/app/src/main/res/values/strings.xml | 3 + android/app/src/main/res/values/styles.xml | 9 + android/build.gradle | 21 + android/gradle.properties | 41 + android/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 63721 bytes .../gradle/wrapper/gradle-wrapper.properties | 7 + android/gradlew | 249 + android/gradlew.bat | 92 + android/settings.gradle | 4 + app.json | 4 + babel.config.js | 3 + index.js | 9 + ios/.xcode.env | 11 + ios/Podfile | 40 + ios/zustand.xcodeproj/project.pbxproj | 688 + .../xcshareddata/xcschemes/zustand.xcscheme | 88 + ios/zustand/AppDelegate.h | 6 + ios/zustand/AppDelegate.mm | 31 + .../AppIcon.appiconset/Contents.json | 53 + ios/zustand/Images.xcassets/Contents.json | 6 + ios/zustand/Info.plist | 52 + ios/zustand/LaunchScreen.storyboard | 47 + ios/zustand/PrivacyInfo.xcprivacy | 38 + ios/zustand/main.m | 10 + ios/zustandTests/Info.plist | 24 + ios/zustandTests/zustandTests.m | 66 + jest.config.js | 3 + metro.config.js | 11 + package-lock.json | 14168 ++++++++++++++++ package.json | 42 + tsconfig.json | 6 + 58 files changed, 16381 insertions(+) create mode 100644 .bundle/config create mode 100644 .eslintrc.js create mode 100644 .gitignore create mode 100644 .prettierrc.js create mode 100644 .watchmanconfig create mode 100644 App.js create mode 100644 Gemfile create mode 100644 README.md create mode 100644 __tests__/App.test.tsx create mode 100644 android/app/build.gradle create mode 100644 android/app/debug.keystore create mode 100644 android/app/proguard-rules.pro create mode 100644 android/app/src/debug/AndroidManifest.xml create mode 100644 android/app/src/main/AndroidManifest.xml create mode 100644 android/app/src/main/java/com/zustand/MainActivity.kt create mode 100644 android/app/src/main/java/com/zustand/MainApplication.kt create mode 100644 android/app/src/main/res/drawable/rn_edit_text_material.xml create mode 100644 android/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 android/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 android/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 android/app/src/main/res/values/strings.xml create mode 100644 android/app/src/main/res/values/styles.xml create mode 100644 android/build.gradle create mode 100644 android/gradle.properties create mode 100644 android/gradle/wrapper/gradle-wrapper.jar create mode 100644 android/gradle/wrapper/gradle-wrapper.properties create mode 100755 android/gradlew create mode 100644 android/gradlew.bat create mode 100644 android/settings.gradle create mode 100644 app.json create mode 100644 babel.config.js create mode 100644 index.js create mode 100644 ios/.xcode.env create mode 100644 ios/Podfile create mode 100644 ios/zustand.xcodeproj/project.pbxproj create mode 100644 ios/zustand.xcodeproj/xcshareddata/xcschemes/zustand.xcscheme create mode 100644 ios/zustand/AppDelegate.h create mode 100644 ios/zustand/AppDelegate.mm create mode 100644 ios/zustand/Images.xcassets/AppIcon.appiconset/Contents.json create mode 100644 ios/zustand/Images.xcassets/Contents.json create mode 100644 ios/zustand/Info.plist create mode 100644 ios/zustand/LaunchScreen.storyboard create mode 100644 ios/zustand/PrivacyInfo.xcprivacy create mode 100644 ios/zustand/main.m create mode 100644 ios/zustandTests/Info.plist create mode 100644 ios/zustandTests/zustandTests.m create mode 100644 jest.config.js create mode 100644 metro.config.js create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 tsconfig.json diff --git a/.bundle/config b/.bundle/config new file mode 100644 index 0000000..848943b --- /dev/null +++ b/.bundle/config @@ -0,0 +1,2 @@ +BUNDLE_PATH: "vendor/bundle" +BUNDLE_FORCE_RUBY_PLATFORM: 1 diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..187894b --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: '@react-native', +}; diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d5ae456 --- /dev/null +++ b/.gitignore @@ -0,0 +1,74 @@ +# 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 +**/.xcode.env.local + +# Android/IntelliJ +# +build/ +.idea +.gradle +local.properties +*.iml +*.hprof +.cxx/ +*.keystore +!debug.keystore + +# node.js +# +node_modules/ +npm-debug.log +yarn-error.log + +# 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 +**/fastlane/test_output + +# Bundle artifact +*.jsbundle + +# Ruby / CocoaPods +**/Pods/ +/vendor/bundle/ + +# Temporary files created by Metro to check the health of the file watcher +.metro-health-check* + +# testing +/coverage + +# Yarn +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..2b54074 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,7 @@ +module.exports = { + arrowParens: 'avoid', + bracketSameLine: true, + bracketSpacing: false, + singleQuote: true, + trailingComma: 'all', +}; diff --git a/.watchmanconfig b/.watchmanconfig new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/.watchmanconfig @@ -0,0 +1 @@ +{} diff --git a/App.js b/App.js new file mode 100644 index 0000000..ff3e580 --- /dev/null +++ b/App.js @@ -0,0 +1,92 @@ +/** + * Sample React Native App + * https://github.com/facebook/react-native + * + * @format + */ + +import React from "react"; +import { + SafeAreaView, + ScrollView, + StatusBar, + StyleSheet, + Text, + useColorScheme, + View, + Button, +} from "react-native"; + +import { useNetInfoInstance } from "@react-native-community/netinfo"; + +import { + useQuery, + useMutation, + useQueryClient, + QueryClient, + QueryClientProvider, +} from "@tanstack/react-query"; +import { PersistQueryClientProvider } from "@tanstack/react-query-persist-client"; +import { createAsyncStoragePersister } from "@tanstack/query-async-storage-persister"; +import AsyncStorage from "@react-native-async-storage/async-storage"; + +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + gcTime: 1000 * 60 * 60 * 24, // 24 hours + }, + }, +}); + +const asyncStoragePersister = createAsyncStoragePersister({ + storage: AsyncStorage, +}); + + +// Define the "addTodo" mutation +queryClient.setMutationDefaults(["addTodo"], { + mutationFn: ({ page }) => { + return makeCall(page); + }, + retry: 3, +}); + + +function makeCall(page) { + return fetch(`http://10.0.2.2:8080/${page}`) + .then(response => { + return response; + }) + .catch(error => { + console.log(error); + console.log(12); + }); +} + +function App() { + return ( + + + + + + + + + ); +} + +const ReqButton = () => { + const mutation = useMutation({ mutationKey: ["addTodo"] }); + return ( +