mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 16:23:41 +08:00 
			
		
		
		
	Merge pull request #4234 from fengzai6/main
Fix EmojiPicker mobile width adaptation and update avatar clicking behavior
This commit is contained in:
		@@ -21,6 +21,7 @@ export function AvatarPicker(props: {
 | 
			
		||||
}) {
 | 
			
		||||
  return (
 | 
			
		||||
    <EmojiPicker
 | 
			
		||||
      width={"100%"}
 | 
			
		||||
      lazyLoadEmojis
 | 
			
		||||
      theme={EmojiTheme.AUTO}
 | 
			
		||||
      getEmojiUrl={getEmojiUrl}
 | 
			
		||||
 
 | 
			
		||||
@@ -5,6 +5,8 @@
 | 
			
		||||
 | 
			
		||||
.avatar {
 | 
			
		||||
  cursor: pointer;
 | 
			
		||||
  position: relative;
 | 
			
		||||
  z-index: 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.edit-prompt-modal {
 | 
			
		||||
 
 | 
			
		||||
@@ -693,7 +693,9 @@ export function Settings() {
 | 
			
		||||
            >
 | 
			
		||||
              <div
 | 
			
		||||
                className={styles.avatar}
 | 
			
		||||
                onClick={() => setShowEmojiPicker(true)}
 | 
			
		||||
                onClick={() => {
 | 
			
		||||
                  setShowEmojiPicker(!showEmojiPicker);
 | 
			
		||||
                }}
 | 
			
		||||
              >
 | 
			
		||||
                <Avatar avatar={config.avatar} />
 | 
			
		||||
              </div>
 | 
			
		||||
 
 | 
			
		||||
@@ -14,17 +14,24 @@
 | 
			
		||||
 | 
			
		||||
.popover-content {
 | 
			
		||||
  position: absolute;
 | 
			
		||||
  width: 350px;
 | 
			
		||||
  animation: slide-in 0.3s ease;
 | 
			
		||||
  right: 0;
 | 
			
		||||
  top: calc(100% + 10px);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@media screen and (max-width: 600px) {
 | 
			
		||||
  .popover-content {
 | 
			
		||||
    width: auto;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
.popover-mask {
 | 
			
		||||
  position: fixed;
 | 
			
		||||
  top: 0;
 | 
			
		||||
  left: 0;
 | 
			
		||||
  width: 100vw;
 | 
			
		||||
  height: 100vh;
 | 
			
		||||
  background-color: rgba(0, 0, 0, 0.3);
 | 
			
		||||
  backdrop-filter: blur(5px);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.list-item {
 | 
			
		||||
 
 | 
			
		||||
@@ -26,10 +26,10 @@ export function Popover(props: {
 | 
			
		||||
    <div className={styles.popover}>
 | 
			
		||||
      {props.children}
 | 
			
		||||
      {props.open && (
 | 
			
		||||
        <div className={styles["popover-content"]}>
 | 
			
		||||
          <div className={styles["popover-mask"]} onClick={props.onClose}></div>
 | 
			
		||||
          {props.content}
 | 
			
		||||
        </div>
 | 
			
		||||
        <div className={styles["popover-mask"]} onClick={props.onClose}></div>
 | 
			
		||||
      )}
 | 
			
		||||
      {props.open && (
 | 
			
		||||
        <div className={styles["popover-content"]}>{props.content}</div>
 | 
			
		||||
      )}
 | 
			
		||||
    </div>
 | 
			
		||||
  );
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user