Skip to content

Commit

Permalink
feat(suite): new device renders and animations (#15966)
Browse files Browse the repository at this point in the history
* feat(suite): add adjusted device renders and animations

* fix(suite): fix image size in viewonlypromo
  • Loading branch information
MiroslavProchazka authored Jan 22, 2025
1 parent 34cbaa4 commit 7704090
Show file tree
Hide file tree
Showing 31 changed files with 12 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export const DeviceAnimation = forwardRef<HTMLVideoElement, DeviceAnimationProps

// Animations on following devices are transparent.
const themeSuffix = [
DeviceModelInternal.T1B1,
DeviceModelInternal.T2B1,
DeviceModelInternal.T2T1,
DeviceModelInternal.T3B1,
DeviceModelInternal.T3T1,
DeviceModelInternal.T3W1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';

import styled from 'styled-components';

import { DeviceAnimation, Image } from '@trezor/components';
import { DeviceAnimation } from '@trezor/components';
import { DeviceModelInternal } from '@trezor/connect';

export type RotateDeviceImageProps = {
Expand All @@ -13,12 +11,6 @@ export type RotateDeviceImageProps = {
animationWidth?: string;
};

// eslint-disable-next-line local-rules/no-override-ds-component
const StyledImage = styled(Image)`
/* do not apply the darkening filter in dark mode on device images */
filter: none;
`;

export const RotateDeviceImage = ({
deviceModel,
deviceColor,
Expand All @@ -30,32 +22,14 @@ export const RotateDeviceImage = ({
return null;
}

const isDeviceImageRotating =
deviceModel &&
[DeviceModelInternal.T2B1, DeviceModelInternal.T3B1, DeviceModelInternal.T3T1].includes(
deviceModel,
);

return (
<>
{isDeviceImageRotating ? (
<DeviceAnimation
className={className}
type="ROTATE"
deviceModelInternal={deviceModel}
deviceUnitColor={deviceColor}
height={animationHeight}
width={animationWidth}
/>
) : (
<StyledImage
width={animationWidth}
height={animationHeight}
alt="Trezor"
image={`TREZOR_${deviceModel}`}
className={className}
/>
)}
</>
<DeviceAnimation
className={className}
type="ROTATE"
deviceModelInternal={deviceModel}
deviceUnitColor={deviceColor}
height={animationHeight}
width={animationWidth}
/>
);
};
Binary file modified packages/suite-data/files/images/png/trezor-t1b1-large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/suite-data/files/images/png/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/suite-data/files/images/png/trezor-t1b1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/suite-data/files/images/png/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/suite-data/files/images/png/trezor-t2t1-large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/suite-data/files/images/png/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/suite-data/files/images/png/trezor-t2t1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/suite-data/files/images/png/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/suite-data/files/images/png/trezor-t3b1-large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/suite-data/files/images/png/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/suite-data/files/images/png/trezor-t3b1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/suite-data/files/images/png/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/suite-data/files/images/png/trezor-t3t1-large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/suite-data/files/images/png/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/suite-data/files/images/png/trezor-t3t1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/suite-data/files/images/png/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ const Top = () => {
<LargeDeviceImageContainer>
<LargeDeviceImage
alt="Trezor"
image={`TREZOR_${selectedDeviceModelInternal}`}
image={`TREZOR_${selectedDeviceModelInternal}_LARGE`}
/>
</LargeDeviceImageContainer>
</ElevationContext>
Expand Down

0 comments on commit 7704090

Please sign in to comment.