diff --git a/.github/workflows/docusaurus.yml b/.github/workflows/docusaurus.yml index 0b4884579a..8dabf9f590 100644 --- a/.github/workflows/docusaurus.yml +++ b/.github/workflows/docusaurus.yml @@ -6,6 +6,7 @@ on: - develop paths: - docusaurus/** + - .github/workflows/docusaurus.yml env: branch_map: '{"refs/heads/master": "production", "refs/heads/develop": "staging"}' @@ -17,18 +18,10 @@ jobs: steps: - name: Pull stream-chat-react uses: actions/checkout@v3 - # This part here is cloning a second repository - # While cloning the repository: - # - it clones the repo into the given `path` - # - it checks out the branch defined at `ref` (version tag) - - name: Pull stream-chat-css - uses: actions/checkout@v3 - with: - repository: GetStream/stream-chat-css - path: stream-chat-css - ref: v${{ node -e 'pkg=require("./package.json"); console.log(pkg.dependencies["@stream-io/stream-chat-css"])' }} + - name: 🔨 Install Dependencies + run: yarn install --frozen-lockfile --ignore-engines --ignore-scripts - name: Merge docs stream-chat-css - run: bash scripts/merge-stream-chat-css-docs.sh stream-chat-css/docs + run: bash scripts/merge-stream-chat-css-docs.sh node_modules/@stream-io/stream-chat-css/docs - name: Push to stream-chat-docusaurus uses: GetStream/push-stream-chat-docusaurus-action@main with: diff --git a/src/components/MessageInput/__tests__/AttachmentPreviewList.test.js b/src/components/MessageInput/__tests__/AttachmentPreviewList.test.js index 29fcd735dd..b2f2ebdbe9 100644 --- a/src/components/MessageInput/__tests__/AttachmentPreviewList.test.js +++ b/src/components/MessageInput/__tests__/AttachmentPreviewList.test.js @@ -43,6 +43,10 @@ const renderComponent = (value = {}, renderFunction = render) => , ); +jest.mock('nanoid', () => ({ + nanoid: () => '', +})); + describe('AttachmentPreviewList', () => { it('renders without any attachments', () => { const { getByTestId } = renderComponent(); diff --git a/src/components/MessageInput/__tests__/__snapshots__/AttachmentPreviewList.test.js.snap b/src/components/MessageInput/__tests__/__snapshots__/AttachmentPreviewList.test.js.snap index 5f2d55f7a0..367003da57 100644 --- a/src/components/MessageInput/__tests__/__snapshots__/AttachmentPreviewList.test.js.snap +++ b/src/components/MessageInput/__tests__/__snapshots__/AttachmentPreviewList.test.js.snap @@ -374,7 +374,7 @@ exports[`AttachmentPreviewList renders with one image and one file with state "u > @@ -508,7 +508,7 @@ exports[`AttachmentPreviewList renders with one image and one file with state "u > diff --git a/src/components/MessageInput/icons.tsx b/src/components/MessageInput/icons.tsx index 9764c6306d..54ac1b7c41 100644 --- a/src/components/MessageInput/icons.tsx +++ b/src/components/MessageInput/icons.tsx @@ -1,4 +1,5 @@ -import React, { useId } from 'react'; +import React, { useMemo } from 'react'; +import { nanoid } from 'nanoid'; import { useTranslationContext } from '../../context/TranslationContext'; import { useChatContext } from '../../context/ChatContext'; @@ -76,7 +77,7 @@ export const FileUploadIconFlat = () => { }; export const LoadingIndicatorIcon = ({ size = 20 }: { size?: number }) => { - const id = useId(); + const id = useMemo(() => nanoid(), []); return (