mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 16:23:41 +08:00 
			
		
		
		
	feat: optiminize modal UE on mobile dev
This commit is contained in:
		@@ -26,6 +26,7 @@ export interface ModalProps {
 | 
			
		||||
  headerBordered?: boolean;
 | 
			
		||||
  modelClassName?: string;
 | 
			
		||||
  onOpen?: (v: boolean) => void;
 | 
			
		||||
  maskCloseble?: boolean;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface WarnProps
 | 
			
		||||
@@ -70,6 +71,7 @@ const Modal = (props: ModalProps) => {
 | 
			
		||||
    headerBordered,
 | 
			
		||||
    modelClassName,
 | 
			
		||||
    onOpen,
 | 
			
		||||
    maskCloseble = true,
 | 
			
		||||
  } = props;
 | 
			
		||||
 | 
			
		||||
  const [open, setOpen] = useState(!!visible);
 | 
			
		||||
@@ -121,6 +123,11 @@ const Modal = (props: ModalProps) => {
 | 
			
		||||
        <AlertDialog.Overlay
 | 
			
		||||
          className="bg-modal-mask fixed inset-0 animate-mask "
 | 
			
		||||
          style={{ zIndex: baseZIndex - 1 }}
 | 
			
		||||
          onClick={() => {
 | 
			
		||||
            if (maskCloseble) {
 | 
			
		||||
              handleClose();
 | 
			
		||||
            }
 | 
			
		||||
          }}
 | 
			
		||||
        />
 | 
			
		||||
        <AlertDialog.Content
 | 
			
		||||
          className={`
 | 
			
		||||
@@ -128,7 +135,16 @@ const Modal = (props: ModalProps) => {
 | 
			
		||||
          `}
 | 
			
		||||
          style={{ zIndex: baseZIndex - 1 }}
 | 
			
		||||
        >
 | 
			
		||||
          <div className="flex-1"> </div>
 | 
			
		||||
          <div
 | 
			
		||||
            className="flex-1"
 | 
			
		||||
            onClick={() => {
 | 
			
		||||
              if (maskCloseble) {
 | 
			
		||||
                handleClose();
 | 
			
		||||
              }
 | 
			
		||||
            }}
 | 
			
		||||
          >
 | 
			
		||||
             
 | 
			
		||||
          </div>
 | 
			
		||||
          <div
 | 
			
		||||
            className={`flex flex-col flex-0      
 | 
			
		||||
              bg-moda-panel text-modal-mask    
 | 
			
		||||
 
 | 
			
		||||
@@ -54,12 +54,12 @@ export default function SessionItem(props: {
 | 
			
		||||
              }
 | 
			
		||||
            `}
 | 
			
		||||
          onClick={props.onClick}
 | 
			
		||||
          // ref={(ele) => {
 | 
			
		||||
          //   draggableRef.current = ele;
 | 
			
		||||
          //   provided.innerRef(ele);
 | 
			
		||||
          // }}
 | 
			
		||||
          // {...provided.draggableProps}
 | 
			
		||||
          // {...provided.dragHandleProps}
 | 
			
		||||
          ref={(ele) => {
 | 
			
		||||
            draggableRef.current = ele;
 | 
			
		||||
            provided.innerRef(ele);
 | 
			
		||||
          }}
 | 
			
		||||
          {...provided.draggableProps}
 | 
			
		||||
          {...provided.dragHandleProps}
 | 
			
		||||
          title={`${props.title}\n${Locale.ChatItem.ChatItemCount(
 | 
			
		||||
            props.count,
 | 
			
		||||
          )}`}
 | 
			
		||||
 
 | 
			
		||||
@@ -97,20 +97,13 @@ export default MenuLayout(function SessionList(props) {
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
      <div
 | 
			
		||||
        className={`flex-1 overflow-y-auto max-md:pb-chat-panel-mobile `}
 | 
			
		||||
        // onClick={(e) => {
 | 
			
		||||
        //   if (e.target === e.currentTarget) {
 | 
			
		||||
        //     navigate(Path.Home);
 | 
			
		||||
        //   }
 | 
			
		||||
        // }}
 | 
			
		||||
      >
 | 
			
		||||
      <div className={`flex-1 overflow-y-auto max-md:pb-chat-panel-mobile `}>
 | 
			
		||||
        <DragDropContext onDragEnd={onDragEnd}>
 | 
			
		||||
          <Droppable droppableId="chat-list">
 | 
			
		||||
            {(provided) => (
 | 
			
		||||
              <div
 | 
			
		||||
                // ref={provided.innerRef}
 | 
			
		||||
                // {...provided.droppableProps}
 | 
			
		||||
                ref={provided.innerRef}
 | 
			
		||||
                {...provided.droppableProps}
 | 
			
		||||
                className={`w-[100%]`}
 | 
			
		||||
              >
 | 
			
		||||
                {sessions.map((item, i) => (
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user