Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix startup nav and dark mode logic #28306

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 63 additions & 63 deletions rnmodules/react-native-drop-view/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1887,22 +1887,22 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@react-native/[email protected].5":
version "0.76.5"
resolved "https://registry.yarnpkg.com/@react-native/assets-registry/-/assets-registry-0.76.5.tgz#3343338813aa6354df9fec52af50d0b5f7f3d013"
integrity sha512-MN5dasWo37MirVcKWuysRkRr4BjNc81SXwUtJYstwbn8oEkfnwR9DaqdDTo/hHOnTdhafffLIa2xOOHcjDIGEw==
"@react-native/[email protected].6":
version "0.76.6"
resolved "https://registry.yarnpkg.com/@react-native/assets-registry/-/assets-registry-0.76.6.tgz#649af8a19cbabcea321dbcfb1a1ae04bb298d958"
integrity sha512-YI8HoReYiIwdFQs+k9Q9qpFTnsyYikZxgs/UVtVbhKixXDQF6F9LLvj2naOx4cfV+RGybNKxwmDl1vUok/dRFQ==

"@react-native/[email protected].5":
version "0.76.5"
resolved "https://registry.yarnpkg.com/@react-native/babel-plugin-codegen/-/babel-plugin-codegen-0.76.5.tgz#a7c32274351e51db9c0a7849ce8059940448c087"
integrity sha512-xe7HSQGop4bnOLMaXt0aU+rIatMNEQbz242SDl8V9vx5oOTI0VbZV9yLy6yBc6poUlYbcboF20YVjoRsxX4yww==
"@react-native/[email protected].6":
version "0.76.6"
resolved "https://registry.yarnpkg.com/@react-native/babel-plugin-codegen/-/babel-plugin-codegen-0.76.6.tgz#0c249966ab43ac2200aadd051abcec4691c9a845"
integrity sha512-yFC9I/aDBOBz3ZMlqKn2NY/mDUtCksUNZ7AQmBiTAeVTUP0ujEjE0hTOx5Qd+kok7A7hwZEX87HdSgjiJZfr5g==
dependencies:
"@react-native/codegen" "0.76.5"
"@react-native/codegen" "0.76.6"

"@react-native/[email protected].5":
version "0.76.5"
resolved "https://registry.yarnpkg.com/@react-native/babel-preset/-/babel-preset-0.76.5.tgz#794ca17e1107e46712153f296a4930de2048e20e"
integrity sha512-1Nu5Um4EogOdppBLI4pfupkteTjWfmI0hqW8ezWTg7Bezw0FtBj8yS8UYVd3wTnDFT9A5mA2VNoNUqomJnvj2A==
"@react-native/[email protected].6":
version "0.76.6"
resolved "https://registry.yarnpkg.com/@react-native/babel-preset/-/babel-preset-0.76.6.tgz#f84fd12ceb2961946c599714d379bf900e140952"
integrity sha512-ojlVWY6S/VE/nb9hIRetPMTsW9ZmGb2R3dnToEXAtQQDz41eHMHXbkw/k2h0THp6qhas25ruNvn3N5n2o+lBzg==
dependencies:
"@babel/core" "^7.25.2"
"@babel/plugin-proposal-export-default-from" "^7.24.7"
Expand Down Expand Up @@ -1945,15 +1945,15 @@
"@babel/plugin-transform-typescript" "^7.25.2"
"@babel/plugin-transform-unicode-regex" "^7.24.7"
"@babel/template" "^7.25.0"
"@react-native/babel-plugin-codegen" "0.76.5"
"@react-native/babel-plugin-codegen" "0.76.6"
babel-plugin-syntax-hermes-parser "^0.25.1"
babel-plugin-transform-flow-enums "^0.0.2"
react-refresh "^0.14.0"

"@react-native/[email protected].5":
version "0.76.5"
resolved "https://registry.yarnpkg.com/@react-native/codegen/-/codegen-0.76.5.tgz#4d89ec14a023d6946dbc44537c39b03bd006db7b"
integrity sha512-FoZ9VRQ5MpgtDAnVo1rT9nNRfjnWpE40o1GeJSDlpUMttd36bVXvsDm8W/NhX8BKTWXSX+CPQJsRcvN1UPYGKg==
"@react-native/[email protected].6":
version "0.76.6"
resolved "https://registry.yarnpkg.com/@react-native/codegen/-/codegen-0.76.6.tgz#1c6822c59ac25a1ce608562481caf25e535f091f"
integrity sha512-BABb3e5G/+hyQYEYi0AODWh2km2d8ERoASZr6Hv90pVXdUHRYR+yxCatX7vSd9rnDUYndqRTzD0hZWAucPNAKg==
dependencies:
"@babel/parser" "^7.25.3"
glob "^7.1.1"
Expand All @@ -1964,13 +1964,13 @@
nullthrows "^1.1.1"
yargs "^17.6.2"

"@react-native/[email protected].5":
version "0.76.5"
resolved "https://registry.yarnpkg.com/@react-native/community-cli-plugin/-/community-cli-plugin-0.76.5.tgz#e701a9f99565504a2510d1b54713b1c5dd0f1bb4"
integrity sha512-3MKMnlU0cZOWlMhz5UG6WqACJiWUrE3XwBEumzbMmZw3Iw3h+fIsn+7kLLE5EhzqLt0hg5Y4cgYFi4kOaNgq+g==
"@react-native/[email protected].6":
version "0.76.6"
resolved "https://registry.yarnpkg.com/@react-native/community-cli-plugin/-/community-cli-plugin-0.76.6.tgz#3cdd87405c9e0ace5a5df29d206dea22a14e6334"
integrity sha512-nETlc/+U5cESVluzzgN0OcVfcoMijGBaDWzOaJhoYUodcuqnqtu75XsSEc7yzlYjwNQG+vF83mu9CQGezruNMA==
dependencies:
"@react-native/dev-middleware" "0.76.5"
"@react-native/metro-babel-transformer" "0.76.5"
"@react-native/dev-middleware" "0.76.6"
"@react-native/metro-babel-transformer" "0.76.6"
chalk "^4.0.0"
execa "^5.1.1"
invariant "^2.2.4"
Expand All @@ -1981,18 +1981,18 @@
readline "^1.3.0"
semver "^7.1.3"

"@react-native/[email protected].5":
version "0.76.5"
resolved "https://registry.yarnpkg.com/@react-native/debugger-frontend/-/debugger-frontend-0.76.5.tgz#0e89940543fb5029506690b83f12547d0bf42cc4"
integrity sha512-5gtsLfBaSoa9WP8ToDb/8NnDBLZjv4sybQQj7rDKytKOdsXm3Pr2y4D7x7GQQtP1ZQRqzU0X0OZrhRz9xNnOqA==
"@react-native/[email protected].6":
version "0.76.6"
resolved "https://registry.yarnpkg.com/@react-native/debugger-frontend/-/debugger-frontend-0.76.6.tgz#e8eae252f9a3d4b2a811748cf2a504242de2ce0f"
integrity sha512-kP97xMQjiANi5/lmf8MakS7d8FTJl+BqYHQMqyvNiY+eeWyKnhqW2GL2v3eEUBAuyPBgJGivuuO4RvjZujduJg==

"@react-native/[email protected].5":
version "0.76.5"
resolved "https://registry.yarnpkg.com/@react-native/dev-middleware/-/dev-middleware-0.76.5.tgz#10d02fcc6c3c9d24f6dc147c2ef95d6fa6bd3787"
integrity sha512-f8eimsxpkvMgJia7POKoUu9uqjGF6KgkxX4zqr/a6eoR1qdEAWUd6PonSAqtag3PAqvEaJpB99gLH2ZJI1nDGg==
"@react-native/[email protected].6":
version "0.76.6"
resolved "https://registry.yarnpkg.com/@react-native/dev-middleware/-/dev-middleware-0.76.6.tgz#c10c1587444abbc7e9f92491a4a79d4464dc3ecd"
integrity sha512-1bAyd2/X48Nzb45s5l2omM75vy764odx/UnDs4sJfFCuK+cupU4nRPgl0XWIqgdM/2+fbQ3E4QsVS/WIKTFxvQ==
dependencies:
"@isaacs/ttlcache" "^1.4.1"
"@react-native/debugger-frontend" "0.76.5"
"@react-native/debugger-frontend" "0.76.6"
chrome-launcher "^0.15.2"
chromium-edge-launcher "^0.2.0"
connect "^3.6.5"
Expand All @@ -2003,35 +2003,35 @@
serve-static "^1.13.1"
ws "^6.2.3"

"@react-native/[email protected].5":
version "0.76.5"
resolved "https://registry.yarnpkg.com/@react-native/gradle-plugin/-/gradle-plugin-0.76.5.tgz#90d55ec3a99c609358db97b2d7444b28fdc35bc0"
integrity sha512-7KSyD0g0KhbngITduC8OABn0MAlJfwjIdze7nA4Oe1q3R7qmAv+wQzW+UEXvPah8m1WqFjYTkQwz/4mK3XrQGw==
"@react-native/[email protected].6":
version "0.76.6"
resolved "https://registry.yarnpkg.com/@react-native/gradle-plugin/-/gradle-plugin-0.76.6.tgz#50786e65da9baa6b78b504602bf8481be173e3fc"
integrity sha512-sDzpf4eiynryoS6bpYCweGoxSmWgCSx9lzBoxIIW+S6siyGiTaffzZHWCm8mIn9UZsSPlEO37q62ggnR9Zu/OA==

"@react-native/[email protected].5":
version "0.76.5"
resolved "https://registry.yarnpkg.com/@react-native/js-polyfills/-/js-polyfills-0.76.5.tgz#8f35696d96f804de589cd38382c4f0ffbbc248d5"
integrity sha512-ggM8tcKTcaqyKQcXMIvcB0vVfqr9ZRhWVxWIdiFO1mPvJyS6n+a+lLGkgQAyO8pfH0R1qw6K9D0nqbbDo865WQ==
"@react-native/[email protected].6":
version "0.76.6"
resolved "https://registry.yarnpkg.com/@react-native/js-polyfills/-/js-polyfills-0.76.6.tgz#83b65f3ca5f531abfcc6debb2b47c18b32d4bd47"
integrity sha512-cDD7FynxWYxHkErZzAJtzPGhJ13JdOgL+R0riTh0hCovOfIUz9ItffdLQv2nx48lnvMTQ+HZXMnGOZnsFCNzQw==

"@react-native/[email protected].5":
version "0.76.5"
resolved "https://registry.yarnpkg.com/@react-native/metro-babel-transformer/-/metro-babel-transformer-0.76.5.tgz#ed5a05fff34c47af43eba4069e50be7c486f77bd"
integrity sha512-Cm9G5Sg5BDty3/MKa3vbCAJtT3YHhlEaPlQALLykju7qBS+pHZV9bE9hocfyyvc5N/osTIGWxG5YOfqTeMu1oQ==
"@react-native/[email protected].6":
version "0.76.6"
resolved "https://registry.yarnpkg.com/@react-native/metro-babel-transformer/-/metro-babel-transformer-0.76.6.tgz#ec77a5459b288db81dba53dc24747c71eb3c041f"
integrity sha512-xSBi9jPliThu5HRSJvluqUlDOLLEmf34zY/U7RDDjEbZqC0ufPcPS7c5XsSg0GDPiXc7lgjBVesPZsKFkoIBgA==
dependencies:
"@babel/core" "^7.25.2"
"@react-native/babel-preset" "0.76.5"
"@react-native/babel-preset" "0.76.6"
hermes-parser "0.23.1"
nullthrows "^1.1.1"

"@react-native/[email protected].5":
version "0.76.5"
resolved "https://registry.yarnpkg.com/@react-native/normalize-colors/-/normalize-colors-0.76.5.tgz#a33560736311aefcf1d3cb594597befe81a9a53c"
integrity sha512-6QRLEok1r55gLqj+94mEWUENuU5A6wsr2OoXpyq/CgQ7THWowbHtru/kRGRr6o3AQXrVnZheR60JNgFcpNYIug==
"@react-native/[email protected].6":
version "0.76.6"
resolved "https://registry.yarnpkg.com/@react-native/normalize-colors/-/normalize-colors-0.76.6.tgz#c2688aee5a824ad5331bb2b01791b024cd6643ea"
integrity sha512-1n4udXH2Cla31iA/8eLRdhFHpYUYK1NKWCn4m1Sr9L4SarWKAYuRFliK1fcLvPPALCFoFlWvn8I0ekdUOHMzDQ==

"@react-native/[email protected].5":
version "0.76.5"
resolved "https://registry.yarnpkg.com/@react-native/virtualized-lists/-/virtualized-lists-0.76.5.tgz#394c2d48687db30c79278d183fda8a129a2d24d3"
integrity sha512-M/fW1fTwxrHbcx0OiVOIxzG6rKC0j9cR9Csf80o77y1Xry0yrNPpAlf8D1ev3LvHsiAUiRNFlauoPtodrs2J1A==
"@react-native/[email protected].6":
version "0.76.6"
resolved "https://registry.yarnpkg.com/@react-native/virtualized-lists/-/virtualized-lists-0.76.6.tgz#ae08b1efd49060c253da889a1a37ffbef9388743"
integrity sha512-0HUWVwJbRq1BWFOu11eOWGTSmK9nMHhoMPyoI27wyWcl/nqUx7HOxMbRVq0DsTCyATSMPeF+vZ6o1REapcNWKw==
dependencies:
invariant "^2.2.4"
nullthrows "^1.1.1"
Expand Down Expand Up @@ -4350,16 +4350,16 @@ react-native-builder-bob@^0.20.4:
jetifier "^2.0.0"

"react-native@file:../../shared/node_modules/react-native":
version "0.76.5"
version "0.76.6"
dependencies:
"@jest/create-cache-key-function" "^29.6.3"
"@react-native/assets-registry" "0.76.5"
"@react-native/codegen" "0.76.5"
"@react-native/community-cli-plugin" "0.76.5"
"@react-native/gradle-plugin" "0.76.5"
"@react-native/js-polyfills" "0.76.5"
"@react-native/normalize-colors" "0.76.5"
"@react-native/virtualized-lists" "0.76.5"
"@react-native/assets-registry" "0.76.6"
"@react-native/codegen" "0.76.6"
"@react-native/community-cli-plugin" "0.76.6"
"@react-native/gradle-plugin" "0.76.6"
"@react-native/js-polyfills" "0.76.6"
"@react-native/normalize-colors" "0.76.6"
"@react-native/virtualized-lists" "0.76.6"
abort-controller "^3.0.0"
anser "^1.4.9"
ansi-regex "^5.0.0"
Expand Down Expand Up @@ -4890,7 +4890,7 @@ type-fest@^0.7.1:
integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==

"typescript@file:../../shared/node_modules/typescript":
version "5.7.2"
version "5.7.3"

unc-path-regex@^0.1.2:
version "0.1.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,8 @@ internal class KbModule(reactContext: ReactApplicationContext?) : KbSpec(reactCo
return GuiConfig.getInstance(reactContext.getFilesDir())?.asString()
}


// only old arch, uncomment
// override fun getConstants(): MutableMap<String, Any>? {
// return getTypedExportedConstants()
// }

// newarch @Override
override fun getTypedExportedConstants(): MutableMap<String, Any> {
@ReactMethod(isBlockingSynchronousMethod = true)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how the built in getConstants works is different between old and new arch and thats annoying for no reason. instead we just make a new function without any baggage

override fun getTypedConstants(): WritableMap {
val versionCode: String = getBuildConfigValue("VERSION_CODE").toString()
val versionName: String = getBuildConfigValue("VERSION_NAME").toString()
var isDeviceSecure = false
Expand Down Expand Up @@ -146,18 +140,19 @@ internal class KbModule(reactContext: ReactApplicationContext?) : KbSpec(reactCo
downloadDir = dir.getAbsolutePath()
}
}
val constants: MutableMap<String, Any> = HashMap()
constants.put("androidIsDeviceSecure", isDeviceSecure)
constants.put("androidIsTestDevice", misTestDevice)
constants.put("appVersionCode", versionCode)
constants.put("appVersionName", versionName)
constants.put("darkModeSupported", false)
constants.put("fsCacheDir", cacheDir)
constants.put("fsDownloadDir", downloadDir)
constants.put("guiConfig", readGuiConfig() as Any)
constants.put("serverConfig", serverConfig)
constants.put("uses24HourClock", DateFormat.is24HourFormat(reactContext))
constants.put("version", version())

val constants: WritableMap = Arguments.createMap()
constants.putBoolean("androidIsDeviceSecure", isDeviceSecure)
constants.putBoolean("androidIsTestDevice", misTestDevice)
constants.putString("appVersionCode", versionCode)
constants.putString("appVersionName", versionName)
constants.putBoolean("darkModeSupported", false)
constants.putString("fsCacheDir", cacheDir)
constants.putString("fsDownloadDir", downloadDir)
constants.putString("guiConfig", readGuiConfig())
constants.putString("serverConfig", serverConfig)
constants.putBoolean("uses24HourClock", DateFormat.is24HourFormat(reactContext))
constants.putString("version", version())
return constants
}

Expand Down
3 changes: 2 additions & 1 deletion rnmodules/react-native-kb/android/src/oldarch/KbSpec.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactContextBaseJavaModule
import com.facebook.react.bridge.Promise
import com.facebook.react.bridge.ReadableMap
import com.facebook.react.bridge.WritableMap
import java.util.Map

abstract class KbSpec(context: ReactApplicationContext?) : ReactContextBaseJavaModule(context) {

abstract fun getTypedExportedConstants(): MutableMap<String, Any>
abstract fun getTypedConstants(): WritableMap
abstract fun install(): Boolean
abstract fun getDefaultCountryCode(promise: Promise)
abstract fun logSend(status: String, feedback: String, sendLogs: Boolean, sendMaxBytes: Boolean, traceDir: String, cpuProfileDir: String, promise: Promise)
Expand Down
8 changes: 4 additions & 4 deletions rnmodules/react-native-kb/ios/Kb.mm
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,11 @@ - (NSString *)setupGuiConfig {
return val;
}

- (NSDictionary *)getConstants {
return [self constantsToExport];
}
- (NSDictionary *)getConstants {
return @{};
}

- (NSDictionary *)constantsToExport {
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(getTypedConstants) {
NSString *serverConfig = [self setupServerConfig];
NSString *guiConfig = [self setupGuiConfig];

Expand Down
23 changes: 12 additions & 11 deletions rnmodules/react-native-kb/lib/module/index.js

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

Loading