From 30dad5dc06f8b7efb33bbc99ff8d4f1cb0ba07ee Mon Sep 17 00:00:00 2001 From: Yiannis Christodoulou Date: Fri, 9 Jan 2026 09:09:09 +0200 Subject: [PATCH] Update default embed options in MediaShareEmbed Changed initial states for keepAspectRatio, showTitle, and responsive options in MediaShareEmbed to improve default embed behavior. Also simplified aspect ratio change logic by removing unit options adjustments. --- .../js/components/media-actions/MediaShareEmbed.jsx | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/frontend/src/static/js/components/media-actions/MediaShareEmbed.jsx b/frontend/src/static/js/components/media-actions/MediaShareEmbed.jsx index d130d1c7..6a639c38 100644 --- a/frontend/src/static/js/components/media-actions/MediaShareEmbed.jsx +++ b/frontend/src/static/js/components/media-actions/MediaShareEmbed.jsx @@ -17,12 +17,12 @@ export function MediaShareEmbed(props) { const onRightBottomRef = useRef(null); const [maxHeight, setMaxHeight] = useState(window.innerHeight - 144 + 56); - const [keepAspectRatio, setKeepAspectRatio] = useState(false); - const [showTitle, setShowTitle] = useState(false); + const [keepAspectRatio, setKeepAspectRatio] = useState(true); + const [showTitle, setShowTitle] = useState(true); const [showRelated, setShowRelated] = useState(true); const [showUserAvatar, setShowUserAvatar] = useState(true); const [linkTitle, setLinkTitle] = useState(true); - const [responsive, setResponsive] = useState(true); + const [responsive, setResponsive] = useState(false); const [startAt, setStartAt] = useState(false); const [startTime, setStartTime] = useState('0:00'); const [aspectRatio, setAspectRatio] = useState('16:9'); @@ -103,16 +103,9 @@ export function MediaShareEmbed(props) { const y = arr[1]; setKeepAspectRatio(true); - setEmbedWidthUnit('px'); - setEmbedHeightUnit('px'); setEmbedHeightValue(parseInt((embedWidthValue * y) / x, 10)); - setUnitOptions([{ key: 'px', label: 'px' }]); } else { setKeepAspectRatio(false); - setUnitOptions([ - { key: 'px', label: 'px' }, - { key: 'percent', label: '%' }, - ]); } }