Files
redash/client/app/components/layouts/ContentWithSidebar.jsx
Arik Fraimovich 84d516bfd1 Misc changes to codebase back ported from internal fork (#5129)
* Set corejs version in .babelrc so Jest doesn't complain.

* Rewrite services/routes in TypeScript.

* Add TypeScript definitions for DialogComponent.

* Make image paths more portable

* Add current route context and hook.

* Make EmptyState more flexible by being able to pass in getSteps function.

* Rewrite ItemsList in TypeScript.

* Introduce the possibility to add custom sorters for a column.

* Rearrange props to be friendly to TypeScript.

* Type definitions for NotificationApi.

* Use Databricks query editor components for databricks_internal type of query runner.

* URL Escape password in Alembic configuration.

* Compare types in migrations.
2020-08-25 14:11:38 +03:00

58 lines
1.1 KiB
JavaScript

import React from "react";
import PropTypes from "prop-types";
import classNames from "classnames";
import "./content-with-sidebar.less";
const propTypes = {
className: PropTypes.string,
children: PropTypes.node,
};
const defaultProps = {
className: null,
children: null,
};
// Sidebar
function Sidebar({ className, children, ...props }) {
return (
<div className={classNames("layout-sidebar", className)} {...props}>
<div>{children}</div>
</div>
);
}
Sidebar.propTypes = propTypes;
Sidebar.defaultProps = defaultProps;
// Content
function Content({ className, children, ...props }) {
return (
<div className={classNames("layout-content", className)} {...props}>
<div>{children}</div>
</div>
);
}
Content.propTypes = propTypes;
Content.defaultProps = defaultProps;
// Layout
export default function Layout({ children, className = undefined, ...props }) {
return (
<div className={classNames("layout-with-sidebar", className)} {...props}>
{children}
</div>
);
}
Layout.propTypes = propTypes;
Layout.defaultProps = defaultProps;
Layout.Sidebar = Sidebar;
Layout.Content = Content;