Web: Files: Tiles: Refactoring
This commit is contained in:
parent
6cb00cd777
commit
e21b7a2176
@ -249,12 +249,8 @@ const quickButtonsPosition = css`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const badgeOutlineStyles = ({ top, right, left, width }) => css`
|
const badgeOutlineStyles = ({ top, right, left, width }) => {
|
||||||
position: relative;
|
const commonCss = css`
|
||||||
overflow: visible;
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
z-index: -1;
|
|
||||||
content: "";
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: ${top};
|
top: ${top};
|
||||||
@ -262,21 +258,25 @@ const badgeOutlineStyles = ({ top, right, left, width }) => css`
|
|||||||
${left && `left: ${left}`};
|
${left && `left: ${left}`};
|
||||||
height: 32px;
|
height: 32px;
|
||||||
width: ${width};
|
width: ${width};
|
||||||
border-radius: 4px;
|
`;
|
||||||
background: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
// this fixes hover
|
return css`
|
||||||
&::after {
|
position: relative;
|
||||||
content: "";
|
overflow: visible;
|
||||||
position: absolute;
|
|
||||||
top: ${top};
|
&::before {
|
||||||
${right && `right: ${right}`};
|
${commonCss};
|
||||||
${left && `left: ${left}`};
|
z-index: -1;
|
||||||
height: 32px;
|
border-radius: 4px;
|
||||||
width: ${width};
|
background: white;
|
||||||
}
|
}
|
||||||
`;
|
|
||||||
|
// this fixes hover
|
||||||
|
&::after {
|
||||||
|
${commonCss};
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
};
|
||||||
|
|
||||||
const StyledIcons = styled.div`
|
const StyledIcons = styled.div`
|
||||||
${(props) => props.isBadges && badgesPosition}
|
${(props) => props.isBadges && badgesPosition}
|
||||||
@ -381,11 +381,6 @@ class Tile extends React.PureComponent {
|
|||||||
} = this.props;
|
} = this.props;
|
||||||
const { isFolder, id, fileExst } = item;
|
const { isFolder, id, fileExst } = item;
|
||||||
|
|
||||||
const renderCheckbox = Object.prototype.hasOwnProperty.call(
|
|
||||||
this.props,
|
|
||||||
"checked"
|
|
||||||
);
|
|
||||||
|
|
||||||
const renderElement = Object.prototype.hasOwnProperty.call(
|
const renderElement = Object.prototype.hasOwnProperty.call(
|
||||||
this.props,
|
this.props,
|
||||||
"element"
|
"element"
|
||||||
@ -414,8 +409,7 @@ class Tile extends React.PureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const icon = this.getIconFile();
|
const icon = this.getIconFile();
|
||||||
const FilesTileContent = children[0];
|
const [FilesTileContent, badges] = children;
|
||||||
const badges = children[1];
|
|
||||||
const quickButtons = contentElement;
|
const quickButtons = contentElement;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user