feat(web): open spaces as a plain chat on phones with a side drawer
Spaces, channels, files, members and the account move into a left drawer, the top bar keeps only the essentials, and touch devices get a tap menu instead of always-visible delete buttons. Also fixes the history checkboxes in the channel settings sheet.
This commit is contained in:
1 parent
06fe077ef1
commit
1db3795d6a
16 files changed
+383
-56
No files matched your search
@@ -127,3 +127,32 @@
|
||||
min-height: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 手机聊天页由侧边栏承载账号入口,浮窗让位 */
|
||||
@media (width <= 899px) {
|
||||
/* stylelint-disable-next-line selector-pseudo-class-no-unknown */
|
||||
:global([data-chat-shell]) .dock:not(.inline) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.inline {
|
||||
position: static;
|
||||
flex: 1;
|
||||
width: auto;
|
||||
min-width: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.inline .profile {
|
||||
flex: 1;
|
||||
width: auto;
|
||||
justify-content: flex-start;
|
||||
padding: var(--space-1) var(--space-2);
|
||||
}
|
||||
|
||||
.inline .profileText {
|
||||
display: flex;
|
||||
}
|
||||
@@ -5,7 +5,8 @@ import { Sheet } from '@/ui/Sheet';
|
||||
import { AccountSettings } from './AccountSettings';
|
||||
import styles from './AccountDock.module.css';
|
||||
|
||||
export function AccountDock() {
|
||||
/** inline:嵌进手机侧边栏底部,不再浮在页面上 */
|
||||
export function AccountDock({ inline = false }: { inline?: boolean }) {
|
||||
const [settingsOpen, setSettingsOpen] = useState(false);
|
||||
const username = useAccount((s) => s.username);
|
||||
const personal = useAccount((s) => s.personal);
|
||||
@@ -17,7 +18,7 @@ export function AccountDock() {
|
||||
const openSettings = () => setSettingsOpen(true);
|
||||
|
||||
return <>
|
||||
<section className={styles.dock} aria-label="当前账号">
|
||||
<section className={`${styles.dock} ${inline ? styles.inline : ''}`} aria-label="当前账号">
|
||||
<button className={styles.profile} type="button" onClick={openSettings} aria-label={`打开 ${displayName} 的账号设置`}>
|
||||
{personal?.avatar ? <img className={styles.avatar} src={personal.avatar} alt="" /> : <span className={styles.avatarFallback}>{initial}</span>}
|
||||
<span className={styles.profileText}><strong className={styles.profileName}>{displayName}</strong><span className={styles.username}>{subtitle}</span></span>
|
||||
|
||||
Reference in new issue
Block a user