Avatar: Fix missing opacity animation (#2818)
This commit is contained in:
parent
21678cfd51
commit
b44a1396db
@ -347,7 +347,7 @@ const Main: FC<OwnProps & StateProps> = ({
|
||||
}, [lastSyncTime, openChat]);
|
||||
|
||||
const leftColumnTransition = useShowTransition(
|
||||
isLeftColumnOpen, undefined, true, undefined, shouldSkipHistoryAnimations,
|
||||
isLeftColumnOpen, undefined, true, undefined, shouldSkipHistoryAnimations, undefined, true,
|
||||
);
|
||||
const willAnimateLeftColumnRef = useRef(false);
|
||||
const forceUpdate = useForceUpdate();
|
||||
@ -376,7 +376,7 @@ const Main: FC<OwnProps & StateProps> = ({
|
||||
}, [animationLevel, forceUpdate, isLeftColumnOpen]);
|
||||
|
||||
const rightColumnTransition = useShowTransition(
|
||||
isRightColumnOpen, undefined, true, undefined, shouldSkipHistoryAnimations,
|
||||
isRightColumnOpen, undefined, true, undefined, shouldSkipHistoryAnimations, undefined, true,
|
||||
);
|
||||
const willAnimateRightColumnRef = useRef(false);
|
||||
const [isNarrowMessageList, setIsNarrowMessageList] = useState(isRightColumnOpen);
|
||||
|
||||
@ -6,15 +6,16 @@ const CLOSE_DURATION = 350;
|
||||
const useShowTransition = (
|
||||
isOpen = false,
|
||||
onCloseTransitionEnd?: () => void,
|
||||
noOpenTransition = false,
|
||||
noFirstOpenTransition = false,
|
||||
className: string | false = 'fast',
|
||||
noCloseTransition = false,
|
||||
closeDuration = CLOSE_DURATION,
|
||||
noOpenTransition = false,
|
||||
) => {
|
||||
const [isClosed, setIsClosed] = useState(!isOpen);
|
||||
const closeTimeoutRef = useRef<number>();
|
||||
// СSS class should be added in a separate tick to turn on CSS transition.
|
||||
const [hasOpenClassName, setHasOpenClassName] = useState(isOpen && noOpenTransition);
|
||||
const [hasOpenClassName, setHasOpenClassName] = useState(isOpen && noFirstOpenTransition);
|
||||
|
||||
if (isOpen) {
|
||||
setIsClosed(false);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user