diff --git a/components/core/ObjectPreview/LinkObjectPreview.js b/components/core/ObjectPreview/LinkObjectPreview.js index ea59b17a4..1394053d7 100644 --- a/components/core/ObjectPreview/LinkObjectPreview.js +++ b/components/core/ObjectPreview/LinkObjectPreview.js @@ -1,49 +1,65 @@ import * as React from "react"; import * as Styles from "~/common/styles"; -import * as Constants from "~/common/constants"; -import * as Typography from "~/components/system/components/Typography"; +import * as SVG from "~/common/svg"; import { P3 } from "~/components/system/components/Typography"; import { css } from "@emotion/react"; -import { Logo } from "~/common/logo"; import ObjectPreviewPrimitive from "~/components/core/ObjectPreview/ObjectPreviewPrimitive"; +import LinkPlaceholder from "~/components/core/ObjectPreview/placeholders/Link"; const STYLES_SOURCE_LOGO = css` - height: 14px; - width: 14px; + height: 12px; + width: 12px; border-radius: 4px; `; -const STYLES_EMPTY_CONTAINER = css` - display: flex; - overflow: hidden; - flex-direction: column; - justify-content: center; - align-items: center; +const STYLES_PLACEHOLDER_CONTAINER = css` height: 100%; - width: 100%; + ${Styles.CONTAINER_CENTERED} `; -export default function LinkObjectPreview({ file, ...props }) { +const STYLES_TAG_CONTAINER = (theme) => css` + color: ${theme.semantic.textGrayLight}; + svg { + opacity: 0; + transition: opacity 0.3s; + } + :hover svg { + opacity: 1; + } + ${Styles.HORIZONTAL_CONTAINER_CENTERED} +`; + +export default function LinkObjectPreview({ file, ratio, ...props }) { const { data: { link }, } = file; const tag = ( -
- {link.logo && ( - Link source logo - )} - - {link.source} - -
+ e.stopPropagation()} + > +
+ {link.logo && ( + Link source logo + )} + + {link.source} + + +
+
); return ( @@ -51,9 +67,8 @@ export default function LinkObjectPreview({ file, ...props }) { {link.image ? ( Link preview ) : ( -
- - No image found +
+
)}