2021-04-15 08:47:02 +00:00
|
|
|
import React from "react";
|
|
|
|
import PropTypes from "prop-types";
|
|
|
|
import {
|
|
|
|
StyledTile,
|
|
|
|
StyledBottom,
|
|
|
|
StyledMainContent,
|
|
|
|
} from "./StyledTileLoader";
|
|
|
|
import RectangleLoader from "../RectangleLoader";
|
|
|
|
|
|
|
|
const TileLoader = ({
|
|
|
|
isFolder,
|
|
|
|
title,
|
|
|
|
borderRadius,
|
|
|
|
backgroundColor,
|
|
|
|
foregroundColor,
|
|
|
|
backgroundOpacity,
|
|
|
|
foregroundOpacity,
|
|
|
|
speed,
|
|
|
|
animate,
|
|
|
|
...rest
|
|
|
|
}) => {
|
|
|
|
return isFolder ? (
|
|
|
|
<StyledTile {...rest} isFolder>
|
|
|
|
<StyledBottom className="bottom-content" isFolder>
|
|
|
|
<RectangleLoader
|
|
|
|
className="first-content"
|
|
|
|
title={title}
|
2021-06-23 12:34:30 +00:00
|
|
|
width="100%"
|
2021-04-15 08:47:02 +00:00
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
2021-06-24 16:34:47 +00:00
|
|
|
animate={false}
|
2021-04-15 08:47:02 +00:00
|
|
|
/>
|
|
|
|
<RectangleLoader
|
|
|
|
className="second-content"
|
|
|
|
title={title}
|
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
2021-06-24 16:34:47 +00:00
|
|
|
animate={false}
|
2021-04-15 08:47:02 +00:00
|
|
|
/>
|
|
|
|
</StyledBottom>
|
|
|
|
</StyledTile>
|
|
|
|
) : (
|
|
|
|
<StyledTile {...rest}>
|
|
|
|
<StyledMainContent>
|
|
|
|
<RectangleLoader
|
|
|
|
className="main-content"
|
|
|
|
height="100%"
|
2021-06-24 16:34:47 +00:00
|
|
|
//width="100%"
|
2021-04-15 08:47:02 +00:00
|
|
|
title={title}
|
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
2021-06-24 16:34:47 +00:00
|
|
|
animate={false}
|
2021-04-15 08:47:02 +00:00
|
|
|
/>
|
|
|
|
</StyledMainContent>
|
|
|
|
|
|
|
|
<StyledBottom className="bottom-content">
|
|
|
|
<RectangleLoader
|
|
|
|
className="first-content"
|
|
|
|
title={title}
|
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
2021-06-24 16:34:47 +00:00
|
|
|
animate={false}
|
2021-04-15 08:47:02 +00:00
|
|
|
/>
|
|
|
|
<RectangleLoader
|
|
|
|
className="second-content"
|
|
|
|
title={title}
|
2021-06-23 12:34:30 +00:00
|
|
|
width="100%"
|
2021-04-15 08:47:02 +00:00
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
2021-06-24 16:34:47 +00:00
|
|
|
animate={false}
|
2021-04-15 08:47:02 +00:00
|
|
|
/>
|
|
|
|
</StyledBottom>
|
|
|
|
</StyledTile>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
TileLoader.propTypes = {
|
|
|
|
id: PropTypes.string,
|
|
|
|
className: PropTypes.string,
|
|
|
|
style: PropTypes.object,
|
|
|
|
isRectangle: PropTypes.bool,
|
|
|
|
isFolder: PropTypes.bool,
|
|
|
|
};
|
|
|
|
|
|
|
|
TileLoader.defaultProps = {
|
|
|
|
id: undefined,
|
|
|
|
className: undefined,
|
|
|
|
style: undefined,
|
|
|
|
isRectangle: true,
|
|
|
|
isFolder: false,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default TileLoader;
|