diff --git a/common/styles.js b/common/styles.js index 3c02e361..3d1a55a6 100644 --- a/common/styles.js +++ b/common/styles.js @@ -18,6 +18,7 @@ export const LINK = css` const TEXT = css` box-sizing: border-box; overflow-wrap: break-word; + text-align: left; a { ${LINK} diff --git a/components/core/CollectionPreviewBlock/index.js b/components/core/CollectionPreviewBlock/index.js index 3470d87c..009df195 100644 --- a/components/core/CollectionPreviewBlock/index.js +++ b/components/core/CollectionPreviewBlock/index.js @@ -14,7 +14,7 @@ import { css } from "@emotion/react"; import { FollowButton } from "~/components/core/CollectionPreviewBlock/components"; import { useFollowHandler } from "~/components/core/CollectionPreviewBlock/hooks"; import { Link } from "~/components/core/Link"; -import { AnimatePresence, motion } from "framer-motion"; +import { motion } from "framer-motion"; import ObjectPlaceholder from "~/components/core/ObjectPreview/placeholders"; @@ -46,9 +46,11 @@ const STYLES_PREVIEW = css` `; const STYLES_DESCRIPTION_CONTAINER = (theme) => css` + background-color: ${theme.semantic.bgLight}; + position: absolute; + bottom: 0%; display: flex; flex-direction: column; - position: relative; padding: 9px 16px 12px; border-radius: 0px 0px 16px 16px; box-shadow: 0 -0.5px 0.5px ${theme.system.grayLight4}; @@ -68,11 +70,8 @@ const STYLES_PROFILE_IMAGE = (theme) => css` object-fit: cover; `; -const STYLES_METRICS = (theme) => css` - margin-top: 7px; - @media (max-width: ${theme.sizes.mobile}px) { - margin-top: 12px; - } +const STYLES_METRICS = css` + margin-top: auto; ${Styles.CONTAINER_CENTERED}; ${STYLES_SPACE_BETWEEN} `; @@ -129,11 +128,6 @@ const getObjectToPreview = (objects = []) => { return { ...objects[objectIdx], isImage }; }; -const STYLES_DESCRIPTION_INNER = (theme) => css` - background-color: ${theme.semantic.bgLight}; - border-radius: 16px; -`; - const Preview = ({ collection, children, ...props }) => { const [isLoading, setLoading] = React.useState(true); const handleOnLoaded = () => setLoading(false); @@ -199,10 +193,8 @@ export default function CollectionPreview({ collection, viewer, owner, onAction const showControls = () => setShowControls(true); const hideControls = () => setShowControls(false); - // const [isBodyVisible, setShowBody] = React.useState(false); - // const showBody = () => setShowBody(true); - // const hideBody = () => setShowBody(false); - // const body = collection?.data?.body; + const { isDescriptionVisible, showDescription, hideDescription } = useShowDescription(); + const description = collection?.data?.body; const { follow, followCount, isFollowed } = useFollowHandler({ collection, viewer }); @@ -211,89 +203,112 @@ export default function CollectionPreview({ collection, viewer, owner, onAction return (