2022-05-06 12:11:04 +00:00
|
|
|
import React from "react";
|
|
|
|
import styled, { css } from "styled-components";
|
|
|
|
import ContextMenuButton from "@appserver/components/context-menu-button";
|
|
|
|
import IconButton from "@appserver/components/icon-button";
|
|
|
|
import { isMobile } from "react-device-detect";
|
|
|
|
import { tablet } from "@appserver/components/utils/device";
|
|
|
|
import { Base } from "@appserver/components/themes";
|
|
|
|
|
|
|
|
const StyledContainer = styled.div`
|
|
|
|
margin-left: 20px;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
height: 32px;
|
|
|
|
|
|
|
|
.add-button {
|
|
|
|
margin-right: 16px;
|
|
|
|
min-width: 15px;
|
|
|
|
|
|
|
|
@media ${tablet} {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
${isMobile &&
|
|
|
|
css`
|
|
|
|
display: none;
|
|
|
|
`}
|
|
|
|
}
|
|
|
|
|
|
|
|
.option-button {
|
|
|
|
margin-right: 16px;
|
|
|
|
min-width: 15px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.trash-button {
|
|
|
|
margin-right: 16px;
|
|
|
|
min-width: 15px;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const StyledInfoPanelToggleWrapper = styled.div`
|
2022-05-12 14:16:57 +00:00
|
|
|
display: ${(props) => (props.isInfoPanelVisible ? "none" : "flex")};
|
2022-05-06 12:11:04 +00:00
|
|
|
align-items: center;
|
|
|
|
align-self: center;
|
|
|
|
justify-content: center;
|
|
|
|
margin-left: auto;
|
|
|
|
|
2022-05-11 13:00:26 +00:00
|
|
|
margin-bottom: 1px;
|
|
|
|
|
2022-05-06 12:11:04 +00:00
|
|
|
@media ${tablet} {
|
|
|
|
margin-left: ${(props) => (props.isRootFolder ? "auto" : "0")};
|
|
|
|
}
|
|
|
|
|
|
|
|
${isMobile &&
|
|
|
|
css`
|
|
|
|
margin-left: ${(props) => (props.isRootFolder ? "auto" : "0")};
|
|
|
|
`}
|
|
|
|
|
|
|
|
.info-panel-toggle-bg {
|
|
|
|
height: 32px;
|
|
|
|
width: 32px;
|
2022-05-12 14:16:57 +00:00
|
|
|
|
2022-05-06 12:11:04 +00:00
|
|
|
display: flex;
|
2022-05-12 14:16:57 +00:00
|
|
|
|
2022-05-06 12:11:04 +00:00
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
border-radius: 50%;
|
|
|
|
background-color: ${(props) =>
|
|
|
|
props.isInfoPanelVisible
|
|
|
|
? props.theme.infoPanel.sectionHeaderToggleBgActive
|
|
|
|
: props.theme.infoPanel.sectionHeaderToggleBg};
|
|
|
|
|
|
|
|
path {
|
|
|
|
fill: ${(props) =>
|
|
|
|
props.isInfoPanelVisible
|
|
|
|
? props.theme.infoPanel.sectionHeaderToggleIconActive
|
|
|
|
: props.theme.infoPanel.sectionHeaderToggleIcon};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
StyledInfoPanelToggleWrapper.defaultProps = { theme: Base };
|
|
|
|
|
|
|
|
const ToggleInfoPanelButton = ({
|
|
|
|
isRootFolder,
|
|
|
|
isInfoPanelVisible,
|
2022-05-11 07:58:24 +00:00
|
|
|
toggleInfoPanel,
|
2022-05-06 12:11:04 +00:00
|
|
|
}) => {
|
|
|
|
return (
|
|
|
|
<StyledInfoPanelToggleWrapper
|
|
|
|
isRootFolder={isRootFolder}
|
|
|
|
isInfoPanelVisible={isInfoPanelVisible}
|
|
|
|
>
|
|
|
|
<div className="info-panel-toggle-bg">
|
|
|
|
<IconButton
|
|
|
|
className="info-panel-toggle"
|
|
|
|
iconName="images/panel.react.svg"
|
|
|
|
size="16"
|
|
|
|
isFill={true}
|
2022-05-11 07:58:24 +00:00
|
|
|
onClick={toggleInfoPanel}
|
2022-05-06 12:11:04 +00:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</StyledInfoPanelToggleWrapper>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ToggleInfoPanelButton;
|