mirror of
https://github.com/getredash/redash.git
synced 2026-03-23 04:00:09 -04:00
* Vertical navbar * Update vertical menu look and add create menu. * Make query editor work with vertical nav. * Dark mode * Fix create menu & make sidebar fixed. * Update Alert pages layout * Update System status pages * Update Queries and Dashboards list pages * Update Query Source and Query View pages * Use dark theme for mobile navbar * Update Dashboard page: fix Add widget/textbox panel positioning * Dashboard page: fix layout issues when container changes its size (fixes known issues: navbar expand/collapse, scrollbar appears/hides) * Fix dashboard page sticky header (there was a 15px space above it) * Fix embeds * Extract desktop navbar component; move mobile navbar and its styles to ApplicationLayout folder * Remove old app header * Fix tests * Restore version info block * Make Percy capture entire page * Make vertical navbar expand/collapse animation smoother (as it's currently impossible to disable it :-( ) * Fix misc UI issues (show Create label on expanded menu; fix some CSS; don't select items on click) * Allow to override navbars with DynamicComponent * Fix misc UI issues: expand/collapse button animation, menu items styles, menu expand/collapse animation * Hide submenu arrow; show username when menu is expanded * Refine CSS and make it more isolated; adjust colors * Update tests Co-authored-by: Arik Fraimovich <arik@arikfr.com>
40 lines
1.2 KiB
JavaScript
40 lines
1.2 KiB
JavaScript
import React, { useRef, useCallback } from "react";
|
|
import PropTypes from "prop-types";
|
|
import DynamicComponent from "@/components/DynamicComponent";
|
|
import DesktopNavbar from "./DesktopNavbar";
|
|
import MobileNavbar from "./MobileNavbar";
|
|
|
|
import "./index.less";
|
|
|
|
export default function ApplicationLayout({ children }) {
|
|
const mobileNavbarContainerRef = useRef();
|
|
|
|
const getMobileNavbarPopupContainer = useCallback(() => mobileNavbarContainerRef.current, []);
|
|
|
|
return (
|
|
<React.Fragment>
|
|
<div className="application-layout-side-menu">
|
|
<DynamicComponent name="ApplicationDesktopNavbar">
|
|
<DesktopNavbar />
|
|
</DynamicComponent>
|
|
</div>
|
|
<div className="application-layout-content">
|
|
<nav className="application-layout-top-menu" ref={mobileNavbarContainerRef}>
|
|
<DynamicComponent name="ApplicationMobileNavbar" getPopupContainer={getMobileNavbarPopupContainer}>
|
|
<MobileNavbar getPopupContainer={getMobileNavbarPopupContainer} />
|
|
</DynamicComponent>
|
|
</nav>
|
|
{children}
|
|
</div>
|
|
</React.Fragment>
|
|
);
|
|
}
|
|
|
|
ApplicationLayout.propTypes = {
|
|
children: PropTypes.node,
|
|
};
|
|
|
|
ApplicationLayout.defaultProps = {
|
|
children: null,
|
|
};
|