Polish up the My Stories page

This commit is contained in:
Josh Perez 2022-08-24 20:33:16 -04:00 committed by GitHub
parent 68398823e3
commit 984f26c98e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 69 additions and 43 deletions

View file

@ -133,6 +133,10 @@ export const TextAttachment = ({
node.setSelectionRange(node.value.length, node.value.length);
}, [isEditingText]);
const storyBackgroundColor = {
background: getBackgroundColor(textAttachment),
};
return (
<Measure bounds>
{({ contentRect, measureRef }) => (
@ -151,11 +155,12 @@ export const TextAttachment = ({
}
}}
ref={measureRef}
style={isThumbnail ? storyBackgroundColor : undefined}
>
<div
className="TextAttachment__story"
style={{
background: getBackgroundColor(textAttachment),
...(isThumbnail ? {} : storyBackgroundColor),
transform: `scale(${(contentRect.bounds?.height || 1) / 1280})`,
}}
>