diff --git a/stylesheets/_modules.scss b/stylesheets/_modules.scss index 535cc16833..a7cf675221 100644 --- a/stylesheets/_modules.scss +++ b/stylesheets/_modules.scss @@ -3924,8 +3924,8 @@ button.module-image__border-overlay:focus { line-height: 0; overflow: hidden; border-radius: 5px; - transition: top 200ms linear, left 200ms linear, width 200ms linear, - height 200ms linear; + transform: translate(0, 0); + transition: transform 200ms linear, width 200ms linear, height 200ms linear; &__remote-video { // The background-color is seen while the video loads. diff --git a/stylesheets/components/CallingToast.scss b/stylesheets/components/CallingToast.scss index d634083827..8ad11673f2 100644 --- a/stylesheets/components/CallingToast.scss +++ b/stylesheets/components/CallingToast.scss @@ -13,12 +13,13 @@ position: absolute; text-align: center; top: 12px; - transition: top 200ms ease-out, opacity 200ms ease-out; + transform: translateY(0); + transition: transform 200ms ease-out, opacity 200ms ease-out; user-select: none; z-index: $z-index-above-above-base; &--hidden { opacity: 0; - top: 5px; + transform: translateY(-7px); } } diff --git a/stylesheets/components/ConversationHeader.scss b/stylesheets/components/ConversationHeader.scss index 76b3459d31..3724277059 100644 --- a/stylesheets/components/ConversationHeader.scss +++ b/stylesheets/components/ConversationHeader.scss @@ -55,11 +55,12 @@ width: 24px; height: 24px; min-width: 24px; - margin-left: -24px; + margin-left: 12px; + transform: translateX(-36px); vertical-align: text-bottom; border: none; opacity: 0; - transition: margin-left $transition, opacity $transition; + transition: transform $transition, opacity $transition; &:disabled { cursor: default; @@ -68,7 +69,7 @@ &--show { opacity: 1; margin-right: 6px; - margin-left: 12px; + transform: translateX(0px); } @include light-theme { diff --git a/stylesheets/components/IncomingCallBar.scss b/stylesheets/components/IncomingCallBar.scss index 4d8569239f..666aec9e6b 100644 --- a/stylesheets/components/IncomingCallBar.scss +++ b/stylesheets/components/IncomingCallBar.scss @@ -5,6 +5,7 @@ &__container { animation: IncomingCallBar--animation 0.2s forwards ease-out; position: fixed; + top: 22px; width: 100%; z-index: $z-index-popup; padding: { @@ -185,12 +186,12 @@ @keyframes IncomingCallBar--animation { from { - top: -100px; + transform: translateY(-100px); opacity: 0; } to { - top: 22px; + transform: translateY(0px); opacity: 1; } } diff --git a/stylesheets/components/InstallScreenQrCodeNotScannedStep.scss b/stylesheets/components/InstallScreenQrCodeNotScannedStep.scss index ae4a811260..8442fc8980 100644 --- a/stylesheets/components/InstallScreenQrCodeNotScannedStep.scss +++ b/stylesheets/components/InstallScreenQrCodeNotScannedStep.scss @@ -15,6 +15,7 @@ flex-direction: row; animation: 500ms module-InstallScreenQrCodeNotScannedStep__slide-in; position: relative; + top: 0; @include light-theme { max-width: $base-max-width; @@ -113,12 +114,12 @@ @keyframes module-InstallScreenQrCodeNotScannedStep__slide-in { from { - top: -8px; + transform: translateY(-8px); opacity: 0; } to { - top: 0; + transform: translateY(0px); opacity: 1; } } diff --git a/stylesheets/components/LeftPaneDialog.scss b/stylesheets/components/LeftPaneDialog.scss index 3022b0d56c..7f41da8b74 100644 --- a/stylesheets/components/LeftPaneDialog.scss +++ b/stylesheets/components/LeftPaneDialog.scss @@ -238,7 +238,9 @@ border-radius: 2px; display: block; height: 100%; - transition: width 500ms ease-out; + width: 100%; + transform: translateX(-100%); + transition: transform 500ms ease-out; } } diff --git a/ts/components/CallingToastManager.tsx b/ts/components/CallingToastManager.tsx index 82e060ce98..fca85d9306 100644 --- a/ts/components/CallingToastManager.tsx +++ b/ts/components/CallingToastManager.tsx @@ -115,33 +115,33 @@ export function CallingToastManager(props: PropsType): JSX.Element { toast = screenSharingToast; } - const [toastMessage, setToastMessage] = useState(''); + const [isVisible, setIsVisible] = useState(false); const timeoutRef = useRef(null); const dismissToast = useCallback(() => { if (timeoutRef) { - setToastMessage(''); + setIsVisible(false); } - }, [setToastMessage, timeoutRef]); + }, [setIsVisible, timeoutRef]); useEffect(() => { - if (toast) { - if (toast.type === 'dismissable') { - clearTimeoutIfNecessary(timeoutRef.current); - timeoutRef.current = setTimeout(dismissToast, DEFAULT_LIFETIME); - } + setIsVisible(toast !== undefined); + }, [toast]); - setToastMessage(toast.message); + useEffect(() => { + if (toast?.type === 'dismissable') { + clearTimeoutIfNecessary(timeoutRef.current); + timeoutRef.current = setTimeout(dismissToast, DEFAULT_LIFETIME); } return () => { clearTimeoutIfNecessary(timeoutRef.current); }; - }, [dismissToast, setToastMessage, timeoutRef, toast]); + }, [dismissToast, setIsVisible, timeoutRef, toast]); return ( - - {toastMessage} + + {toast?.message} ); } diff --git a/ts/components/DialogUpdate.stories.tsx b/ts/components/DialogUpdate.stories.tsx index 6c76d27b1f..df52f0dacc 100644 --- a/ts/components/DialogUpdate.stories.tsx +++ b/ts/components/DialogUpdate.stories.tsx @@ -7,6 +7,7 @@ import { action } from '@storybook/addon-actions'; import { DialogUpdate } from './DialogUpdate'; import { DialogType } from '../types/Dialogs'; import { WidthBreakpoint } from './_util'; +import { SECOND } from '../util/durations'; import { FakeLeftPaneContainer } from '../test-both/helpers/FakeLeftPaneContainer'; import { setupI18n } from '../util/setupI18n'; @@ -110,10 +111,29 @@ FullDownloadReadyWide.story = { }; export function DownloadingWide(): JSX.Element { + const [downloadedSize, setDownloadedSize] = React.useState(0); + + const { downloadSize } = defaultProps; + + React.useEffect(() => { + const interval = setInterval(() => { + setDownloadedSize(x => { + const newValue = x + 0.25 * downloadSize; + if (newValue > downloadSize) { + return 0; + } + return newValue; + }); + }, SECOND); + + return () => clearInterval(interval); + }, [downloadSize]); + return (
diff --git a/ts/components/GroupCallRemoteParticipant.tsx b/ts/components/GroupCallRemoteParticipant.tsx index 085238909b..e68c33937f 100644 --- a/ts/components/GroupCallRemoteParticipant.tsx +++ b/ts/components/GroupCallRemoteParticipant.tsx @@ -235,8 +235,7 @@ export const GroupCallRemoteParticipant: React.FC = React.memo( if ('top' in props) { containerStyles.position = 'absolute'; - containerStyles.top = props.top; - containerStyles.left = props.left; + containerStyles.transform = `translate(${props.left}px, ${props.top}px)`; } }