1- import { chatEvents } from '@/store/useChatStore.ts' ;
2- import useChatStore from '@/store/useChatStore.ts' ;
1+ import useChatStore , { chatEvents } from '@/store/useChatStore.ts' ;
2+ import { GroupChat } from '@/types/chat.ts' ;
3+ import { cleanRoomId } from '@/utils/roomUtils.ts' ;
34import { Content , Description , Overlay , Portal , Root , Title } from '@radix-ui/react-dialog' ;
45import { Root as SeparatorRoot } from '@radix-ui/react-separator' ;
56import React , { useCallback , useEffect , useState } from 'react' ;
@@ -8,8 +9,6 @@ import GroupChatHeader from '../group/GroupChatHeader.tsx';
89import GroupUserList from '../group/GroupUserList.tsx' ;
910import ChatInput from '../input/ChatInput.tsx' ;
1011import MessageList from './MessageList.tsx' ;
11- import { GroupChat } from '@/types/chat.ts' ;
12- import { cleanRoomId } from '@/utils/roomUtils.ts' ;
1312
1413// 动画常量
1514const overlayShow = 'animate-[overlay-show_150ms_cubic-bezier(0.16,1,0.3,1)]' ;
@@ -408,7 +407,7 @@ const ChatPanel: React.FC = () => {
408407 value = { tempUserName }
409408 onChange = { ( e ) => setTempUserName ( e . target . value ) }
410409 placeholder = "请输入您的用户名"
411- className = "w-full px-3 py-2 border border-gray-300 rounded-md mb-4 focus:outline-none focus:ring-2 focus:ring-blue-500"
410+ className = "w-full px-3 py-2 border border-gray-300 rounded-md mb-4 focus:outline-none focus:ring-2 focus:ring-blue-500 text-base "
412411 autoFocus
413412 />
414413 < div className = "flex justify-end space-x-2" >
@@ -449,7 +448,7 @@ const ChatPanel: React.FC = () => {
449448 onChange = { ( e ) => setRoomIdInput ( e . target . value ) }
450449 onKeyDown = { handleKeyDown }
451450 placeholder = "输入群聊ID或粘贴邀请链接"
452- className = "w-full px-3 py-2 border border-gray-300 rounded-md mb-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
451+ className = "w-full px-3 py-2 border border-gray-300 rounded-md mb-2 focus:outline-none focus:ring-2 focus:ring-blue-500 text-base "
453452 autoFocus
454453 disabled = { isJoining }
455454 />
@@ -634,7 +633,8 @@ const ChatPanel: React.FC = () => {
634633 < >
635634 < GroupChatHeader />
636635 < div className = "flex flex-1 overflow-hidden" >
637- < div className = "w-64 bg-gray-50 border-r border-gray-200 overflow-y-auto" >
636+ { /* 桌面端用户列表 */ }
637+ < div className = "hidden md:block w-64 bg-gray-50 border-r border-gray-200 overflow-y-auto" >
638638 < GroupUserList />
639639 </ div >
640640 < div className = "flex-1 flex flex-col" >
@@ -666,7 +666,7 @@ const ChatPanel: React.FC = () => {
666666 < Overlay className = { `fixed inset-0 bg-black/30 ${ overlayShow } ` } />
667667 < Content
668668 className = { `fixed top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%]
669- w-[90vw ] max-w-[450px] rounded-lg bg-white p-6 shadow-xl focus:outline-none
669+ w-[95vw ] max-w-[450px] rounded-lg bg-white p-4 md: p-6 shadow-xl focus:outline-none
670670 ${ contentShow } ` }
671671 onEscapeKeyDown = { ( e ) => {
672672 // 如果是首次设置用户名(没有用户名),阻止关闭
@@ -692,7 +692,7 @@ const ChatPanel: React.FC = () => {
692692 value = { tempUserName }
693693 onChange = { ( e ) => setTempUserName ( e . target . value ) }
694694 placeholder = "请输入您的用户名"
695- className = "w-full px-3 py-2 border border-gray-300 rounded-md mb-4 focus:outline-none focus:ring-2 focus:ring-blue-500"
695+ className = "w-full px-3 py-2 border border-gray-300 rounded-md mb-4 focus:outline-none focus:ring-2 focus:ring-blue-500 text-base "
696696 autoFocus
697697 />
698698 < div className = "flex justify-end space-x-2" >
@@ -721,7 +721,7 @@ const ChatPanel: React.FC = () => {
721721 < Overlay className = { `fixed inset-0 bg-black/30 ${ overlayShow } ` } />
722722 < Content
723723 className = { `fixed top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%]
724- w-[90vw ] max-w-[450px] rounded-lg bg-white p-6 shadow-xl focus:outline-none
724+ w-[95vw ] max-w-[450px] rounded-lg bg-white p-4 md: p-6 shadow-xl focus:outline-none
725725 ${ contentShow } ` }
726726 >
727727 < Title className = "text-xl font-semibold mb-4" > 切换网络模式</ Title >
0 commit comments