-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
2,065 additions
and
1,878 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
diff --git a/Libraries/Utilities/setAndForwardRef.js b/Libraries/Utilities/setAndForwardRef.js | ||
new file mode 100644 | ||
index 0000000000000000000000000000000000000000..e67b530b9a933b68e219e2b8cec2a66dc8f51323 | ||
--- /dev/null | ||
+++ b/Libraries/Utilities/setAndForwardRef.js | ||
@@ -0,0 +1,68 @@ | ||
+/** | ||
+ * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
+ * | ||
+ * This source code is licensed under the MIT license found in the | ||
+ * LICENSE file in the root directory of this source tree. | ||
+ * | ||
+ * @format | ||
+ * @flow | ||
+ */ | ||
+ | ||
+'use strict' | ||
+ | ||
+import type { ElementRef, Ref } from 'react' | ||
+ | ||
+type Args = $ReadOnly<{| | ||
+ getForwardedRef: () => ?Ref<any>, | ||
+ setLocalRef: (ref: ElementRef<any>) => mixed | ||
+|}> | ||
+ | ||
+/** | ||
+ * This is a helper function for when a component needs to be able to forward a ref | ||
+ * to a child component, but still needs to have access to that component as part of | ||
+ * its implementation. | ||
+ * | ||
+ * Its main use case is in wrappers for native components. | ||
+ * | ||
+ * Usage: | ||
+ * | ||
+ * class MyView extends React.Component { | ||
+ * _nativeRef = null; | ||
+ * | ||
+ * _setNativeRef = setAndForwardRef({ | ||
+ * getForwardedRef: () => this.props.forwardedRef, | ||
+ * setLocalRef: ref => { | ||
+ * this._nativeRef = ref; | ||
+ * }, | ||
+ * }); | ||
+ * | ||
+ * render() { | ||
+ * return <View ref={this._setNativeRef} />; | ||
+ * } | ||
+ * } | ||
+ * | ||
+ * const MyViewWithRef = React.forwardRef((props, ref) => ( | ||
+ * <MyView {...props} forwardedRef={ref} /> | ||
+ * )); | ||
+ * | ||
+ * module.exports = MyViewWithRef; | ||
+ */ | ||
+ | ||
+function setAndForwardRef({ getForwardedRef, setLocalRef }: Args): (ref: ElementRef<any>) => void { | ||
+ return function forwardRef(ref: ElementRef<any>) { | ||
+ const forwardedRef = getForwardedRef() | ||
+ | ||
+ setLocalRef(ref) | ||
+ | ||
+ // Forward to user ref prop (if one has been specified) | ||
+ if (typeof forwardedRef === 'function') { | ||
+ // Handle function-based refs. String-based refs are handled as functions. | ||
+ forwardedRef(ref) | ||
+ } else if (typeof forwardedRef === 'object' && forwardedRef != null) { | ||
+ // Handle createRef-based refs | ||
+ forwardedRef.current = ref | ||
+ } | ||
+ } | ||
+} | ||
+ | ||
+module.exports = setAndForwardRef |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "fastlane" | ||
gem 'cocoapods' | ||
gem 'cocoapods', '~> 1.12' | ||
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') | ||
eval_gemfile(plugins_path) if File.exist?(plugins_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-all.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
module.exports = function (api) { | ||
api.cache(false) | ||
|
||
const plugins = [ | ||
'@babel/plugin-proposal-optional-chaining', | ||
[ | ||
'module-resolver', | ||
{ | ||
root: ['./'], | ||
alias: { | ||
'@components': './src/components', | ||
'@i18n': './src/i18n', | ||
'@screens': './src/screens', | ||
'@utils': './src/utils' | ||
return { | ||
presets: ['babel-preset-expo'], | ||
plugins: [ | ||
'@babel/plugin-proposal-optional-chaining', | ||
[ | ||
'module-resolver', | ||
{ | ||
root: ['./'], | ||
alias: { | ||
'@components': './src/components', | ||
'@i18n': './src/i18n', | ||
'@screens': './src/screens', | ||
'@utils': './src/utils' | ||
} | ||
} | ||
} | ||
], | ||
'react-native-reanimated/plugin' | ||
] | ||
|
||
if (process.env.NODE_ENV === 'production' || process.env.BABEL_ENV === 'production') { | ||
plugins.push('transform-remove-console') | ||
] | ||
].concat( | ||
process.env.NODE_ENV === 'production' || process.env.BABEL_ENV === 'production' | ||
? ['transform-remove-console'] | ||
: [], | ||
['react-native-reanimated/plugin'] | ||
) | ||
} | ||
|
||
return { presets: ['babel-preset-expo'], plugins } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
Enjoy toooting! This version includes following improvements and fixes: | ||
- Long press avatar in tab bar to quickly switch to another account | ||
- Fix poll notifications wrongly greyed out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
tooot-ing愉快!此版本包括以下改进和修复: | ||
- 长按底部菜单头像快速切换账户 | ||
- 修复投票通知显示 | ||
- 新增neodb.social演出卡片 |
Oops, something went wrong.