mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 16:23:41 +08:00 
			
		
		
		
	feat: add max icon for modals
This commit is contained in:
		@@ -186,7 +186,7 @@
 | 
				
			|||||||
        box-shadow: var(--card-shadow);
 | 
					        box-shadow: var(--card-shadow);
 | 
				
			||||||
        border: var(--border-in-light);
 | 
					        border: var(--border-in-light);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        * {
 | 
					        *:not(li) {
 | 
				
			||||||
          overflow: hidden;
 | 
					          overflow: hidden;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -79,6 +79,19 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  --modal-padding: 20px;
 | 
					  --modal-padding: 20px;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  &-max {
 | 
				
			||||||
 | 
					    width: 95vw;
 | 
				
			||||||
 | 
					    max-width: unset;
 | 
				
			||||||
 | 
					    height: 95vh;
 | 
				
			||||||
 | 
					    display: flex;
 | 
				
			||||||
 | 
					    flex-direction: column;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    .modal-content {
 | 
				
			||||||
 | 
					      max-height: unset !important;
 | 
				
			||||||
 | 
					      flex-grow: 1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .modal-header {
 | 
					  .modal-header {
 | 
				
			||||||
    padding: var(--modal-padding);
 | 
					    padding: var(--modal-padding);
 | 
				
			||||||
    display: flex;
 | 
					    display: flex;
 | 
				
			||||||
@@ -91,11 +104,19 @@
 | 
				
			|||||||
      font-size: 16px;
 | 
					      font-size: 16px;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    .modal-close-btn {
 | 
					    .modal-header-actions {
 | 
				
			||||||
      cursor: pointer;
 | 
					      display: flex;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      &:hover {
 | 
					      .modal-header-action {
 | 
				
			||||||
        filter: brightness(1.2);
 | 
					        cursor: pointer;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        &:not(:last-child) {
 | 
				
			||||||
 | 
					          margin-right: 20px;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        &:hover {
 | 
				
			||||||
 | 
					          filter: brightness(1.2);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,6 +6,8 @@ import EyeOffIcon from "../icons/eye-off.svg";
 | 
				
			|||||||
import DownIcon from "../icons/down.svg";
 | 
					import DownIcon from "../icons/down.svg";
 | 
				
			||||||
import ConfirmIcon from "../icons/confirm.svg";
 | 
					import ConfirmIcon from "../icons/confirm.svg";
 | 
				
			||||||
import CancelIcon from "../icons/cancel.svg";
 | 
					import CancelIcon from "../icons/cancel.svg";
 | 
				
			||||||
 | 
					import MaxIcon from "../icons/max.svg";
 | 
				
			||||||
 | 
					import MinIcon from "../icons/min.svg";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import Locale from "../locales";
 | 
					import Locale from "../locales";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -111,13 +113,30 @@ export function Modal(props: ModalProps) {
 | 
				
			|||||||
    // eslint-disable-next-line react-hooks/exhaustive-deps
 | 
					    // eslint-disable-next-line react-hooks/exhaustive-deps
 | 
				
			||||||
  }, []);
 | 
					  }, []);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const [isMax, setMax] = useState(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return (
 | 
					  return (
 | 
				
			||||||
    <div className={styles["modal-container"]}>
 | 
					    <div
 | 
				
			||||||
 | 
					      className={
 | 
				
			||||||
 | 
					        styles["modal-container"] + ` ${isMax && styles["modal-container-max"]}`
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    >
 | 
				
			||||||
      <div className={styles["modal-header"]}>
 | 
					      <div className={styles["modal-header"]}>
 | 
				
			||||||
        <div className={styles["modal-title"]}>{props.title}</div>
 | 
					        <div className={styles["modal-title"]}>{props.title}</div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <div className={styles["modal-close-btn"]} onClick={props.onClose}>
 | 
					        <div className={styles["modal-header-actions"]}>
 | 
				
			||||||
          <CloseIcon />
 | 
					          <div
 | 
				
			||||||
 | 
					            className={styles["modal-header-action"]}
 | 
				
			||||||
 | 
					            onClick={() => setMax(!isMax)}
 | 
				
			||||||
 | 
					          >
 | 
				
			||||||
 | 
					            {isMax ? <MinIcon /> : <MaxIcon />}
 | 
				
			||||||
 | 
					          </div>
 | 
				
			||||||
 | 
					          <div
 | 
				
			||||||
 | 
					            className={styles["modal-header-action"]}
 | 
				
			||||||
 | 
					            onClick={props.onClose}
 | 
				
			||||||
 | 
					          >
 | 
				
			||||||
 | 
					            <CloseIcon />
 | 
				
			||||||
 | 
					          </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user