From a6af8e5d8f6ddb9fd63edef3cd3dc6c85a163df3 Mon Sep 17 00:00:00 2001 From: zxhlyh Date: Tue, 18 Jul 2023 16:57:28 +0800 Subject: [PATCH] Fix/new conversation in mobile phone (#593) --- web/app/components/share/header.tsx | 49 +++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/web/app/components/share/header.tsx b/web/app/components/share/header.tsx index a326970a14..42538974e3 100644 --- a/web/app/components/share/header.tsx +++ b/web/app/components/share/header.tsx @@ -1,6 +1,11 @@ import type { FC } from 'react' import React from 'react' +import { + Bars3Icon, + PencilSquareIcon, +} from '@heroicons/react/24/solid' import AppIcon from '@/app/components/base/app-icon' + export type IHeaderProps = { title: string customerIcon?: React.ReactNode @@ -8,6 +13,8 @@ export type IHeaderProps = { icon_background: string isMobile?: boolean isEmbedScene?: boolean + onShowSideBar?: () => void + onCreateNewChat?: () => void } const Header: FC = ({ title, @@ -16,22 +23,25 @@ const Header: FC = ({ icon, icon_background, isEmbedScene = false, + onShowSideBar, + onCreateNewChat, }) => { - return !isMobile - ? null - : ( + if (!isMobile) + return null + + if (isEmbedScene) { + return (
{customerIcon || }
{title}
@@ -39,6 +49,27 @@ const Header: FC = ({
) + } + + return ( +
+
onShowSideBar?.()} + > + +
+
+ +
{title}
+
+
onCreateNewChat?.()} + > + +
+
+ ) } export default React.memo(Header)