From b8348c40f34f9326475f0abcdc5c6808f2efb59d Mon Sep 17 00:00:00 2001 From: Pavel Prichodko <14926950+prichodko@users.noreply.github.com> Date: Mon, 23 May 2022 14:44:05 +0200 Subject: [PATCH] fix(react): use chat name from the route --- .../src/routes/chat/components/chat-info/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/status-react/src/routes/chat/components/chat-info/index.tsx b/packages/status-react/src/routes/chat/components/chat-info/index.tsx index 36457083..6d94ae51 100644 --- a/packages/status-react/src/routes/chat/components/chat-info/index.tsx +++ b/packages/status-react/src/routes/chat/components/chat-info/index.tsx @@ -1,5 +1,7 @@ import React from 'react' +import { useMatch } from 'react-router-dom' + import { PinIcon } from '~/src/icons/pin-icon' import { Avatar, DialogTrigger, Flex, Text } from '~/src/system' @@ -13,13 +15,14 @@ interface Props { export const ChatInfo = (props: Props) => { const { chat } = props + const { params } = useMatch(':id')! // eslint-disable-line @typescript-eslint/no-non-null-assertion if (chat.type == 'channel') { return (
- #general + #{params.id}