StorySlides: Fix active story transition on desktop (#4188)
This commit is contained in:
parent
44a0c0a4fc
commit
88ff94c2bb
@ -801,6 +801,18 @@ function Story({
|
|||||||
{isLoadedStory && fullMediaData && (
|
{isLoadedStory && fullMediaData && (
|
||||||
<MediaAreaOverlay story={story} isActive />
|
<MediaAreaOverlay story={story} isActive />
|
||||||
)}
|
)}
|
||||||
|
{!isMobile && (
|
||||||
|
<div className={styles.content}>
|
||||||
|
<div className={styles.contentInner}>
|
||||||
|
<Avatar
|
||||||
|
peer={peer}
|
||||||
|
withStory
|
||||||
|
storyViewerMode="disabled"
|
||||||
|
/>
|
||||||
|
<div className={styles.name}>{renderText(getSenderTitle(lang, peer) || '')}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{shouldShowFooter && (
|
{shouldShowFooter && (
|
||||||
@ -850,7 +862,12 @@ function Story({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default memo(withGlobal<OwnProps>((global, {
|
export default memo(withGlobal<OwnProps>((global, {
|
||||||
peerId, storyId, isPrivateStories, isArchivedStories, isReportModalOpen, isDeleteModalOpen,
|
peerId,
|
||||||
|
storyId,
|
||||||
|
isPrivateStories,
|
||||||
|
isArchivedStories,
|
||||||
|
isReportModalOpen,
|
||||||
|
isDeleteModalOpen,
|
||||||
}): StateProps => {
|
}): StateProps => {
|
||||||
const { appConfig } = global;
|
const { appConfig } = global;
|
||||||
const user = selectUser(global, peerId);
|
const user = selectUser(global, peerId);
|
||||||
|
|||||||
@ -8,12 +8,10 @@ import type { StoryViewerOrigin } from '../../types';
|
|||||||
|
|
||||||
import { getSenderTitle, getStoryMediaHash } from '../../global/helpers';
|
import { getSenderTitle, getStoryMediaHash } from '../../global/helpers';
|
||||||
import { selectTabState } from '../../global/selectors';
|
import { selectTabState } from '../../global/selectors';
|
||||||
import buildClassName from '../../util/buildClassName';
|
|
||||||
import renderText from '../common/helpers/renderText';
|
import renderText from '../common/helpers/renderText';
|
||||||
|
|
||||||
import useLang from '../../hooks/useLang';
|
import useLang from '../../hooks/useLang';
|
||||||
import useMedia from '../../hooks/useMedia';
|
import useMedia from '../../hooks/useMedia';
|
||||||
import useShowTransition from '../../hooks/useShowTransition';
|
|
||||||
|
|
||||||
import Avatar from '../common/Avatar';
|
import Avatar from '../common/Avatar';
|
||||||
import MediaAreaOverlay from './mediaArea/MediaAreaOverlay';
|
import MediaAreaOverlay from './mediaArea/MediaAreaOverlay';
|
||||||
@ -35,7 +33,6 @@ function StoryPreview({
|
|||||||
}: OwnProps & StateProps) {
|
}: OwnProps & StateProps) {
|
||||||
const { openStoryViewer, loadPeerSkippedStories } = getActions();
|
const { openStoryViewer, loadPeerSkippedStories } = getActions();
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
const { transitionClassNames: appearanceAnimationClassNames } = useShowTransition(true);
|
|
||||||
|
|
||||||
const story = useMemo<ApiTypeStory | undefined>(() => {
|
const story = useMemo<ApiTypeStory | undefined>(() => {
|
||||||
if (!peerStories) {
|
if (!peerStories) {
|
||||||
@ -79,7 +76,7 @@ function StoryPreview({
|
|||||||
)}
|
)}
|
||||||
{isLoaded && <MediaAreaOverlay story={story} />}
|
{isLoaded && <MediaAreaOverlay story={story} />}
|
||||||
|
|
||||||
<div className={buildClassName(styles.content, appearanceAnimationClassNames)}>
|
<div className={styles.content}>
|
||||||
<div className={styles.contentInner}>
|
<div className={styles.contentInner}>
|
||||||
<Avatar
|
<Avatar
|
||||||
peer={peer}
|
peer={peer}
|
||||||
|
|||||||
@ -341,6 +341,7 @@ function StorySlides({
|
|||||||
current.style.setProperty('--slide-translate-x', '0px');
|
current.style.setProperty('--slide-translate-x', '0px');
|
||||||
current.style.setProperty('--slide-translate-y', '0px');
|
current.style.setProperty('--slide-translate-y', '0px');
|
||||||
current.style.setProperty('--slide-translate-scale', '1');
|
current.style.setProperty('--slide-translate-scale', '1');
|
||||||
|
current.style.setProperty('--slide-content-scale', String(slideSizes.toActiveScale));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -127,6 +127,11 @@
|
|||||||
.mediaPreview {
|
.mediaPreview {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
opacity: 1 !important;
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.slide {
|
.slide {
|
||||||
@ -194,6 +199,11 @@
|
|||||||
opacity: 0;
|
opacity: 0;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
transform: scale(var(--slide-content-scale, 1));
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.slideInner {
|
.slideInner {
|
||||||
@ -260,6 +270,7 @@
|
|||||||
right: 0;
|
right: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: rgba(0, 0, 0, 0.5);
|
background: rgba(0, 0, 0, 0.5);
|
||||||
|
transition: opacity 250ms ease-in-out;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -274,7 +285,6 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
max-width: 90%;
|
max-width: 90%;
|
||||||
transition: opacity 300ms;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user