2020-11-09 23:56:30 +00:00
|
|
|
import React from "react";
|
2020-11-10 14:29:11 +00:00
|
|
|
import PropTypes from "prop-types";
|
2020-11-09 23:56:30 +00:00
|
|
|
import styled from "styled-components";
|
|
|
|
import RectangleLoader from "../RectangleLoader/index";
|
|
|
|
import CircleLoader from "../CircleLoader/index";
|
|
|
|
|
|
|
|
import { utils } from "asc-web-components";
|
|
|
|
|
2020-11-10 14:29:11 +00:00
|
|
|
const { desktop, tablet, mobile } = utils.device;
|
2020-11-09 23:56:30 +00:00
|
|
|
|
|
|
|
const StyledBox1 = styled.div`
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: 160px 1fr;
|
|
|
|
grid-template-rows: 1fr;
|
|
|
|
grid-column-gap: 32px;
|
|
|
|
|
|
|
|
@media ${mobile} {
|
|
|
|
grid-template-columns: 1fr;
|
|
|
|
grid-template-rows: 1fr 1fr;
|
|
|
|
}
|
2020-11-10 14:29:11 +00:00
|
|
|
padding-bottom: 12px;
|
2020-11-09 23:56:30 +00:00
|
|
|
`;
|
|
|
|
|
|
|
|
const StyledBox2 = styled.div`
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: 1fr;
|
|
|
|
grid-template-rows: 160px 36px;
|
|
|
|
grid-row-gap: 12px;
|
|
|
|
|
|
|
|
padding-bottom: 40px;
|
|
|
|
|
|
|
|
@media ${mobile} {
|
|
|
|
padding-bottom: 32px;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const StyledBox3 = styled.div`
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: 1fr;
|
|
|
|
grid-template-rows: repeat(9, 1fr);
|
|
|
|
grid-row-gap: 8px;
|
|
|
|
padding-bottom: 40px;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const StyledBox4 = styled.div`
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: repeat(2, 200px);
|
|
|
|
grid-template-rows: 1fr;
|
|
|
|
grid-column-gap: 16px;
|
|
|
|
padding-top: 40px;
|
|
|
|
padding-bottom: 40px;
|
2020-11-10 14:29:11 +00:00
|
|
|
|
2020-11-09 23:56:30 +00:00
|
|
|
@media ${desktop} {
|
|
|
|
grid-template-columns: repeat(3, 200px);
|
|
|
|
}
|
2020-11-10 14:29:11 +00:00
|
|
|
@media ${tablet} {
|
|
|
|
.row-content__tablet {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
2020-11-09 23:56:30 +00:00
|
|
|
@media ${mobile} {
|
|
|
|
grid-template-columns: 200px;
|
2020-11-10 14:29:11 +00:00
|
|
|
.row-content__mobile {
|
|
|
|
display: none;
|
|
|
|
}
|
2020-11-09 23:56:30 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const StyledSpacer = styled.div`
|
|
|
|
padding-bottom: 40px;
|
|
|
|
`;
|
|
|
|
|
2020-11-10 14:29:11 +00:00
|
|
|
const ProfileViewLoader = ({ id, className, style, isEdit, ...rest }) => {
|
|
|
|
const {
|
|
|
|
title,
|
|
|
|
borderRadius,
|
|
|
|
backgroundColor,
|
|
|
|
foregroundColor,
|
|
|
|
backgroundOpacity,
|
|
|
|
foregroundOpacity,
|
|
|
|
speed,
|
|
|
|
animate,
|
|
|
|
} = rest;
|
|
|
|
|
2020-11-09 23:56:30 +00:00
|
|
|
return (
|
2020-11-10 14:29:11 +00:00
|
|
|
<div id={id} className={className} style={style}>
|
2020-11-09 23:56:30 +00:00
|
|
|
<StyledBox1>
|
|
|
|
<StyledBox2>
|
2020-11-10 14:29:11 +00:00
|
|
|
<CircleLoader
|
|
|
|
title={title}
|
|
|
|
x="80"
|
|
|
|
y="80"
|
|
|
|
radius="80"
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
|
|
|
animate={animate}
|
|
|
|
/>
|
|
|
|
{isEdit ? (
|
|
|
|
<RectangleLoader
|
|
|
|
title={title}
|
|
|
|
width="160"
|
|
|
|
height="36"
|
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
|
|
|
animate={animate}
|
|
|
|
/>
|
2020-11-09 23:56:30 +00:00
|
|
|
) : (
|
|
|
|
<></>
|
|
|
|
)}
|
|
|
|
</StyledBox2>
|
|
|
|
<StyledBox3>
|
2020-11-10 14:29:11 +00:00
|
|
|
<RectangleLoader
|
|
|
|
title={title}
|
|
|
|
width="231"
|
|
|
|
height="16"
|
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
|
|
|
animate={animate}
|
|
|
|
/>
|
|
|
|
<RectangleLoader
|
|
|
|
title={title}
|
|
|
|
width="231"
|
|
|
|
height="16"
|
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
|
|
|
animate={animate}
|
|
|
|
/>
|
|
|
|
<RectangleLoader
|
|
|
|
title={title}
|
|
|
|
width="231"
|
|
|
|
height="16"
|
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
|
|
|
animate={animate}
|
|
|
|
/>
|
|
|
|
<RectangleLoader
|
|
|
|
title={title}
|
|
|
|
width="231"
|
|
|
|
height="16"
|
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
|
|
|
animate={animate}
|
|
|
|
/>
|
|
|
|
<RectangleLoader
|
|
|
|
title={title}
|
|
|
|
width="231"
|
|
|
|
height="16"
|
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
|
|
|
animate={animate}
|
|
|
|
/>
|
|
|
|
<RectangleLoader
|
|
|
|
title={title}
|
|
|
|
width="231"
|
|
|
|
height="16"
|
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
|
|
|
animate={animate}
|
|
|
|
/>
|
|
|
|
<RectangleLoader
|
|
|
|
title={title}
|
|
|
|
width="231"
|
|
|
|
height="16"
|
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
|
|
|
animate={animate}
|
|
|
|
/>
|
|
|
|
<RectangleLoader
|
|
|
|
title={title}
|
|
|
|
width="231"
|
|
|
|
height="16"
|
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
|
|
|
animate={animate}
|
|
|
|
/>
|
|
|
|
<RectangleLoader
|
|
|
|
title={title}
|
|
|
|
width="111"
|
|
|
|
height="16"
|
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
|
|
|
animate={animate}
|
|
|
|
/>
|
2020-11-09 23:56:30 +00:00
|
|
|
</StyledBox3>
|
2020-11-10 14:29:11 +00:00
|
|
|
<RectangleLoader
|
|
|
|
title={title}
|
|
|
|
width="200"
|
|
|
|
height="24"
|
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
|
|
|
animate={animate}
|
|
|
|
/>
|
2020-11-09 23:56:30 +00:00
|
|
|
</StyledBox1>
|
2020-11-10 14:29:11 +00:00
|
|
|
<RectangleLoader
|
|
|
|
title={title}
|
|
|
|
width="100%"
|
|
|
|
height="80"
|
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
|
|
|
animate={animate}
|
|
|
|
/>
|
2020-11-09 23:56:30 +00:00
|
|
|
<StyledSpacer />
|
|
|
|
|
2020-11-10 14:29:11 +00:00
|
|
|
<RectangleLoader
|
|
|
|
title={title}
|
|
|
|
width="200"
|
|
|
|
height="24"
|
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
|
|
|
animate={animate}
|
|
|
|
/>
|
2020-11-09 23:56:30 +00:00
|
|
|
<StyledBox4>
|
2020-11-10 14:29:11 +00:00
|
|
|
<RectangleLoader
|
|
|
|
title={title}
|
|
|
|
width="200"
|
|
|
|
height="80"
|
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
|
|
|
animate={animate}
|
|
|
|
/>
|
|
|
|
<RectangleLoader
|
|
|
|
className="row-content__mobile"
|
|
|
|
title={title}
|
|
|
|
width="200"
|
|
|
|
height="80"
|
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
|
|
|
animate={animate}
|
|
|
|
/>
|
|
|
|
<RectangleLoader
|
|
|
|
className="row-content__tablet row-content__mobile"
|
|
|
|
title={title}
|
|
|
|
width="200"
|
|
|
|
height="80"
|
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
|
|
|
animate={animate}
|
|
|
|
/>
|
2020-11-09 23:56:30 +00:00
|
|
|
</StyledBox4>
|
|
|
|
|
2020-11-10 14:29:11 +00:00
|
|
|
<RectangleLoader
|
|
|
|
title={title}
|
|
|
|
width="200"
|
|
|
|
height="24"
|
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
|
|
|
animate={animate}
|
|
|
|
/>
|
2020-11-09 23:56:30 +00:00
|
|
|
<StyledBox4>
|
2020-11-10 14:29:11 +00:00
|
|
|
<RectangleLoader
|
|
|
|
title={title}
|
|
|
|
width="200"
|
|
|
|
height="80"
|
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
|
|
|
animate={animate}
|
|
|
|
/>
|
|
|
|
<RectangleLoader
|
|
|
|
className="row-content__mobile"
|
|
|
|
title={title}
|
|
|
|
width="200"
|
|
|
|
height="80"
|
|
|
|
borderRadius={borderRadius}
|
|
|
|
backgroundColor={backgroundColor}
|
|
|
|
foregroundColor={foregroundColor}
|
|
|
|
backgroundOpacity={backgroundOpacity}
|
|
|
|
foregroundOpacity={foregroundOpacity}
|
|
|
|
speed={speed}
|
|
|
|
animate={animate}
|
|
|
|
/>
|
2020-11-09 23:56:30 +00:00
|
|
|
</StyledBox4>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
ProfileViewLoader.propTypes = {
|
2020-11-10 14:29:11 +00:00
|
|
|
id: PropTypes.string,
|
|
|
|
className: PropTypes.string,
|
|
|
|
style: PropTypes.object,
|
|
|
|
isEdit: PropTypes.bool,
|
2020-11-09 23:56:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
ProfileViewLoader.defaultProps = {
|
2020-11-10 14:29:11 +00:00
|
|
|
id: undefined,
|
|
|
|
className: undefined,
|
|
|
|
style: undefined,
|
|
|
|
isEdit: true,
|
2020-11-09 23:56:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default ProfileViewLoader;
|