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

45 lines
1.2 KiB
TypeScript
Raw Normal View History

import React, { memo, useEffect } from "react";
2019-10-18 08:16:26 +00:00
import styled from "styled-components";
import ExplorerSidebar from "pages/Editor/Explorer";
import { PanelStack, Classes } from "@blueprintjs/core";
import { Colors } from "constants/Colors";
import * as Sentry from "@sentry/react";
import PerformanceTracker, {
PerformanceTransactionName,
} from "utils/PerformanceTracker";
import { Layers } from "constants/Layers";
2019-10-18 08:16:26 +00:00
const SidebarWrapper = styled.div`
background-color: ${Colors.MINE_SHAFT};
padding: 0;
2020-12-24 04:32:25 +00:00
width: ${(props) => props.theme.sidebarWidth};
z-index: ${Layers.sideBar};
2020-12-24 04:32:25 +00:00
color: ${(props) => props.theme.colors.textOnDarkBG};
overflow-y: auto;
& .${Classes.PANEL_STACK} {
height: 100%;
.${Classes.PANEL_STACK_VIEW} {
background: none;
}
}
2019-10-18 08:16:26 +00:00
`;
const initialPanel = { component: ExplorerSidebar };
export const Sidebar = memo(() => {
PerformanceTracker.startTracking(PerformanceTransactionName.SIDE_BAR_MOUNT);
useEffect(() => {
PerformanceTracker.stopTracking();
});
return (
2020-03-30 14:21:21 +00:00
<SidebarWrapper className="t--sidebar">
<PanelStack initialPanel={initialPanel} showPanelHeader={false} />
</SidebarWrapper>
);
});
Sidebar.displayName = "Sidebar";
2019-10-18 08:16:26 +00:00
export default Sentry.withProfiler(Sidebar);