From f3427db49fca1f82907b49b25b96c30da7931f0d Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Mon, 6 Jun 2022 01:44:28 +0400 Subject: [PATCH] Audio Player: Prevent overflow on medium screens, move buttons (#1907) --- src/components/common/Audio.scss | 10 +++++----- src/components/middle/AudioPlayer.scss | 17 +++++++++++++++-- src/components/middle/AudioPlayer.tsx | 10 +++++----- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/components/common/Audio.scss b/src/components/common/Audio.scss index cabf783d1..39d27ab91 100644 --- a/src/components/common/Audio.scss +++ b/src/components/common/Audio.scss @@ -177,6 +177,10 @@ unicode-bidi: plaintext; } + .date { + flex-shrink: 0; + } + .duration { font-size: 0.875rem; color: var(--color-text-secondary); @@ -201,7 +205,7 @@ } .performer { - flex-shrink: 0; + flex-shrink: 1; } .duration.with-seekline { @@ -304,10 +308,6 @@ line-height: 1.0625rem; } - .duration { - line-height: 1rem; - } - .media-loading { top: 0.1875rem; left: 0.1875rem; diff --git a/src/components/middle/AudioPlayer.scss b/src/components/middle/AudioPlayer.scss index b631a1eb2..9e12bfedc 100644 --- a/src/components/middle/AudioPlayer.scss +++ b/src/components/middle/AudioPlayer.scss @@ -128,6 +128,7 @@ justify-content: center; flex-direction: column; flex-shrink: 1; + max-width: 14rem; padding: 0 0.5rem; position: relative; overflow: hidden; @@ -138,12 +139,24 @@ background-color: var(--color-interactive-element-hover); } - @media (min-width: 1440px) and (max-width: 1500px) { - max-width: 14rem; + .right-column-shown & { + max-width: 10rem; + } + + @media (max-width: 600px) { + max-width: 100%; + } + + @media (min-width: 1440px) { + max-width: 24rem; + .right-column-shown & { + max-width: 14rem; + } } .AudioPlayer & .title { display: block; + margin-top: 0.125rem; font-weight: 500; font-size: 0.875rem !important; line-height: 1rem; diff --git a/src/components/middle/AudioPlayer.tsx b/src/components/middle/AudioPlayer.tsx index f4a79db61..bb0a778b3 100644 --- a/src/components/middle/AudioPlayer.tsx +++ b/src/components/middle/AudioPlayer.tsx @@ -161,6 +161,11 @@ const AudioPlayer: FC = ({ return (
+
+ {audio ? renderAudio(audio) : renderVoice(lang('AttachAudio'), senderName)} + +
+ -
- {audio ? renderAudio(audio) : renderVoice(lang('AttachAudio'), senderName)} - -
-