PromucFlow_constructor/app/client/src/components/editorComponents/Sidebar.tsx

33 lines
843 B
TypeScript
Raw Normal View History

import React, { memo } from "react";
import { Switch, Route } from "react-router";
2019-10-18 08:16:26 +00:00
import styled from "styled-components";
import { WIDGETS_URL } from "constants/routes";
import WidgetSidebar from "pages/Editor/WidgetSidebar";
import ExplorerSidebar from "pages/Editor/Explorer";
2019-10-18 08:16:26 +00:00
const SidebarWrapper = styled.div`
padding: 0px 0 0 6px;
2019-10-18 08:16:26 +00:00
color: ${props => props.theme.colors.textOnDarkBG};
overflow-y: auto;
2019-10-18 08:16:26 +00:00
`;
export const Sidebar = memo(() => {
return (
2020-03-30 14:21:21 +00:00
<SidebarWrapper className="t--sidebar">
<Switch>
<Route
2020-03-11 13:59:46 +00:00
exact
path={WIDGETS_URL()}
2020-03-11 13:59:46 +00:00
component={WidgetSidebar}
name={"WidgetSidebar"}
/>
<Route component={ExplorerSidebar} name={"ExplorerSidebar"} />
</Switch>
</SidebarWrapper>
);
});
Sidebar.displayName = "Sidebar";
2019-10-18 08:16:26 +00:00
export default Sidebar;