Explorar o código

Set width to 100% in smartphone mode

Shun Miyazawa hai 1 ano
pai
achega
868b1876ca

+ 7 - 1
apps/app/src/features/openai/client/components/AiAssistant/AiAssistantChatSidebar/AiAssistantChatSidebar.tsx

@@ -13,6 +13,7 @@ import { toastError } from '~/client/util/toastr';
 import { MessageErrorCode, StreamErrorCode } from '~/features/openai/interfaces/message-error';
 import { MessageErrorCode, StreamErrorCode } from '~/features/openai/interfaces/message-error';
 import type { IThreadRelationHasId } from '~/features/openai/interfaces/thread-relation';
 import type { IThreadRelationHasId } from '~/features/openai/interfaces/thread-relation';
 import { useGrowiCloudUri } from '~/stores-universal/context';
 import { useGrowiCloudUri } from '~/stores-universal/context';
+import { useIsMobile } from '~/stores/ui';
 import loggerFactory from '~/utils/logger';
 import loggerFactory from '~/utils/logger';
 
 
 import type { AiAssistantHasId } from '../../../../interfaces/ai-assistant';
 import type { AiAssistantHasId } from '../../../../interfaces/ai-assistant';
@@ -411,6 +412,7 @@ export const AiAssistantChatSidebar: FC = memo((): JSX.Element => {
   const sidebarScrollerRef = useRef<HTMLDivElement>(null);
   const sidebarScrollerRef = useRef<HTMLDivElement>(null);
 
 
   const { data: aiAssistantChatSidebarData, close: closeAiAssistantChatSidebar } = useAiAssistantChatSidebar();
   const { data: aiAssistantChatSidebarData, close: closeAiAssistantChatSidebar } = useAiAssistantChatSidebar();
+  const { data: isMobile } = useIsMobile();
 
 
   const aiAssistantData = aiAssistantChatSidebarData?.aiAssistantData;
   const aiAssistantData = aiAssistantChatSidebarData?.aiAssistantData;
   const threadData = aiAssistantChatSidebarData?.threadData;
   const threadData = aiAssistantChatSidebarData?.threadData;
@@ -437,7 +439,11 @@ export const AiAssistantChatSidebar: FC = memo((): JSX.Element => {
     <div
     <div
       ref={sidebarRef}
       ref={sidebarRef}
       className={`position-fixed top-0 end-0 h-100 border-start bg-body shadow-sm ${moduleClass}`}
       className={`position-fixed top-0 end-0 h-100 border-start bg-body shadow-sm ${moduleClass}`}
-      style={{ zIndex: 1500, width: `${RIGHT_SIDEBAR_WIDTH}px` }}
+      style={{
+        zIndex: 1500,
+        width: isMobile ? '100%' : `${RIGHT_SIDEBAR_WIDTH}px`,
+        overflow: 'hidden',
+      }}
       data-testid="grw-right-sidebar"
       data-testid="grw-right-sidebar"
     >
     >
       <SimpleBar
       <SimpleBar