fix mobile embed

This commit is contained in:
Rafael 2022-03-16 10:47:30 -03:00 committed by Thomas Zarebczan
parent e93d734fa3
commit d4cb51ff2a
3 changed files with 9 additions and 11 deletions

View file

@ -2,7 +2,6 @@
import { INLINE_PLAYER_WRAPPER_CLASS } from 'component/fileRenderFloating/view'; import { INLINE_PLAYER_WRAPPER_CLASS } from 'component/fileRenderFloating/view';
import * as React from 'react'; import * as React from 'react';
import Button from 'component/button'; import Button from 'component/button';
import classnames from 'classnames';
import FileRenderInitiator from 'component/fileRenderInitiator'; import FileRenderInitiator from 'component/fileRenderInitiator';
import UriIndicator from 'component/uriIndicator'; import UriIndicator from 'component/uriIndicator';
@ -82,8 +81,8 @@ class ClaimLink extends React.Component<Props> {
if (allowPreview) { if (allowPreview) {
return ( return (
<div className={classnames('claim-link')}> <div className="claim-link">
<div className={isPlayingInline ? INLINE_PLAYER_WRAPPER_CLASS : undefined}> <div className={isPlayingInline ? INLINE_PLAYER_WRAPPER_CLASS : 'embed__inline-wrapper'}>
<FileRenderInitiator uri={uri} parentCommentId={parentCommentId} isMarkdownPost={isMarkdownPost} embedded /> <FileRenderInitiator uri={uri} parentCommentId={parentCommentId} isMarkdownPost={isMarkdownPost} embedded />
</div> </div>
<Button button="link" className="preview-link__url" label={uri} navigate={uri} /> <Button button="link" className="preview-link__url" label={uri} navigate={uri} />

View file

@ -332,7 +332,7 @@ export default function FileRenderFloating(props: Props) {
'content__viewer--secondary': isComment, 'content__viewer--secondary': isComment,
'content__viewer--theater-mode': videoTheaterMode && mainFilePlaying && !isCurrentClaimLive && !isMobile, 'content__viewer--theater-mode': videoTheaterMode && mainFilePlaying && !isCurrentClaimLive && !isMobile,
'content__viewer--disable-click': wasDragging, 'content__viewer--disable-click': wasDragging,
'content__viewer--mobile': isMobile, 'content__viewer--mobile': isMobile && !playingUriSource,
})} })}
style={ style={
!isFloating && fileViewerRect !isFloating && fileViewerRect
@ -340,9 +340,12 @@ export default function FileRenderFloating(props: Props) {
width: fileViewerRect.width, width: fileViewerRect.width,
height: fileViewerRect.height, height: fileViewerRect.height,
left: fileViewerRect.x, left: fileViewerRect.x,
top: isMobile top:
isMobile && !playingUriSource
? HEADER_HEIGHT_MOBILE ? HEADER_HEIGHT_MOBILE
: fileViewerRect.windowOffset + fileViewerRect.top - HEADER_HEIGHT - (IS_DESKTOP_MAC ? 24 : 0), : fileViewerRect.windowOffset +
fileViewerRect.top -
(!isMobile ? HEADER_HEIGHT - (IS_DESKTOP_MAC ? 24 : 0) : 0),
} }
: {} : {}
} }

View file

@ -3,10 +3,6 @@
position: absolute; position: absolute;
top: var(--spacing-s); top: var(--spacing-s);
border-radius: var(--border-radius); border-radius: var(--border-radius);
@media (max-width: $breakpoint-small) {
// margin-top: calc(var(--header-height) - var(--header-height-mobile));
}
} }
.content__viewer--mobile { .content__viewer--mobile {