diff --git a/.github/workflows/sample-distribution.yml b/.github/workflows/sample-distribution.yml index c0a5b51255..363f9efd8e 100644 --- a/.github/workflows/sample-distribution.yml +++ b/.github/workflows/sample-distribution.yml @@ -94,3 +94,39 @@ jobs: env: ANDROID_FIREBASE_APP_ID: ${{ secrets.ANDROID_FIREBASE_APP_ID }} FIREBASE_CREDENTIALS_JSON: ${{ secrets.FIREBASE_CREDENTIALS_JSON }} + # Publish the same APK to S3 for the public download link. Reuses the + # artifact the Fastlane step above already built (app-build/), no rebuild. + - name: Ensure AWS CLI is available + if: github.ref == 'refs/heads/develop' + # The self-hosted `public` runner does not ship the AWS CLI. Install v2 + # only when missing, to a user-writable dir (no sudo), then expose it. + run: | + if command -v aws >/dev/null 2>&1; then + echo "AWS CLI already installed: $(aws --version)" + exit 0 + fi + echo "AWS CLI not found; installing v2..." + case "$(uname -m)" in + x86_64) zip="awscli-exe-linux-x86_64.zip" ;; + aarch64|arm64) zip="awscli-exe-linux-aarch64.zip" ;; + *) echo "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + curl -fsSL "https://awscli.amazonaws.com/${zip}" -o /tmp/awscliv2.zip + unzip -q /tmp/awscliv2.zip -d /tmp + /tmp/aws/install --bin-dir "$HOME/.local/bin" --install-dir "$HOME/.local/aws-cli" --update + echo "$HOME/.local/bin" >> "$GITHUB_PATH" + "$HOME/.local/bin/aws" --version + - name: Configure AWS credentials + if: github.ref == 'refs/heads/develop' + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-1 + - name: Upload APK to S3 + if: github.ref == 'refs/heads/develop' + working-directory: examples/SampleApp + # Public download link: https://getstream.io/downloads/rn-sample-app.apk + run: | + cp app-build/reactnativesampleapp.apk rn-sample-app.apk + aws s3 cp rn-sample-app.apk s3://${{ secrets.AWS_S3_BUCKET }} --sse AES256 diff --git a/examples/SampleApp/ios/Podfile.lock b/examples/SampleApp/ios/Podfile.lock index bfa497916d..1fa8bb9bf7 100644 --- a/examples/SampleApp/ios/Podfile.lock +++ b/examples/SampleApp/ios/Podfile.lock @@ -2476,7 +2476,7 @@ PODS: - ReactNativeDependencies - RNFBApp - Yoga - - RNGestureHandler (2.31.2): + - RNGestureHandler (3.0.2): - hermes-engine - RCTRequired - RCTTypeSafety @@ -2526,7 +2526,7 @@ PODS: - ReactCommon/turbomodule/core - ReactNativeDependencies - Yoga - - RNReanimated (4.3.1): + - RNReanimated (4.5.1): - hermes-engine - RCTRequired - RCTTypeSafety @@ -2548,11 +2548,12 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - ReactNativeDependencies - - RNReanimated/apple (= 4.3.1) - - RNReanimated/common (= 4.3.1) + - RNReanimated/apple (= 4.5.1) + - RNReanimated/common (= 4.5.1) + - RNReanimated/view (= 4.5.1) - RNWorklets - Yoga - - RNReanimated/apple (4.3.1): + - RNReanimated/apple (4.5.1): - hermes-engine - RCTRequired - RCTTypeSafety @@ -2576,7 +2577,31 @@ PODS: - ReactNativeDependencies - RNWorklets - Yoga - - RNReanimated/common (4.3.1): + - RNReanimated/common (4.5.1): + - hermes-engine + - RCTRequired + - RCTTypeSafety + - React-Core + - React-Core-prebuilt + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-hermes + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - ReactNativeDependencies + - RNWorklets + - Yoga + - RNReanimated/view (4.5.1): - hermes-engine - RCTRequired - RCTTypeSafety @@ -2714,7 +2739,7 @@ PODS: - ReactCommon/turbomodule/core - ReactNativeDependencies - Yoga - - RNWorklets (0.8.3): + - RNWorklets (0.10.2): - hermes-engine - RCTRequired - RCTTypeSafety @@ -2736,10 +2761,10 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - ReactNativeDependencies - - RNWorklets/apple (= 0.8.3) - - RNWorklets/common (= 0.8.3) + - RNWorklets/apple (= 0.10.2) + - RNWorklets/common (= 0.10.2) - Yoga - - RNWorklets/apple (0.8.3): + - RNWorklets/apple (0.10.2): - hermes-engine - RCTRequired - RCTTypeSafety @@ -2762,7 +2787,7 @@ PODS: - ReactCommon/turbomodule/core - ReactNativeDependencies - Yoga - - RNWorklets/common (0.8.3): + - RNWorklets/common (0.10.2): - hermes-engine - RCTRequired - RCTTypeSafety @@ -2796,7 +2821,7 @@ PODS: - SDWebImageWebPCoder (0.15.0): - libwebp (~> 1.0) - SDWebImage/Core (~> 5.17) - - stream-chat-react-native (8.1.0): + - stream-chat-react-native (9.6.1): - hermes-engine - RCTRequired - RCTTypeSafety @@ -3322,19 +3347,19 @@ SPEC CHECKSUMS: RNFastImage: 14580cef91660b889645fb9e87f58a53621db993 RNFBApp: 3b942e786ca88524ba17df665a1a360fb3eee525 RNFBMessaging: b82ba0933288d710f5371f57d3115092abf64903 - RNGestureHandler: a97cc64efbfcb7a53969a38310a189a3d5246c65 + RNGestureHandler: 795970e76a4f4bcef87e77c12c5c791d86574ab6 RNNotifee: 5e3b271e8ea7456a36eec994085543c9adca9168 RNReactNativeHapticFeedback: 9dc72312c12cb53ee240b5b7aae1e167f3d940a6 - RNReanimated: 8aac6baab55e39ca4e02afd69f77fb127b26520c + RNReanimated: e9815897227d24f4629b1ca467cf5f26bffdc7eb RNScreens: 8d318eb8905fa1d3439a1ce5d567f82ae8245657 RNShare: 26c9524aee8cc3eedbab6d6b98cacce2f5247893 RNSVG: 8efa5ad14ceb98fe56c03793bd55bc4bd30ad84b - RNWorklets: 4931990f73bc8f347586918b2e13f11dfadf3b75 + RNWorklets: 53439575fed8525fb8d1cabcc05a3d4d91e6ffe4 SDWebImage: e9fc87c1aab89a8ab1bbd74eba378c6f53be8abf SDWebImageAVIFCoder: afe194a084e851f70228e4be35ef651df0fc5c57 SDWebImageSVGCoder: 15a300a97ec1c8ac958f009c02220ac0402e936c SDWebImageWebPCoder: 0e06e365080397465cc73a7a9b472d8a3bd0f377 - stream-chat-react-native: eedc4ebe706de6e9bfbcf943599b4e62bad6079f + stream-chat-react-native: fdb9929071f737e85eee5b8dbdb6bc4e120ac5c4 Teleport: 58dccc8594d74a77cdc2a2191b60656f9aaac743 Yoga: e240fec777ff1f21ef42ccebbb44b6d262125855 diff --git a/examples/SampleApp/package.json b/examples/SampleApp/package.json index 9432cfb217..329cace00b 100644 --- a/examples/SampleApp/package.json +++ b/examples/SampleApp/package.json @@ -50,20 +50,20 @@ "react": "19.2.3", "react-native": "0.85.3", "react-native-blob-util": "^0.24.9", - "react-native-gesture-handler": "^2.31.2", + "react-native-gesture-handler": "^3.0.2", "react-native-haptic-feedback": "^3.0.0", "react-native-image-picker": "^8.2.1", "react-native-maps": "^1.27.2", "react-native-nitro-modules": "0.31.3", "react-native-nitro-sound": "0.2.9", - "react-native-reanimated": "4.3.1", + "react-native-reanimated": "4.5.1", "react-native-safe-area-context": "^5.8.0", "react-native-screens": "^4.25.2", "react-native-share": "^12.3.1", "react-native-svg": "^15.15.5", "react-native-teleport": "^1.1.7", "react-native-video": "^6.19.2", - "react-native-worklets": "^0.8.3", + "react-native-worklets": "^0.10.2", "stream-chat": "^9.50.1", "stream-chat-react-native": "workspace:^", "stream-chat-react-native-core": "workspace:^" diff --git a/package/bin/before-tag.sh b/package/bin/before-tag.sh index 893161faaa..b99e8b1a39 100644 --- a/package/bin/before-tag.sh +++ b/package/bin/before-tag.sh @@ -10,15 +10,22 @@ set -eux PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') PACKAGE_VERSION_WITHOUT_SHA=$(echo "$PACKAGE_VERSION" | cut -d"+" -f1) +# We bump ONLY the `version` field of the internal packages here and deliberately leave their +# `stream-chat-react-native-core` dependency as `workspace:^`. This script runs during +# semantic-release's *prepare* step, before the release commit + `git push origin main` (see +# `release/prod.js`), so whatever these files look like on disk here is what gets committed. +# +# Bumping `version` is safe to commit: Yarn resolves workspace packages to a `0.0.0-use.local` +# placeholder in the lockfile and keys on the `workspace:^` descriptor, so the version field +# never affects yarn.lock. Resolving `workspace:^` to a concrete version, however, WOULD change +# the lockfile descriptor and break `yarn install --immutable` and local workspace linking. +# That resolution is therefore done only in the published npm tarball, at publish time, in +# `release.sh` (which runs after this commit) and is never committed back to git. cd native-package npm version --no-workspaces --allow-same-version --no-git-tag-version "$PACKAGE_VERSION_WITHOUT_SHA" -sed -e 's|"stream-chat-react-native-core": "[^"]*"|"stream-chat-react-native-core": "'"$PACKAGE_VERSION_WITHOUT_SHA"'"|g' -i.bak package.json -rm package.json.bak cd ../expo-package npm version --no-workspaces --allow-same-version --no-git-tag-version "$PACKAGE_VERSION_WITHOUT_SHA" -sed -e 's|"stream-chat-react-native-core": "[^"]*"|"stream-chat-react-native-core": "'"$PACKAGE_VERSION_WITHOUT_SHA"'"|g' -i.bak package.json -rm package.json.bak cd .. sed -e 's|"version": "[^"]*"|"version": "'"$PACKAGE_VERSION_WITHOUT_SHA"'"|g' -i.bak src/version.json diff --git a/package/bin/release.sh b/package/bin/release.sh index f17991bc16..986973a0e2 100755 --- a/package/bin/release.sh +++ b/package/bin/release.sh @@ -6,21 +6,35 @@ set -eux PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') +PACKAGE_VERSION_WITHOUT_SHA=$(echo "$PACKAGE_VERSION" | cut -d"+" -f1) PACKAGE_TAG=$(sed 's/.*-\(.*\)\..*/\1/' <<< "$PACKAGE_VERSION") +# Resolve the `workspace:^` protocol to the concrete published version. npm cannot understand +# Yarn's `workspace:` protocol, so the tarball must carry a real version. We do this ONLY here, +# at publish time as this runs after `semantic-release` has already committed and pushed the release +# commit (see release/prod.js), on a throwaway CI checkout, so the rewrite is never committed. +# That keeps `workspace:^` intact in git for local dev and `yarn install --immutable`, while the +# published packages still depend on a concrete `stream-chat-react-native-core` version. +resolve_workspace_dep() { + sed -e 's|"stream-chat-react-native-core": "[^"]*"|"stream-chat-react-native-core": "'"$PACKAGE_VERSION_WITHOUT_SHA"'"|g' -i.bak package.json + rm package.json.bak +} + # If tag === version it means that its not a prerelease and shouuld set things to latest if [[ "${PACKAGE_TAG}" != "${PACKAGE_VERSION}" ]]; then cd native-package + resolve_workspace_dep npm publish --no-workspaces --tag="$PACKAGE_TAG" cd ../expo-package + resolve_workspace_dep npm publish --no-workspaces --tag="$PACKAGE_TAG" else cd native-package + resolve_workspace_dep npm publish --no-workspaces cd ../expo-package + resolve_workspace_dep npm publish --no-workspaces fi - - diff --git a/package/expo-package/package.json b/package/expo-package/package.json index ffc9f5071b..2bc19bd2b9 100644 --- a/package/expo-package/package.json +++ b/package/expo-package/package.json @@ -27,7 +27,7 @@ "types": "types/index.d.ts", "dependencies": { "mime": "^4.0.7", - "stream-chat-react-native-core": "9.6.1" + "stream-chat-react-native-core": "workspace:^" }, "peerDependencies": { "expo": ">=52.0.0", diff --git a/package/native-package/package.json b/package/native-package/package.json index befce3a703..d7ba58849c 100644 --- a/package/native-package/package.json +++ b/package/native-package/package.json @@ -30,7 +30,7 @@ "dependencies": { "es6-symbol": "^3.1.3", "mime": "^4.0.7", - "stream-chat-react-native-core": "9.6.1" + "stream-chat-react-native-core": "workspace:^" }, "peerDependencies": { "@react-native-camera-roll/camera-roll": ">=7.9.0", diff --git a/package/src/components/Attachment/Audio/PlayPauseButton.tsx b/package/src/components/Attachment/Audio/PlayPauseButton.tsx index 5786b02bda..1e0ac70459 100644 --- a/package/src/components/Attachment/Audio/PlayPauseButton.tsx +++ b/package/src/components/Attachment/Audio/PlayPauseButton.tsx @@ -2,8 +2,7 @@ import React, { useMemo } from 'react'; import { Pressable, PressableProps, StyleProp, StyleSheet, ViewStyle } from 'react-native'; import { useTheme } from '../../../contexts'; -import { Pause } from '../../../icons/pause-fill'; -import { Play } from '../../../icons/play-fill'; +import { useComponentsContext } from '../../../contexts/componentsContext/ComponentsContext'; import { primitives } from '../../../theme'; import { buttonSizes } from '../../ui/Button/constants'; @@ -31,6 +30,7 @@ export const PlayPauseButton = ({ const { theme: { semantics }, } = useTheme(); + const { icons } = useComponentsContext(); const styles = useStyles(); return ( {isPlaying ? ( - + ) : ( - + )} ); diff --git a/package/src/components/Attachment/FileIcon.tsx b/package/src/components/Attachment/FileIcon.tsx index 8e9157e1d8..304ecde815 100644 --- a/package/src/components/Attachment/FileIcon.tsx +++ b/package/src/components/Attachment/FileIcon.tsx @@ -1,18 +1,9 @@ import React from 'react'; +import { useComponentsContext } from '../../contexts/componentsContext/ComponentsContext'; +import type { IconsMap } from '../../contexts/componentsContext/defaultComponents'; import { useTheme } from '../../contexts/themeContext/ThemeContext'; -import { Audio } from '../../icons/filetype-audio-xl'; -import { Code } from '../../icons/filetype-code-xl'; -import { ZIP } from '../../icons/filetype-compression-xl'; -import { OtherFileIcon } from '../../icons/filetype-other-xl'; -import { PDF } from '../../icons/filetype-pdf-xl'; -import { Presentation } from '../../icons/filetype-presentation-xl'; -import { SpreadSheet } from '../../icons/filetype-spreadsheet-xl'; -import { DOC } from '../../icons/filetype-text-xl'; -import { Video } from '../../icons/filetype-video-xl'; -import type { IconProps } from '../../icons/utils/base'; - // https://www.iana.org/assignments/media-types/media-types.xhtml#audio const audioFileTypes = [ 'audio/1d-interleaved-parityfec', @@ -349,49 +340,49 @@ const codeFileTypes = [ 'text/plain', ]; -const mimeTypeToIconMap: Record> = { - 'application/pdf': PDF, // .pdf +const mimeTypeToIconKeyMap: Record = { + 'application/pdf': 'PDF', // .pdf }; for (const type of audioFileTypes) { - mimeTypeToIconMap[type] = Audio; + mimeTypeToIconKeyMap[type] = 'Audio'; } for (const type of docMimeTypes) { - mimeTypeToIconMap[type] = DOC; + mimeTypeToIconKeyMap[type] = 'DOC'; } for (const type of excelMimeTypes) { - mimeTypeToIconMap[type] = SpreadSheet; + mimeTypeToIconKeyMap[type] = 'SpreadSheet'; } for (const type of powerpointMimeTypes) { - mimeTypeToIconMap[type] = Presentation; + mimeTypeToIconKeyMap[type] = 'Presentation'; } for (const type of zipFileTypes) { - mimeTypeToIconMap[type] = ZIP; + mimeTypeToIconKeyMap[type] = 'ZIP'; } for (const type of videoFileTypes) { - mimeTypeToIconMap[type] = Video; + mimeTypeToIconKeyMap[type] = 'Video'; } for (const type of codeFileTypes) { - mimeTypeToIconMap[type] = Code; + mimeTypeToIconKeyMap[type] = 'Code'; } -function mimeTypeToIcon(mimeType?: string): React.ComponentType { +function mimeTypeToIconKey(mimeType?: string): keyof IconsMap { if (!mimeType) { - return OtherFileIcon; + return 'OtherFileIcon'; } - const Icon = mimeTypeToIconMap[mimeType]; - if (Icon) { - return Icon; + const iconKey = mimeTypeToIconKeyMap[mimeType]; + if (iconKey) { + return iconKey; } - return OtherFileIcon; + return 'OtherFileIcon'; } export type FileIconProps = { @@ -426,8 +417,9 @@ export const FileIcon = ({ mimeType, size = 'md' }: FileIconProps) => { }, }, } = useTheme(); + const { icons } = useComponentsContext(); - const Icon = mimeTypeToIcon(mimeType); + const Icon = icons[mimeTypeToIconKey(mimeType)]; return ; }; diff --git a/package/src/components/Attachment/Giphy/Giphy.tsx b/package/src/components/Attachment/Giphy/Giphy.tsx index 836aee2350..8c954ce7d7 100644 --- a/package/src/components/Attachment/Giphy/Giphy.tsx +++ b/package/src/components/Attachment/Giphy/Giphy.tsx @@ -5,6 +5,7 @@ import type { Attachment } from 'stream-chat'; import { GiphyImage } from './GiphyImage'; +import { useComponentsContext } from '../../../contexts/componentsContext/ComponentsContext'; import { MessageContextValue, useMessageContext, @@ -16,7 +17,6 @@ import { import { useTheme } from '../../../contexts/themeContext/ThemeContext'; import { useTranslationContext } from '../../../contexts/translationContext/TranslationContext'; -import { EyeOpen } from '../../../icons/EyeOpen'; import { components, primitives } from '../../../theme'; import { Button } from '../../ui/'; @@ -43,6 +43,7 @@ const GiphyWithContext = (props: GiphyPropsWithContext) => { const { actions, image_url, thumb_url } = attachment; + const { icons } = useComponentsContext(); const { t } = useTranslationContext(); const { @@ -68,7 +69,7 @@ const GiphyWithContext = (props: GiphyPropsWithContext) => { testID='giphy-action-attachment' > - + {t('Only visible to you')} diff --git a/package/src/components/Attachment/UrlPreview/URLPreview.tsx b/package/src/components/Attachment/UrlPreview/URLPreview.tsx index 424c2d1d1b..cac7956894 100644 --- a/package/src/components/Attachment/UrlPreview/URLPreview.tsx +++ b/package/src/components/Attachment/UrlPreview/URLPreview.tsx @@ -25,7 +25,6 @@ import { useMessagesContext, } from '../../../contexts/messagesContext/MessagesContext'; import { useTheme } from '../../../contexts/themeContext/ThemeContext'; -import { Link } from '../../../icons/link'; import { primitives } from '../../../theme'; import { FileTypes } from '../../../types/types'; import { makeImageCompatibleUrl } from '../../../utils/utils'; @@ -67,6 +66,8 @@ const URLPreviewWithContext = (props: URLPreviewPropsWithContext) => { styles: stylesProp = {}, } = props; + const { icons } = useComponentsContext(); + const { theme: { semantics }, } = useTheme(); @@ -155,7 +156,7 @@ const URLPreviewWithContext = (props: URLPreviewPropsWithContext) => { ) : null} - + ) : null} - + { const { theme: { semantics }, } = useTheme(); + const { icons } = useComponentsContext(); - return ; + return ; }; export const AttachmentMediaPicker = (props: AttachmentPickerContentProps) => { diff --git a/package/src/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.tsx b/package/src/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.tsx index 3f6c83fdd5..2af5aed769 100644 --- a/package/src/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.tsx +++ b/package/src/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.tsx @@ -15,7 +15,6 @@ import { useMessageInputContext } from '../../../../contexts/messageInputContext import { useTheme } from '../../../../contexts/themeContext/ThemeContext'; import { useTranslationContext } from '../../../../contexts/translationContext/TranslationContext'; import { useViewport } from '../../../../hooks/useViewport'; -import { Plus } from '../../../../icons/plus'; import { NativeHandlers } from '../../../../native'; import { primitives } from '../../../../theme'; import type { File } from '../../../../types/types'; @@ -163,6 +162,7 @@ const AttachmentImage = (props: AttachmentPickerItemType) => { const AttachmentIosLimited = () => { const { numberOfAttachmentPickerImageColumns } = useAttachmentPickerContext(); + const { icons } = useComponentsContext(); const { vw } = useViewport(); const { t } = useTranslationContext(); const size = vw(100) / (numberOfAttachmentPickerImageColumns || 3) - 2; @@ -178,7 +178,7 @@ const AttachmentIosLimited = () => { ]} onPress={NativeHandlers.iOS14RefreshGallerySelection} > - + {t('Add more')} ); diff --git a/package/src/components/AttachmentPicker/components/AttachmentPickerContent.tsx b/package/src/components/AttachmentPicker/components/AttachmentPickerContent.tsx index 91610b5798..c02a4ad876 100644 --- a/package/src/components/AttachmentPicker/components/AttachmentPickerContent.tsx +++ b/package/src/components/AttachmentPicker/components/AttachmentPickerContent.tsx @@ -19,9 +19,9 @@ import { useMessageInputContext, useTranslationContext, } from '../../../contexts'; +import { useComponentsContext } from '../../../contexts/componentsContext/ComponentsContext'; import { useTheme } from '../../../contexts/themeContext/ThemeContext'; import { useAttachmentPickerState, useStableCallback } from '../../../hooks'; -import { Camera, FilePickerIcon, PollThumbnail, VideoIcon } from '../../../icons'; import { primitives } from '../../../theme'; import { CommandSuggestionItem } from '../../AutoCompleteInput/AutoCompleteSuggestionItem'; @@ -149,6 +149,7 @@ export const AttachmentCommandPicker = () => { export const AttachmentPollPicker = (props: AttachmentPickerContentProps) => { const { t } = useTranslationContext(); + const { icons } = useComponentsContext(); const { height } = props; const { openPollCreationDialog, sendMessage } = useMessageInputContext(); @@ -158,7 +159,7 @@ export const AttachmentPollPicker = (props: AttachmentPickerContentProps) => { return ( { const [permissionDenied, setPermissionDenied] = useState(false); const { t } = useTranslationContext(); + const { icons } = useComponentsContext(); const { height, videoOnly } = props; const { takeAndUploadImage } = useMessageInputContext(); @@ -198,7 +200,7 @@ export const AttachmentCameraPicker = ( return permissionDenied ? ( ) : ( { const { t } = useTranslationContext(); + const { icons } = useComponentsContext(); const { height } = props; const { pickFile } = useMessageInputContext(); return ( { const { hasImagePicker, pickAndUploadImageFromNativePicker } = useMessageInputContext(); const { attachmentPickerStore, disableAttachmentPicker } = useAttachmentPickerContext(); + const { icons } = useComponentsContext(); const { selectedPicker } = useAttachmentPickerState(); const setImagePicker = useStableCallback(() => { @@ -85,7 +79,7 @@ export const MediaPickerButton = () => { @@ -94,6 +88,7 @@ export const MediaPickerButton = () => { export const CameraPickerButton = () => { const { attachmentPickerStore, disableAttachmentPicker } = useAttachmentPickerContext(); + const { icons } = useComponentsContext(); const { selectedPicker } = useAttachmentPickerState(); const { hasCameraPicker, takeAndUploadImage } = useMessageInputContext(); @@ -119,14 +114,14 @@ export const CameraPickerButton = () => { {Platform.OS === 'android' ? ( @@ -137,6 +132,7 @@ export const CameraPickerButton = () => { export const FilePickerButton = () => { const { attachmentPickerStore, disableAttachmentPicker } = useAttachmentPickerContext(); + const { icons } = useComponentsContext(); const { selectedPicker } = useAttachmentPickerState(); const { hasFilePicker, pickFile } = useMessageInputContext(); @@ -152,7 +148,7 @@ export const FilePickerButton = () => { @@ -164,6 +160,7 @@ export const PollPickerButton = () => { const { selectedPicker } = useAttachmentPickerState(); const { threadList } = useChannelContext(); + const { icons } = useComponentsContext(); const { hasCreatePoll } = useMessagesContext(); const ownCapabilities = useOwnCapabilitiesContext(); @@ -180,7 +177,7 @@ export const PollPickerButton = () => { @@ -191,6 +188,7 @@ export const CommandsPickerButton = () => { const [showCommandsSheet, setShowCommandsSheet] = useState(false); const { hasCommands } = useMessageInputContext(); const { attachmentPickerStore, disableAttachmentPicker } = useAttachmentPickerContext(); + const { icons } = useComponentsContext(); const { selectedPicker } = useAttachmentPickerState(); const setCommandsPicker = useStableCallback(() => { @@ -208,7 +206,7 @@ export const CommandsPickerButton = () => { diff --git a/package/src/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.tsx b/package/src/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.tsx index c14a695f1d..e457544782 100644 --- a/package/src/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.tsx +++ b/package/src/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.tsx @@ -3,32 +3,31 @@ import { StyleSheet, View } from 'react-native'; import { CommandVariants } from 'stream-chat'; +import { useComponentsContext } from '../../contexts/componentsContext/ComponentsContext'; import { useTheme } from '../../contexts/themeContext/ThemeContext'; -import { Flag, GiphyIcon, Mute, Sound, UserAdd, UserDelete } from '../../icons'; -import { Lightning } from '../../icons/bolt'; -import { Imgur } from '../../icons/imgur'; export const SuggestionCommandIcon = ({ name }: { name: CommandVariants }) => { const { theme: { semantics }, } = useTheme(); + const { icons } = useComponentsContext(); if (name === 'ban') { - return ; + return ; } else if (name === 'flag') { - return ; + return ; } else if (name === 'giphy') { - return ; + return ; } else if (name === 'imgur') { - return ; + return ; } else if (name === 'mute') { - return ; + return ; } else if (name === 'unban') { - return ; + return ; } else if (name === 'unmute') { - return ; + return ; } else { - return ; + return ; } }; diff --git a/package/src/components/AutoCompleteInput/AutoCompleteSuggestionHeader.tsx b/package/src/components/AutoCompleteInput/AutoCompleteSuggestionHeader.tsx index a912d5c57c..b778c5af6e 100644 --- a/package/src/components/AutoCompleteInput/AutoCompleteSuggestionHeader.tsx +++ b/package/src/components/AutoCompleteInput/AutoCompleteSuggestionHeader.tsx @@ -1,9 +1,9 @@ import React, { useMemo } from 'react'; import { StyleSheet, Text, View } from 'react-native'; +import { useComponentsContext } from '../../contexts/componentsContext/ComponentsContext'; import { useTheme } from '../../contexts/themeContext/ThemeContext'; -import { Smile } from '../../icons/emoji'; import { primitives } from '../../theme'; export type AutoCompleteSuggestionHeaderProps = { @@ -48,11 +48,12 @@ export const EmojiHeader: React.FC = ({ query semantics, }, } = useTheme(); + const { icons } = useComponentsContext(); const styles = useStyles(); return ( - + {`Emoji matching "${queryText}"`} diff --git a/package/src/components/AutoCompleteInput/mentionItems/MentionBroadcastItem.tsx b/package/src/components/AutoCompleteInput/mentionItems/MentionBroadcastItem.tsx index 5b90332e61..0a6db47aba 100644 --- a/package/src/components/AutoCompleteInput/mentionItems/MentionBroadcastItem.tsx +++ b/package/src/components/AutoCompleteInput/mentionItems/MentionBroadcastItem.tsx @@ -6,8 +6,8 @@ import { EnhancedMentionContent } from './EnhancedMentionContent'; import { EnhancedMentionIcon } from './EnhancedMentionIcon'; import { MentionItem } from './MentionItem'; +import { useComponentsContext } from '../../../contexts/componentsContext/ComponentsContext'; import { useTranslationContext } from '../../../contexts/translationContext/TranslationContext'; -import { Megaphone } from '../../../icons/megaphone'; export type MentionBroadcastItemProps = { entity: ChannelMentionSuggestion | HereMentionSuggestion; @@ -24,8 +24,9 @@ const SUBTITLE_KEY = { export const MentionBroadcastItem = ({ entity }: MentionBroadcastItemProps) => { const { t } = useTranslationContext(); + const { icons } = useComponentsContext(); return ( - }> + }> { const { t } = useTranslationContext(); + const { icons } = useComponentsContext(); return ( - }> + }> ( - }> - - -); +export const MentionUserGroupItem = ({ entity }: MentionUserGroupItemProps) => { + const { icons } = useComponentsContext(); + return ( + }> + + + ); +}; diff --git a/package/src/components/Channel/Channel.tsx b/package/src/components/Channel/Channel.tsx index 4e4848ca7b..1c7bfe054e 100644 --- a/package/src/components/Channel/Channel.tsx +++ b/package/src/components/Channel/Channel.tsx @@ -468,8 +468,8 @@ const ChannelWithContext = (props: PropsWithChildren) = 'poll', 'ai_text', 'attachments', - 'text', 'location', + 'text', ], messageOverlayTargetId, messageInputFloating = false, diff --git a/package/src/components/ChannelDetails/components/ChannelDetailsNavHeader.tsx b/package/src/components/ChannelDetails/components/ChannelDetailsNavHeader.tsx index 439dbb30fa..9f00da6a0f 100644 --- a/package/src/components/ChannelDetails/components/ChannelDetailsNavHeader.tsx +++ b/package/src/components/ChannelDetails/components/ChannelDetailsNavHeader.tsx @@ -4,10 +4,10 @@ import { I18nManager, StyleSheet, Text, View } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { useChannelDetailsContext } from '../../../contexts/channelDetailsContext/channelDetailsContext'; +import { useComponentsContext } from '../../../contexts/componentsContext/ComponentsContext'; import { useTheme } from '../../../contexts/themeContext/ThemeContext'; import { useTranslationContext } from '../../../contexts/translationContext/TranslationContext'; import { useIsDirectChat } from '../../../hooks/useIsDirectChat'; -import { ChevronLeft } from '../../../icons/chevron-left'; import { primitives } from '../../../theme'; import { Button } from '../../ui/Button/Button'; @@ -26,6 +26,7 @@ export const ChannelDetailsNavHeader = ({ title, }: ChannelDetailsNavHeaderProps) => { const { channel } = useChannelDetailsContext(); + const { icons } = useComponentsContext(); const { t } = useTranslationContext(); const { theme: { @@ -54,7 +55,7 @@ export const ChannelDetailsNavHeader = ({