[feature] Add close button to mobile menu; remove input max-width in mobile

This commit is contained in:
Sergey Konovalov
2025-11-12 18:55:25 +03:00
parent bd0beddbf4
commit 2eec4ebafd
6 changed files with 72 additions and 14 deletions

View File

@ -63,3 +63,9 @@
color: #dc3545;
margin-top: 4px;
}
@media (max-width: 767px) {
.input {
max-width: 100%;
}
}

View File

@ -38,15 +38,16 @@ function Menu({isOpen, onClose}) {
return (
<div className={`${styles.menu} ${isOpen ? styles['menu--open'] : ''}`}>
<div className={styles['menu__content']}>
<button className={styles['menu__closeButton']} onClick={onClose} aria-label='Close menu' />
<div className={styles['menu__header']}>
<div className={styles['menu__logoContainer']}>
<img src={AppMenuLogo} alt='ONLYOFFICE' className={styles['menu__logo']} />
</div>
<div className={styles['menu__title']}>DocServer Admin Panel</div>
<div className={styles['menu__separator']}></div>
</div>
<div className={styles['menu__content']}>
<div className={styles['menu__menuItems']}>
{menuItems.map(item => (
<MenuItem

View File

@ -1,4 +1,5 @@
.menu {
position: relative;
width: 256px;
height: 100vh;
background: #f9f9f9;
@ -24,19 +25,29 @@
box-shadow:
0 0 0 1px rgba(0, 0, 0, 0.04),
0 8px 24px rgba(0, 0, 0, 0.12);
.menu__content {
.menu__header {
padding-left: 16px;
padding-top: 16px;
}
.menu__content {
padding-left: 16px;
}
}
}
&__header {
flex-shrink: 0;
padding-left: 32px;
padding-top: 32px;
padding-right: 16px;
background: #f9f9f9;
}
&__content {
display: flex;
flex-direction: column;
height: 100%;
flex: 1;
padding-left: 32px;
padding-top: 32px;
overflow-y: auto;
overflow-x: hidden;
@ -113,4 +124,46 @@
color: #666666;
}
}
&__closeButton {
display: none;
@media (max-width: 767px) {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 16px;
right: 16px;
width: 32px;
height: 32px;
background: transparent;
border: none;
cursor: pointer;
padding: 0;
z-index: 10;
&::before,
&::after {
content: '';
position: absolute;
width: 20px;
height: 2px;
background: #333333;
}
&::before {
transform: rotate(45deg);
}
&::after {
transform: rotate(-45deg);
}
&:hover::before,
&:hover::after {
background: #666666;
}
}
}
}

View File

@ -3,7 +3,7 @@ import styles from './MobileHeader.module.scss';
function MobileHeader({onMenuToggle, isOpen}) {
return (
<div className={`${styles.mobileHeader} ${isOpen ? styles['mobileHeader--open'] : ''}`}>
<button className={styles.burger} onClick={onMenuToggle} aria-label='Open menu'>
<button className={styles.burger} onClick={onMenuToggle} aria-label='Menu' aria-expanded={isOpen}>
<span></span>
<span></span>
<span></span>

View File

@ -137,7 +137,6 @@ function WOPISettings() {
value={localRefreshLockInterval}
onChange={handleRefreshLockIntervalChange}
placeholder='10m'
width='200px'
description="Time interval for refreshing document locks (e.g., '10m', '1h', '30s')"
/>
</div>
@ -156,7 +155,6 @@ function WOPISettings() {
value={maskKey(wopiPublicKey)}
disabled
placeholder='No key generated'
width='400px'
style={{fontFamily: 'Courier New, monospace'}}
/>
</div>

View File

@ -42,11 +42,11 @@
}
.formRow {
margin-bottom: 16px;
display: flex;
align-items: flex-end;
gap: 16px;
flex-wrap: wrap;
margin-bottom: 24px;
&:last-child {
margin-bottom: 0;
}
}
// Ensure SaveButton aligns properly in form row