diff --git a/.yarn/patches/react-native-fast-image-npm-8.6.3-03ee2d23c0.patch b/.yarn/patches/react-native-fast-image-npm-8.6.3-03ee2d23c0.patch index 93b92243..aa50ba1b 100644 --- a/.yarn/patches/react-native-fast-image-npm-8.6.3-03ee2d23c0.patch +++ b/.yarn/patches/react-native-fast-image-npm-8.6.3-03ee2d23c0.patch @@ -1,5 +1,5 @@ diff --git a/RNFastImage.podspec b/RNFastImage.podspec -index db0fada63fc06191f8620d336d244edde6c3dba3..b6ffe6c77ab1fd5b821525f6f0b7363a13cba3a0 100644 +index db0fada63fc06191f8620d336d244edde6c3dba3..9c22c36f6978530da21afe143324ff79b4e96454 100644 --- a/RNFastImage.podspec +++ b/RNFastImage.podspec @@ -16,6 +16,6 @@ Pod::Spec.new do |s| @@ -8,7 +8,7 @@ index db0fada63fc06191f8620d336d244edde6c3dba3..b6ffe6c77ab1fd5b821525f6f0b7363a s.dependency 'React-Core' - s.dependency 'SDWebImage', '~> 5.11.1' - s.dependency 'SDWebImageWebPCoder', '~> 0.8.4' -+ s.dependency 'SDWebImage', '~> 5.14.3' ++ s.dependency 'SDWebImage', '~> 5.15.0' + s.dependency 'SDWebImageWebPCoder', '~> 0.9.1' end diff --git a/android/build.gradle b/android/build.gradle diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 5ec02e74..c86a286f 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -16,7 +16,7 @@ PODS: - ExpoModulesCore - EXNotifications (0.17.0): - ExpoModulesCore - - Expo (47.0.12): + - Expo (47.0.13): - ExpoModulesCore - ExpoCrypto (12.1.0): - ExpoModulesCore @@ -301,11 +301,11 @@ PODS: - React-Core - react-native-blurhash (1.1.10): - React-Core - - react-native-cameraroll (5.2.1): + - react-native-cameraroll (5.2.3): - React-Core - - react-native-image-picker (4.10.3): + - react-native-image-picker (5.0.1): - React-Core - - react-native-ios-context-menu (1.15.1): + - react-native-ios-context-menu (1.15.3): - React-Core - react-native-language-detection (0.2.2): - React @@ -318,12 +318,12 @@ PODS: - React-Core - react-native-pager-view (6.1.2): - React-Core - - react-native-paste-input (0.5.2): + - react-native-paste-input (0.6.0): - React-Core - Swime (= 3.0.6) - react-native-quick-base64 (2.0.5): - React-Core - - react-native-safe-area-context (4.4.1): + - react-native-safe-area-context (4.5.0): - RCT-Folly - RCTRequired - RCTTypeSafety @@ -403,11 +403,11 @@ PODS: - React-Core - RNFastImage (8.6.3): - React-Core - - SDWebImage (~> 5.14.3) + - SDWebImage (~> 5.15.0) - SDWebImageWebPCoder (~> 0.9.1) - - RNGestureHandler (2.8.0): + - RNGestureHandler (2.9.0): - React-Core - - RNReanimated (2.13.0): + - RNReanimated (2.14.4): - DoubleConversion - FBLazyVector - FBReactNativeSpec @@ -434,23 +434,23 @@ PODS: - React-RCTText - ReactCommon/turbomodule/core - Yoga - - RNScreens (3.18.2): + - RNScreens (3.19.0): - React-Core - React-RCTImage - - RNSentry (4.12.0): + - RNSentry (4.13.0): - React-Core - - Sentry/HybridSDK (= 7.31.3) + - Sentry/HybridSDK (= 7.31.5) - RNShareMenu (6.0.0): - React - - RNSVG (13.6.0): + - RNSVG (13.7.0): - React-Core - - SDWebImage (5.14.3): - - SDWebImage/Core (= 5.14.3) - - SDWebImage/Core (5.14.3) + - SDWebImage (5.15.0): + - SDWebImage/Core (= 5.15.0) + - SDWebImage/Core (5.15.0) - SDWebImageWebPCoder (0.9.1): - libwebp (~> 1.0) - SDWebImage/Core (~> 5.13) - - Sentry/HybridSDK (7.31.3) + - Sentry/HybridSDK (7.31.5) - Swime (3.0.6) - Yoga (1.14.0) @@ -716,7 +716,7 @@ SPEC CHECKSUMS: EXFileSystem: 60602b6eefa6873f97172c684b7537c9760b50d6 EXFont: 319606bfe48c33b5b5063fb0994afdc496befe80 EXNotifications: babce2a87b7922051354fcfe7a74dd279b7e272a - Expo: f48d305fda3e4e501d686e6bad7d8c8373828279 + Expo: b9fa98bf260992312ee3c424400819fb9beadafe ExpoCrypto: 6eb2a5ede7d95b7359a5f0391ee0c5d2ecd144b3 ExpoHaptics: 129d3f8d44c2205adcdf8db760602818463d5437 ExpoKeepAwake: 69b59d0a8d2b24de9f82759c39b3821fec030318 @@ -756,17 +756,17 @@ SPEC CHECKSUMS: React-logger: 1623c216abaa88974afce404dc8f479406bbc3a0 react-native-blur: 50c9feabacbc5f49b61337ebc32192c6be7ec3c3 react-native-blurhash: add4df9a937b4e021a24bc67a0714f13e0bd40b7 - react-native-cameraroll: f94bf9f46c998963ecd2bb6e9a3f9cca59b6d9f1 - react-native-image-picker: 60f4246eb5bb7187fc15638a8c1f13abd3820695 - react-native-ios-context-menu: b170594b4448c0cd10c79e13432216bac99de1ac + react-native-cameraroll: 5b25d0be40185d02e522bf2abf8a1ba4e8faa107 + react-native-image-picker: 8cb4280e2c1efc3daeb2d9d597f9429a60472e40 + react-native-ios-context-menu: e529171ba760a1af7f2ef0729f5a7f4d226171c5 react-native-language-detection: f414937fa715108ab50a6269a3de0bcb95e4ceb0 react-native-menu: 9d7d6f819cc7fa14a15cf86888c53f3240d86f1b react-native-mmkv: 69b9c003f10afdd01addf7c6ee784ce42ee2eff3 react-native-netinfo: 2517ad504b3d303e90d7a431b0fcaef76d207983 react-native-pager-view: 54bed894cecebe28cede54c01038d9d1e122de43 - react-native-paste-input: 88709b4fd586ea8cc56ba5e2fc4cdfe90597730c + react-native-paste-input: 5182843692fd2ec72be50f241a38a49796e225d7 react-native-quick-base64: e657e9197e61b60a9dec49807843052b830da254 - react-native-safe-area-context: 99b24a0c5acd0d5dcac2b1a7f18c49ea317be99a + react-native-safe-area-context: 39c2d8be3328df5d437ac1700f4f3a4f75716acc react-native-segmented-control: 65df6cd0619b780b3843d574a72d4c7cec396097 React-perflogger: 8c79399b0500a30ee8152d0f9f11beae7fc36595 React-RCTActionSheet: 7316773acabb374642b926c19aef1c115df5c466 @@ -782,16 +782,16 @@ SPEC CHECKSUMS: ReactCommon: 349be31adeecffc7986a0de875d7fb0dcf4e251c RNCAsyncStorage: 8616bd5a58af409453ea4e1b246521bb76578d60 RNCClipboard: 2834e1c4af68697089cdd455ee4a4cdd198fa7dd - RNFastImage: 756ab178acb5e3f11d8b0a931956fbd9da8d6e54 - RNGestureHandler: 62232ba8f562f7dea5ba1b3383494eb5bf97a4d3 - RNReanimated: ce445c233a6ff5600223484a88ad5704945d972a - RNScreens: 34cc502acf1b916c582c60003dc3089fa01dc66d - RNSentry: 4c09f4dd9740cb9b33e94303de5b6d0dbeb0737d + RNFastImage: bd611b5635f1e0f43c8ccf597b1ef6ee0d0f966d + RNGestureHandler: 071d7a9ad81e8b83fe7663b303d132406a7d8f39 + RNReanimated: 6668b0587bebd4b15dd849b99e5a9c70fc12ed95 + RNScreens: ea4cd3a853063cda19a4e3c28d2e52180c80f4eb + RNSentry: acebe4104a6f5915ae871eb59dc73f13dcc92ef7 RNShareMenu: cb9dac548c8bf147d06f0bf07296ad51ea9f5fc3 - RNSVG: 3a79c0c4992213e4f06c08e62730c5e7b9e4dc17 - SDWebImage: 9c36e66c8ce4620b41a7407698dda44211a96764 + RNSVG: d787d64ca06b9158e763ad2638a8c4edce00782a + SDWebImage: 9bec4c5cdd9579e1f57104735ee0c37df274d593 SDWebImageWebPCoder: 18503de6621dd2c420d680e33d46bf8e1d5169b0 - Sentry: 08884c523575ec0f6690d94ed3ccb0246a1600bf + Sentry: 4c9babff9034785067c896fd580b1f7de44da020 Swime: d7b2c277503b6cea317774aedc2dce05613f8b0b Yoga: 99caf8d5ab45e9d637ee6e0174ec16fbbb01bcfc diff --git a/package.json b/package.json index 14f3da27..bf9c040f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tooot", - "version": "4.8.3", + "version": "4.8.4", "description": "tooot for Mastodon", "author": "xmflsct ", "license": "GPL-3.0-or-later", @@ -24,26 +24,26 @@ "@formatjs/intl-numberformat": "^8.3.3", "@formatjs/intl-pluralrules": "^5.1.8", "@formatjs/intl-relativetimeformat": "^11.1.8", - "@mattermost/react-native-paste-input": "^0.5.2", + "@mattermost/react-native-paste-input": "^0.6.0", "@neverdull-agency/expo-unlimited-secure-store": "^1.0.10", "@react-native-async-storage/async-storage": "~1.17.11", - "@react-native-camera-roll/camera-roll": "^5.2.1", + "@react-native-camera-roll/camera-roll": "^5.2.3", "@react-native-clipboard/clipboard": "^1.11.1", "@react-native-community/blur": "^4.3.0", "@react-native-community/netinfo": "9.3.7", "@react-native-community/segmented-control": "^2.2.2", - "@react-native-firebase/app": "^16.5.0", + "@react-native-firebase/app": "^16.5.2", "@react-native-menu/menu": "^0.7.3", - "@react-navigation/bottom-tabs": "^6.5.2", - "@react-navigation/native": "^6.1.1", - "@react-navigation/native-stack": "^6.9.7", - "@react-navigation/stack": "^6.3.10", - "@sentry/react-native": "4.12.0", + "@react-navigation/bottom-tabs": "^6.5.3", + "@react-navigation/native": "^6.1.2", + "@react-navigation/native-stack": "^6.9.8", + "@react-navigation/stack": "^6.3.11", + "@sentry/react-native": "4.13.0", "@sharcoux/slider": "^6.1.1", - "@tanstack/react-query": "^4.20.9", - "axios": "^1.2.2", + "@tanstack/react-query": "^4.23.0", + "axios": "^1.2.4", "diff": "^5.1.0", - "expo": "^47.0.12", + "expo": "^47.0.13", "expo-auth-session": "^3.8.0", "expo-av": "^13.1.0", "expo-constants": "^14.1.0", @@ -62,7 +62,7 @@ "expo-video-thumbnails": "^7.1.0", "expo-web-browser": "~12.0.0", "htmlparser2": "^8.0.1", - "i18next": "^22.4.8", + "i18next": "^22.4.9", "linkify-it": "^4.0.1", "lodash": "^4.17.21", "react": "^18.2.0", @@ -72,21 +72,20 @@ "react-native": "^0.70.6", "react-native-blurhash": "^1.1.10", "react-native-fast-image": "^8.6.3", - "react-native-feather": "^1.1.2", "react-native-flash-message": "^0.4.0", - "react-native-gesture-handler": "~2.8.0", - "react-native-image-picker": "^4.10.3", - "react-native-ios-context-menu": "^1.15.1", + "react-native-gesture-handler": "~2.9.0", + "react-native-image-picker": "^5.0.1", + "react-native-ios-context-menu": "^1.15.3", "react-native-language-detection": "^0.2.2", "react-native-mmkv": "^2.5.1", "react-native-pager-view": "^6.1.2", "react-native-quick-base64": "^2.0.5", - "react-native-reanimated": "^2.13.0", + "react-native-reanimated": "^2.14.4", "react-native-reanimated-zoom": "^0.3.3", - "react-native-safe-area-context": "^4.4.1", - "react-native-screens": "^3.18.2", + "react-native-safe-area-context": "^4.5.0", + "react-native-screens": "^3.19.0", "react-native-share-menu": "^6.0.0", - "react-native-svg": "^13.6.0", + "react-native-svg": "^13.7.0", "react-native-swipe-list-view": "^3.2.9", "react-native-tab-view": "^3.3.4", "react-redux": "^8.0.5", @@ -102,14 +101,15 @@ "@types/diff": "^5.0.2", "@types/linkify-it": "^3.0.2", "@types/lodash": "^4.14.191", - "@types/react": "^18.0.26", + "@types/react": "^18.0.27", "@types/react-dom": "^18.0.10", - "@types/react-native": "^0.70.8", + "@types/react-native": "^0.70.9", "@types/react-native-share-menu": "^5.0.2", "@types/url-parse": "^1.4.8", - "babel-plugin-module-resolver": "^4.1.0", + "babel-plugin-module-resolver": "^5.0.0", "babel-plugin-transform-remove-console": "^6.9.4", "chalk": "^4.1.2", + "deprecated-react-native-prop-types": "^4.0.0", "dotenv": "^16.0.3", "react-native-clean-project": "^4.0.1", "typescript": "^4.9.4" diff --git a/src/@types/mastodon.d.ts b/src/@types/mastodon.d.ts index e1dcfa40..2a90a73a 100644 --- a/src/@types/mastodon.d.ts +++ b/src/@types/mastodon.d.ts @@ -452,6 +452,7 @@ declare namespace Mastodon { 'posting:default:language'?: string 'reading:expand:media'?: 'default' | 'show_all' | 'hide_all' 'reading:expand:spoilers'?: boolean + 'reading:autoplay:gifs'?: boolean } type PushSubscription = { diff --git a/src/@types/untyped.d.ts b/src/@types/untyped.d.ts index e00bdb1d..ea8a8636 100644 --- a/src/@types/untyped.d.ts +++ b/src/@types/untyped.d.ts @@ -1,5 +1,4 @@ declare module 'gl-react-blurhash' -declare module 'react-native-feather' declare module 'react-native-toast-message' declare module 'rtl-detect' diff --git a/src/components/Account.tsx b/src/components/Account.tsx index bd43dff1..a59b51f1 100644 --- a/src/components/Account.tsx +++ b/src/components/Account.tsx @@ -68,7 +68,7 @@ const ComponentAccount: React.FC = ({ account, props, {props.onPress && !props.disabled ? ( - type: 'icon' | 'text' - content: string - selected?: boolean loading?: boolean destructive?: boolean disabled?: boolean - strokeWidth?: number size?: 'S' | 'M' | 'L' fontBold?: boolean spacing?: 'XS' | 'S' | 'M' | 'L' @@ -28,7 +24,7 @@ export interface Props { overlay?: boolean onPress: () => void -} +} & ({ type: 'icon'; content: IconName } | { type: 'text'; content: string }) const Button: React.FC = ({ accessibilityLabel, @@ -40,7 +36,6 @@ const Button: React.FC = ({ loading = false, destructive = false, disabled = false, - strokeWidth, size = 'M', fontBold = false, spacing = 'S', @@ -81,7 +76,6 @@ const Button: React.FC = ({ diff --git a/src/components/Emojis/Button.tsx b/src/components/Emojis/Button.tsx index ba68cd81..98ca98d6 100644 --- a/src/components/Emojis/Button.tsx +++ b/src/components/Emojis/Button.tsx @@ -39,7 +39,7 @@ const EmojisButton: React.FC = () => { }} > { paddingRight: StyleConstants.Spacing.S }} > - + { emojisDispatch({ type: 'target', payload: -1 }) }} > - + void + filter: Mastodon.Filter<'v2'> + button?: React.ReactNode + style?: ViewStyle +} + +export const Filter: React.FC = ({ onPress, filter, button, style }) => { + const { t } = useTranslation(['common', 'screenTabs']) + const { colors } = useTheme() + + return ( + + + + + + {filter.expires_at && new Date() > new Date(filter.expires_at) ? ( + + ) : null} + {filter.keywords?.length ? ( + + ) : null} + {filter.keywords?.length && filter.statuses?.length ? ( + + ) : null} + {filter.statuses?.length ? ( + + ) : null} + + + {filter.context.map((c, index) => ( + + + + + ))} + + ]} + /> + } + /> + + {button || ( + + )} + + + ) +} diff --git a/src/components/Hashtag.tsx b/src/components/Hashtag.tsx index 4f84c9e7..355e39d2 100644 --- a/src/components/Hashtag.tsx +++ b/src/components/Hashtag.tsx @@ -22,7 +22,7 @@ const ComponentHashtag: React.FC = ({ const navigation = useNavigation>() const onPress = () => { - navigation.push('Tab-Shared-Hashtag', { hashtag: hashtag.name }) + navigation.push('Tab-Shared-Hashtag', { tag_name: hashtag.name }) } const padding = StyleConstants.Spacing.Global.PagePadding diff --git a/src/components/Header/Left.tsx b/src/components/Header/Left.tsx index d0c9444c..b2f39d0d 100644 --- a/src/components/Header/Left.tsx +++ b/src/components/Header/Left.tsx @@ -1,21 +1,19 @@ -import Icon from '@components/Icon' +import Icon, { IconName } from '@components/Icon' import CustomText from '@components/Text' import { StyleConstants } from '@utils/styles/constants' import { useTheme } from '@utils/styles/ThemeManager' import React from 'react' import { Pressable } from 'react-native' -export interface Props { - type?: 'icon' | 'text' - content?: string +export type Props = { native?: boolean background?: boolean onPress: () => void -} +} & ({ type?: undefined; content?: IconName } | { type: 'text'; content: string }) const HeaderLeft: React.FC = ({ - type = 'icon', + type, content, native = true, background = false, @@ -25,18 +23,18 @@ const HeaderLeft: React.FC = ({ const children = () => { switch (type) { - case 'icon': - return ( - - ) case 'text': return ( ) + default: + return ( + + ) } } @@ -52,7 +50,7 @@ const HeaderLeft: React.FC = ({ minHeight: 44, minWidth: 44, marginLeft: native ? -StyleConstants.Spacing.S : StyleConstants.Spacing.S, - ...(type === 'icon' && { + ...(type === undefined && { borderRadius: 100 }), ...(type === 'text' && { diff --git a/src/components/Header/Right.tsx b/src/components/Header/Right.tsx index e0f460a0..91ab09f2 100644 --- a/src/components/Header/Right.tsx +++ b/src/components/Header/Right.tsx @@ -1,4 +1,4 @@ -import Icon from '@components/Icon' +import Icon, { IconName } from '@components/Icon' import { Loading } from '@components/Loading' import CustomText from '@components/Text' import { StyleConstants } from '@utils/styles/constants' @@ -6,13 +6,11 @@ import { useTheme } from '@utils/styles/ThemeManager' import React from 'react' import { AccessibilityProps, Pressable, View } from 'react-native' -export interface Props { +export type Props = { accessibilityLabel?: string accessibilityHint?: string accessibilityState?: AccessibilityProps['accessibilityState'] - type?: 'icon' | 'text' - content: string native?: boolean background?: boolean @@ -21,7 +19,7 @@ export interface Props { destructive?: boolean onPress: () => void -} +} & ({ type?: undefined; content: IconName } | { type: 'text'; content: string }) const HeaderRight: React.FC = ({ // Accessibility - Start @@ -29,7 +27,7 @@ const HeaderRight: React.FC = ({ accessibilityHint, accessibilityState, // Accessibility - End - type = 'icon', + type, content, native = true, background = false, @@ -38,7 +36,7 @@ const HeaderRight: React.FC = ({ destructive = false, onPress }) => { - const { colors, theme } = useTheme() + const { colors } = useTheme() const loadingSpinkit = () => loading ? ( @@ -49,18 +47,6 @@ const HeaderRight: React.FC = ({ const children = () => { switch (type) { - case 'icon': - return ( - <> - - {loadingSpinkit()} - - ) case 'text': return ( <> @@ -80,6 +66,18 @@ const HeaderRight: React.FC = ({ {loadingSpinkit()} ) + default: + return ( + <> + + {loadingSpinkit()} + + ) } } @@ -100,7 +98,7 @@ const HeaderRight: React.FC = ({ minHeight: 44, minWidth: 44, marginRight: native ? -StyleConstants.Spacing.S : StyleConstants.Spacing.S, - ...(type === 'icon' && { + ...(type === undefined && { borderRadius: 100 }), ...(type === 'text' && { diff --git a/src/components/Hr.tsx b/src/components/Hr.tsx new file mode 100644 index 00000000..d7c87938 --- /dev/null +++ b/src/components/Hr.tsx @@ -0,0 +1,23 @@ +import { StyleConstants } from '@utils/styles/constants' +import { useTheme } from '@utils/styles/ThemeManager' +import { View, ViewStyle } from 'react-native' + +const Hr: React.FC<{ style?: ViewStyle }> = ({ style }) => { + const { colors } = useTheme() + + return ( + + ) +} + +export default Hr diff --git a/src/components/Icon.tsx b/src/components/Icon.tsx index 37c7e61e..5389500d 100644 --- a/src/components/Icon.tsx +++ b/src/components/Icon.tsx @@ -1,15 +1,16 @@ -import React, { createElement } from 'react' +import FeatherNames from '@expo/vector-icons/build/vendor/react-native-vector-icons/glyphmaps/Feather.json' +import Feather from '@expo/vector-icons/Feather' +import React from 'react' import { AccessibilityProps, StyleProp, View, ViewStyle } from 'react-native' -import * as FeatherIcon from 'react-native-feather' + +export type IconName = keyof typeof FeatherNames export interface Props { accessibilityLabel?: AccessibilityProps['accessibilityLabel'] - name: string + name: IconName size: number color: string - fill?: string - strokeWidth?: number style?: StyleProp crossOut?: boolean } @@ -19,8 +20,6 @@ const Icon: React.FC = ({ name, size, color, - fill, - strokeWidth = 2, style, crossOut = false }) => { @@ -37,13 +36,7 @@ const Icon: React.FC = ({ } ]} > - {createElement(FeatherIcon[name], { - width: size, - height: size, - color, - fill, - strokeWidth - })} + {crossOut ? ( = ({ transform: [{ rotate: '45deg' }], width: size * 1.35, borderBottomColor: color, - borderBottomWidth: strokeWidth + borderBottomWidth: 2 }} /> ) : null} diff --git a/src/components/Input.tsx b/src/components/Input.tsx index 02febb0c..736b2af6 100644 --- a/src/components/Input.tsx +++ b/src/components/Input.tsx @@ -9,7 +9,9 @@ import CustomText from './Text' export type Props = { title?: string multiline?: boolean -} & Pick, 'value' | 'selection' | 'isFocused'> & + invalid?: boolean +} & Pick, 'value'> & + Pick, 'isFocused' | 'selection'> & Omit< TextInputProps, | 'style' @@ -27,8 +29,9 @@ const ComponentInput = forwardRef( { title, multiline = false, + invalid = false, value: [value, setValue], - selection: [selection, setSelection], + selection, isFocused, ...props }: Props, @@ -43,7 +46,7 @@ const ComponentInput = forwardRef( paddingHorizontal: withTiming(StyleConstants.Spacing.XS), left: withTiming(StyleConstants.Spacing.S), top: withTiming(-(StyleConstants.Font.Size.S / 2) - 2), - backgroundColor: withTiming(colors.backgroundDefault) + backgroundColor: colors.backgroundDefault } } else { return { @@ -62,7 +65,7 @@ const ComponentInput = forwardRef( borderWidth: 1, marginVertical: StyleConstants.Spacing.S, padding: StyleConstants.Spacing.S, - borderColor: colors.border, + borderColor: invalid ? colors.red : colors.border, flexDirection: multiline ? 'column' : 'row', alignItems: 'stretch' }} @@ -78,9 +81,13 @@ const ComponentInput = forwardRef( }} value={value} onChangeText={setValue} - onFocus={() => (isFocused.current = true)} - onBlur={() => (isFocused.current = false)} - onSelectionChange={({ nativeEvent }) => setSelection(nativeEvent.selection)} + {...(isFocused !== undefined && { + onFocus: () => (isFocused.current = true), + onBlur: () => (isFocused.current = false) + })} + {...(selection !== undefined && { + onSelectionChange: ({ nativeEvent }) => selection[1](nativeEvent.selection) + })} {...(multiline && { multiline, numberOfLines: Platform.OS === 'android' ? 5 : undefined diff --git a/src/components/Instance/index.tsx b/src/components/Instance/index.tsx index 5d8e829d..5aad3b7b 100644 --- a/src/components/Instance/index.tsx +++ b/src/components/Instance/index.tsx @@ -235,12 +235,7 @@ const ComponentInstance: React.FC = ({ /> ) : null} - + = ({ }} > = ({ }} > = ({ children }) => { +const MenuContainer: React.FC = ({ style, children }) => { return ( {children} diff --git a/src/components/Menu/Row.tsx b/src/components/Menu/Row.tsx index 2fcc8fbc..ffad2741 100644 --- a/src/components/Menu/Row.tsx +++ b/src/components/Menu/Row.tsx @@ -1,4 +1,4 @@ -import Icon from '@components/Icon' +import Icon, { IconName } from '@components/Icon' import { Loading } from '@components/Loading' import CustomText from '@components/Text' import { useAccessibility } from '@utils/accessibility/AccessibilityManager' @@ -10,7 +10,7 @@ import { View } from 'react-native' import { State, Switch, TapGestureHandler } from 'react-native-gesture-handler' export interface Props { - iconFront?: any + iconFront?: IconName iconFrontColor?: ColorDefinitions title: string @@ -22,7 +22,7 @@ export interface Props { switchDisabled?: boolean switchOnValueChange?: () => void - iconBack?: 'ChevronRight' | 'ExternalLink' | 'Check' + iconBack?: 'chevron-right' | 'external-link' | 'check' iconBackColor?: ColorDefinitions loading?: boolean @@ -44,7 +44,7 @@ const MenuRow: React.FC = ({ loading = false, onPress }) => { - const { colors, theme } = useTheme() + const { colors } = useTheme() const { screenReaderEnabled } = useAccessibility() return ( diff --git a/src/components/Message.tsx b/src/components/Message.tsx index ad1f02ec..dcdc0994 100644 --- a/src/components/Message.tsx +++ b/src/components/Message.tsx @@ -54,13 +54,13 @@ const Message = React.forwardRef((_, ref) => { const { colors, theme } = useTheme() enum iconMapping { - success = 'CheckCircle', - danger = 'XCircle', - warning = 'AlertCircle', - none = '', - default = '', - info = '', - auto = '' + success = 'check-circle', + danger = 'x-circle', + warning = 'alert-circle', + none = 'x', + default = 'x', + info = 'x', + auto = 'x' } enum colorMapping { success = 'blue', diff --git a/src/components/ModalScrollView.tsx b/src/components/ModalScrollView.tsx new file mode 100644 index 00000000..302ffeef --- /dev/null +++ b/src/components/ModalScrollView.tsx @@ -0,0 +1,29 @@ +import { useHeaderHeight } from '@react-navigation/elements' +import { StyleConstants } from '@utils/styles/constants' +import { forwardRef, PropsWithChildren, RefObject } from 'react' +import { KeyboardAvoidingView, Platform, ScrollView } from 'react-native' +import { SafeAreaView } from 'react-native-safe-area-context' + +export const ModalScrollView = forwardRef( + ({ children }: PropsWithChildren, ref: RefObject) => { + const headerHeight = useHeaderHeight() + + return ( + + + + {children} + + + + ) + } +) diff --git a/src/components/Parse/HTML.tsx b/src/components/Parse/HTML.tsx index e8cd52b3..03f7f8f4 100644 --- a/src/components/Parse/HTML.tsx +++ b/src/components/Parse/HTML.tsx @@ -69,6 +69,7 @@ const ParseHTML: React.FC = ({ const [followedTags] = useAccountStorage.object('followed_tags') + const MAX_ALLOWED_LINES = 35 const [totalLines, setTotalLines] = useState() const [expanded, setExpanded] = useState(highlighted) @@ -146,7 +147,7 @@ const ParseHTML: React.FC = ({ tag?.length && !disableDetails && !sameHashtag && - navigation.push('Tab-Shared-Hashtag', { hashtag: tag }) + navigation.push('Tab-Shared-Hashtag', { tag_name: tag }) } children={children} /> @@ -202,9 +203,7 @@ const ParseHTML: React.FC = ({ onPress={async () => { if (!disableDetails) { if (shouldBeTag) { - navigation.push('Tab-Shared-Hashtag', { - hashtag: content.substring(1) - }) + navigation.push('Tab-Shared-Hashtag', { tag_name: content.substring(1) }) } else { await openLink(href, navigation) } @@ -275,14 +274,18 @@ const ParseHTML: React.FC = ({ hint: expandHint, moreLines: numberOfLines > 1 && typeof totalLines === 'number' - ? t('HTML.moreLines', { count: totalLines - numberOfLines }) + ? t('HTML.moreLines', { + count: + totalLines === MAX_ALLOWED_LINES + ? (`${totalLines - numberOfLines}+` as unknown as number) + : totalLines - numberOfLines + }) : '' })} /> @@ -304,7 +307,11 @@ const ParseHTML: React.FC = ({ height: numberOfLines === 1 && !expanded ? 0 : undefined }} numberOfLines={ - typeof totalLines === 'number' ? (expanded ? 999 : numberOfLines) : undefined + typeof totalLines === 'number' + ? expanded + ? 999 + : numberOfLines + : Math.max(MAX_ALLOWED_LINES, numberOfLines) } selectable={selectable} /> diff --git a/src/components/Relationship/Incoming.tsx b/src/components/Relationship/Incoming.tsx index 6855f499..efb4559b 100644 --- a/src/components/Relationship/Incoming.tsx +++ b/src/components/Relationship/Incoming.tsx @@ -51,7 +51,7 @@ const RelationshipIncoming: React.FC = ({ id }) => {