2021-07-07 23:50:57 +03:00
|
|
|
import * as System from "~/components/system";
|
|
|
|
import * as Styles from "~/common/styles";
|
|
|
|
import * as Constants from "~/common/constants";
|
|
|
|
|
|
|
|
import { LoaderSpinner } from "~/components/system/components/Loaders";
|
|
|
|
import { css } from "@emotion/react";
|
|
|
|
|
|
|
|
import LinkTag from "~/components/core/Link/LinkTag";
|
|
|
|
|
|
|
|
const STYLES_IMAGE_CONTAINER = css`
|
|
|
|
width: 100%;
|
|
|
|
max-height: 40%;
|
|
|
|
overflow: hidden;
|
|
|
|
margin-bottom: 16px;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
`;
|
|
|
|
|
|
|
|
export default function LinkLoading({ file }) {
|
|
|
|
const url = file.url;
|
|
|
|
const { link } = file.data;
|
|
|
|
const { image, name } = link;
|
|
|
|
return (
|
|
|
|
<div
|
|
|
|
css={Styles.VERTICAL_CONTAINER_CENTERED}
|
|
|
|
style={{ backgroundColor: Constants.semantic.bgLight, height: "100%" }}
|
|
|
|
>
|
|
|
|
<div css={STYLES_IMAGE_CONTAINER}>
|
2021-07-16 23:35:43 +03:00
|
|
|
<img src={image} css={Styles.IMAGE_FILL} />
|
2021-07-07 23:50:57 +03:00
|
|
|
</div>
|
|
|
|
<div css={Styles.VERTICAL_CONTAINER_CENTERED}>
|
2021-07-13 03:08:42 +03:00
|
|
|
<System.H3
|
|
|
|
style={{ marginBottom: 16, color: Constants.semantic.textBlack, textAlign: "center" }}
|
|
|
|
>
|
2021-07-07 23:50:57 +03:00
|
|
|
{name}
|
|
|
|
</System.H3>
|
|
|
|
<span style={{ marginBottom: 16 }}>
|
|
|
|
<LinkTag
|
2021-08-04 07:42:31 +03:00
|
|
|
fillWidth={true}
|
2021-07-07 23:50:57 +03:00
|
|
|
url={url}
|
|
|
|
containerStyle={{
|
2021-07-08 00:44:13 +03:00
|
|
|
backgroundColor: Constants.system.blue,
|
2021-07-07 23:50:57 +03:00
|
|
|
borderRadius: 8,
|
|
|
|
padding: "8px 16px",
|
|
|
|
}}
|
|
|
|
style={{
|
|
|
|
color: Constants.system.white,
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</span>
|
|
|
|
<LoaderSpinner style={{ height: 24, width: 24 }} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|