2019-10-18 08:16:26 +00:00
|
|
|
import React from "react";
|
|
|
|
|
import { Switch, Route } from "react-router";
|
|
|
|
|
import styled from "styled-components";
|
2019-10-21 15:12:45 +00:00
|
|
|
import {
|
|
|
|
|
API_EDITOR_URL,
|
|
|
|
|
BUILDER_URL,
|
|
|
|
|
API_EDITOR_ID_URL,
|
|
|
|
|
} from "../../constants/routes";
|
|
|
|
|
import WidgetSidebar from "../../pages/Editor/WidgetSidebar";
|
|
|
|
|
import ApiSidebar from "../../pages/Editor/ApiSidebar";
|
2019-10-18 08:16:26 +00:00
|
|
|
|
|
|
|
|
const SidebarWrapper = styled.div`
|
|
|
|
|
background-color: ${props => props.theme.colors.paneBG};
|
|
|
|
|
padding: 5px 10px;
|
|
|
|
|
color: ${props => props.theme.colors.textOnDarkBG};
|
2019-11-08 11:02:00 +00:00
|
|
|
overflow-y: scroll;
|
2019-10-18 08:16:26 +00:00
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
class Sidebar extends React.Component {
|
|
|
|
|
render() {
|
|
|
|
|
return (
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
<SidebarWrapper>
|
|
|
|
|
<Switch>
|
|
|
|
|
<Route exact path={BUILDER_URL} component={WidgetSidebar} />
|
|
|
|
|
<Route exact path={API_EDITOR_URL} component={ApiSidebar} />
|
2019-10-21 15:12:45 +00:00
|
|
|
<Route exact path={API_EDITOR_ID_URL()} component={ApiSidebar} />
|
2019-10-18 08:16:26 +00:00
|
|
|
</Switch>
|
|
|
|
|
</SidebarWrapper>
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default Sidebar;
|