2022-08-12 07:35:32 +00:00
|
|
|
import { List } from "react-virtualized";
|
2022-08-17 12:11:48 +00:00
|
|
|
import styled, { css } from "styled-components";
|
2022-07-20 10:25:33 +00:00
|
|
|
import Base from "../themes/base";
|
2022-08-17 12:11:48 +00:00
|
|
|
import { desktop, mobile, tablet } from "../utils/device";
|
2022-07-11 14:06:21 +00:00
|
|
|
|
2022-07-20 10:25:33 +00:00
|
|
|
const StyledScroll = styled.div`
|
|
|
|
overflow: scroll;
|
|
|
|
|
|
|
|
/* Chrome, Edge и Safari */
|
|
|
|
|
|
|
|
::-webkit-scrollbar {
|
|
|
|
width: 8px;
|
|
|
|
height: 8px;
|
|
|
|
}
|
|
|
|
|
|
|
|
::-webkit-scrollbar-thumb {
|
|
|
|
background-color: ${({ theme }) => theme.scrollbar.backgroundColorVertical};
|
|
|
|
border-radius: 3px;
|
|
|
|
|
|
|
|
:hover {
|
|
|
|
background-color: ${({ theme }) =>
|
|
|
|
theme.scrollbar.hoverBackgroundColorVertical};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Firefox */
|
|
|
|
|
|
|
|
scrollbar-width: thin;
|
|
|
|
scrollbar-color: ${({ theme }) => theme.scrollbar.backgroundColorVertical};
|
|
|
|
`;
|
|
|
|
|
2022-08-17 12:11:48 +00:00
|
|
|
const rowStyles = css`
|
|
|
|
.row-list-item,
|
|
|
|
.row-loader {
|
|
|
|
padding-left: 16px;
|
|
|
|
width: calc(100% - 33px) !important;
|
|
|
|
|
|
|
|
@media ${mobile} {
|
|
|
|
width: calc(100% - 24px) !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.row-loader {
|
|
|
|
padding-left: 22px;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const tableStyles = css`
|
|
|
|
margin-left: -20px;
|
|
|
|
width: ${({ width }) => width + 40 + "px !important"};
|
|
|
|
|
|
|
|
.ReactVirtualized__Grid__innerScrollContainer {
|
|
|
|
max-width: ${({ width }) => width + 40 + "px !important"};
|
|
|
|
}
|
|
|
|
.table-container_body-loader {
|
|
|
|
width: calc(100% - 48px) !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
.table-list-item,
|
|
|
|
.table-container_body-loader {
|
|
|
|
padding-left: 20px;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const tileStyles = css`
|
|
|
|
.files_header {
|
|
|
|
padding-top: 11px;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2022-08-12 07:35:32 +00:00
|
|
|
const StyledList = styled(List)`
|
|
|
|
outline: none;
|
2022-08-12 14:01:53 +00:00
|
|
|
overflow: hidden !important;
|
2022-08-17 12:11:48 +00:00
|
|
|
|
|
|
|
${({ viewAs }) =>
|
|
|
|
viewAs === "row"
|
|
|
|
? rowStyles
|
|
|
|
: viewAs === "table"
|
|
|
|
? tableStyles
|
|
|
|
: tileStyles}
|
2022-08-12 07:35:32 +00:00
|
|
|
`;
|
|
|
|
|
2022-07-20 10:25:33 +00:00
|
|
|
StyledScroll.defaultProps = {
|
|
|
|
theme: Base,
|
|
|
|
};
|
|
|
|
|
2022-08-12 07:35:32 +00:00
|
|
|
export { StyledScroll, StyledList };
|