Made the UI mobile friendly, finally...
This commit is contained in:
1 parent
6ecaf679dc
commit
df851b3497
22 files changed
+325
-118
No files matched your search
@@ -1,18 +1,35 @@
|
||||
'use client';
|
||||
import classNames from 'classnames';
|
||||
import ThemeLogo from './ThemeLogo';
|
||||
import { mobileSidebarState } from './Sidebar';
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
|
||||
const MobileMenuButton: React.FC = () => {
|
||||
const [, setIsMobileOpen] = mobileSidebarState.use();
|
||||
return (
|
||||
<button
|
||||
onClick={() => setIsMobileOpen(true)}
|
||||
className="md:hidden flex items-center ml-2 mr-1 px-1 py-1 rounded-md hover:bg-gray-800"
|
||||
aria-label="Open menu"
|
||||
>
|
||||
<ThemeLogo />
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
||||
export const TopBar: React.FC<Props> = ({ children, className }) => {
|
||||
return (
|
||||
<div
|
||||
className={classNames(
|
||||
'absolute top-0 left-0 w-full h-12 bg-gray-900 shadow-sm z-10 flex items-center px-2',
|
||||
'absolute top-0 left-0 w-full h-12 bg-gray-900 shadow-sm z-10 flex items-center px-2 overflow-x-auto whitespace-nowrap',
|
||||
className,
|
||||
)}
|
||||
>
|
||||
<MobileMenuButton />
|
||||
{children ? children : null}
|
||||
</div>
|
||||
);
|
||||
@@ -20,7 +37,7 @@ export const TopBar: React.FC<Props> = ({ children, className }) => {
|
||||
|
||||
export const MainContent: React.FC<Props> = ({ children, className }) => {
|
||||
return (
|
||||
<div className={classNames('pt-14 px-4 absolute top-0 left-0 w-full h-full overflow-auto', className)}>
|
||||
<div className={classNames('pt-14 px-2 sm:px-4 absolute top-0 left-0 w-full h-full overflow-auto', className)}>
|
||||
{children ? children : null}
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user