2019-10-18 08:16:26 +00:00
|
|
|
import React from "react";
|
2020-03-11 13:59:46 +00:00
|
|
|
import { Switch } from "react-router";
|
2019-10-18 08:16:26 +00:00
|
|
|
import styled from "styled-components";
|
2019-10-21 15:12:45 +00:00
|
|
|
import {
|
|
|
|
|
API_EDITOR_URL,
|
|
|
|
|
BUILDER_URL,
|
|
|
|
|
API_EDITOR_ID_URL,
|
2020-01-27 08:24:58 +00:00
|
|
|
PAGE_LIST_EDITOR_URL,
|
2020-04-14 12:34:14 +00:00
|
|
|
getCurlImportPageURL,
|
|
|
|
|
API_EDITOR_URL_WITH_SELECTED_PAGE_ID,
|
|
|
|
|
getProviderTemplatesURL,
|
2019-11-22 14:02:55 +00:00
|
|
|
} from "constants/routes";
|
|
|
|
|
import WidgetSidebar from "pages/Editor/WidgetSidebar";
|
|
|
|
|
import ApiSidebar from "pages/Editor/ApiSidebar";
|
2020-01-27 08:24:58 +00:00
|
|
|
import PageListSidebar from "pages/Editor/PageListSidebar";
|
2020-03-11 13:59:46 +00:00
|
|
|
import AppRoute from "pages/common/AppRoute";
|
2019-10-18 08:16:26 +00:00
|
|
|
|
|
|
|
|
const SidebarWrapper = styled.div`
|
|
|
|
|
background-color: ${props => props.theme.colors.paneBG};
|
2020-01-24 09:54:40 +00:00
|
|
|
padding: 5px 0;
|
2019-10-18 08:16:26 +00:00
|
|
|
color: ${props => props.theme.colors.textOnDarkBG};
|
2019-11-22 14:02:55 +00:00
|
|
|
overflow-y: auto;
|
2019-10-18 08:16:26 +00:00
|
|
|
`;
|
|
|
|
|
|
2019-11-22 14:02:55 +00:00
|
|
|
export const Sidebar = () => {
|
|
|
|
|
return (
|
2020-03-30 14:21:21 +00:00
|
|
|
<SidebarWrapper className="t--sidebar">
|
2019-11-22 14:02:55 +00:00
|
|
|
<Switch>
|
2020-03-11 13:59:46 +00:00
|
|
|
<AppRoute
|
|
|
|
|
exact
|
|
|
|
|
path={BUILDER_URL}
|
|
|
|
|
component={WidgetSidebar}
|
|
|
|
|
name={"WidgetSidebar"}
|
|
|
|
|
/>
|
|
|
|
|
<AppRoute
|
|
|
|
|
exact
|
|
|
|
|
path={API_EDITOR_URL()}
|
|
|
|
|
component={ApiSidebar}
|
|
|
|
|
name={"ApiSidebar"}
|
|
|
|
|
/>
|
|
|
|
|
<AppRoute
|
|
|
|
|
exact
|
|
|
|
|
path={API_EDITOR_ID_URL()}
|
|
|
|
|
component={ApiSidebar}
|
|
|
|
|
name={"ApiSidebar"}
|
|
|
|
|
/>
|
|
|
|
|
<AppRoute
|
2020-01-27 08:24:58 +00:00
|
|
|
exact
|
|
|
|
|
path={PAGE_LIST_EDITOR_URL()}
|
|
|
|
|
component={PageListSidebar}
|
2020-03-11 13:59:46 +00:00
|
|
|
name={"PageListSidebar"}
|
2020-01-27 08:24:58 +00:00
|
|
|
/>
|
2020-04-14 12:34:14 +00:00
|
|
|
<AppRoute
|
|
|
|
|
exact
|
|
|
|
|
path={getCurlImportPageURL()}
|
|
|
|
|
component={ApiSidebar}
|
|
|
|
|
name={"ApiSidebar"}
|
|
|
|
|
/>
|
|
|
|
|
<AppRoute
|
|
|
|
|
exact
|
|
|
|
|
path={getProviderTemplatesURL()}
|
|
|
|
|
component={ApiSidebar}
|
|
|
|
|
name={"ApiSidebar"}
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<AppRoute
|
|
|
|
|
exact
|
|
|
|
|
path={API_EDITOR_URL_WITH_SELECTED_PAGE_ID()}
|
|
|
|
|
component={ApiSidebar}
|
|
|
|
|
name={"ApiSidebar"}
|
|
|
|
|
/>
|
2019-11-22 14:02:55 +00:00
|
|
|
</Switch>
|
|
|
|
|
</SidebarWrapper>
|
|
|
|
|
);
|
|
|
|
|
};
|
2019-10-18 08:16:26 +00:00
|
|
|
|
|
|
|
|
export default Sidebar;
|