Skip to content

Commit

Permalink
chore: more t3w1 preparation
Browse files Browse the repository at this point in the history
  • Loading branch information
komret committed Oct 31, 2024
1 parent 745db41 commit c9c99ec
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ export const mapTrezorModelToIcon: Record<DeviceModelInternal, IconName> = {
[DeviceModelInternal.T2B1]: 'trezorSafe3Filled',
[DeviceModelInternal.T3B1]: 'trezorSafe3Filled',
[DeviceModelInternal.T3T1]: 'trezorSafe5Filled',
[DeviceModelInternal.T3W1]: 'trezorSafe7Filled',
};
4 changes: 4 additions & 0 deletions packages/urls/tests/urls.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ const excluded = [
URLS.LTC_ADDRESS_INFO_URL,
// captcha, returning 403 in ci
URLS.TREZOR_FORUM_URL,
// TODO T3W1 - articles not live yet
URLS.HELP_CENTER_DRY_RUN_T3W1_URL,
URLS.HELP_CENTER_PACKAGING_T3W1_URL,
URLS.HELP_CENTER_FW_DOWNGRADE_T3W1_URL,
];

describe('Test that all external links are alive', () => {
Expand Down
3 changes: 3 additions & 0 deletions suite-common/icons-deprecated/assets/icons/trezorT3W1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions suite-common/icons-deprecated/src/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ export const icons = {
trezorT2T1: require('../assets/icons/trezorT2T1.svg'),
trezorT3B1: require('../assets/icons/trezorT3B1.svg'),
trezorT3T1: require('../assets/icons/trezorT3T1.svg'),
trezorT3W1: require('../assets/icons/trezorT3T1.svg'),
twitter: require('../assets/icons/twitter.svg'),
twoUsers: require('../assets/icons/twoUsers.svg'),
unlink: require('../assets/icons/unlink.svg'),
Expand Down
26 changes: 13 additions & 13 deletions suite-common/wallet-config/src/networksConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ export const networks = {
support: {
[DeviceModelInternal.T2T1]: '2.6.4',
[DeviceModelInternal.T2B1]: '2.6.4',
[DeviceModelInternal.T3B1]: '2.8.1',
[DeviceModelInternal.T3T1]: '2.7.1',
[DeviceModelInternal.T3W1]: '2.99.99',
[DeviceModelInternal.T3B1]: '2.0.0',
[DeviceModelInternal.T3T1]: '2.0.0',
[DeviceModelInternal.T3W1]: '2.0.0',
},
customBackends: ['solana'],
accountTypes: {
Expand Down Expand Up @@ -212,10 +212,10 @@ export const networks = {
},
support: {
[DeviceModelInternal.T2T1]: '2.4.3',
[DeviceModelInternal.T2B1]: '2.6.1',
[DeviceModelInternal.T3B1]: '2.8.1',
[DeviceModelInternal.T3T1]: '2.7.1',
[DeviceModelInternal.T3W1]: '2.99.99',
[DeviceModelInternal.T2B1]: '2.0.0',
[DeviceModelInternal.T3B1]: '2.0.0',
[DeviceModelInternal.T3T1]: '2.0.0',
[DeviceModelInternal.T3W1]: '2.0.0',
},
customBackends: ['blockfrost'],
accountTypes: {
Expand Down Expand Up @@ -598,9 +598,9 @@ export const networks = {
support: {
[DeviceModelInternal.T2T1]: '2.6.4',
[DeviceModelInternal.T2B1]: '2.6.4',
[DeviceModelInternal.T3B1]: '2.8.1',
[DeviceModelInternal.T3T1]: '2.7.1',
[DeviceModelInternal.T3W1]: '2.99.99',
[DeviceModelInternal.T3B1]: '2.0.0',
[DeviceModelInternal.T3T1]: '2.0.0',
[DeviceModelInternal.T3W1]: '2.0.0',
},
customBackends: ['solana'],
accountTypes: {},
Expand All @@ -625,9 +625,9 @@ export const networks = {
support: {
[DeviceModelInternal.T2T1]: '2.4.3',
[DeviceModelInternal.T2B1]: '2.6.1',
[DeviceModelInternal.T3B1]: '2.8.1',
[DeviceModelInternal.T3T1]: '2.7.1',
[DeviceModelInternal.T3W1]: '2.99.99',
[DeviceModelInternal.T3B1]: '2.0.0',
[DeviceModelInternal.T3T1]: '2.0.0',
[DeviceModelInternal.T3W1]: '2.0.0',
},
customBackends: ['blockfrost'],
accountTypes: {
Expand Down
8 changes: 4 additions & 4 deletions suite-native/device/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { DeviceModelInternal, VersionArray } from '@trezor/connect';
export const minimalSupportedFirmwareVersion = {
T1B1: [1, 12, 1] as VersionArray,
T2T1: [2, 6, 3] as VersionArray,
T2B1: [2, 6, 3] as VersionArray,
T3B1: [2, 8, 1] as VersionArray,
T3T1: [2, 7, 1] as VersionArray,
T3W1: [2, 99, 99] as VersionArray,
T2B1: [2, 0, 0] as VersionArray,
T3B1: [2, 0, 0] as VersionArray,
T3T1: [2, 0, 0] as VersionArray,
T3W1: [2, 0, 0] as VersionArray,
} as const satisfies Record<DeviceModelInternal, VersionArray>;

export const isFirmwareVersionSupported = (
Expand Down
1 change: 1 addition & 0 deletions suite-native/icons/src/DeviceModelIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const icons = {
T2B1: 'trezorSafe3',
T3B1: 'trezorSafe3',
T3T1: 'trezorSafe5',
T3W1: 'trezorSafe5', // TODO T3W1
} as const satisfies Record<DeviceModelInternal, IconName>;

export const deviceModelToIconName = (deviceModel: DeviceModelInternal) => icons[deviceModel];
Expand Down
18 changes: 9 additions & 9 deletions suite-native/receive/src/components/DevicePaginationButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ type DeviceScreenPaginationProps = {
onPress: () => void;
};

const T2B1_BUTTON_COLOR = '#2B2D2B';
const BUTTON_HEIGHT = 56;
const BUTTON_WIDTH = 296;
const T2B1_BUTTON_COLOR = '#2B2D2B';

const ICON_COLOR: CSSColor = DEVICE_TEXT_COLOR;

Expand All @@ -33,17 +33,17 @@ const safe3Styles = {
borderWidth: nativeBorders.widths.large,
} as const;

const touchscreenDeviceStyles = {
backgroundColor: T2B1_BUTTON_COLOR,
borderRadius: nativeBorders.radii.r8,
} as const;

const modelToStyles = {
[DeviceModelInternal.T2T1]: {
backgroundColor: T2B1_BUTTON_COLOR,
borderRadius: nativeBorders.radii.r8,
},
[DeviceModelInternal.T3T1]: {
backgroundColor: T2B1_BUTTON_COLOR,
borderRadius: nativeBorders.radii.r8,
},
[DeviceModelInternal.T2T1]: touchscreenDeviceStyles,
[DeviceModelInternal.T2B1]: safe3Styles,
[DeviceModelInternal.T3B1]: safe3Styles,
[DeviceModelInternal.T3T1]: touchscreenDeviceStyles,
[DeviceModelInternal.T3W1]: touchscreenDeviceStyles, // TODO T3W1
} as const satisfies Record<PaginationCompatibleDeviceModel, Readonly<NativeStyle>>;

const deviceButtonStyle = prepareNativeStyle<DeviceButtonStyleProps>(
Expand Down
25 changes: 10 additions & 15 deletions suite-native/receive/src/components/DeviceScreenContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ const safe3Styles = {
lineHeight: 25,
pagerOffset: 40,
};
const smallTouchscreenStyles = {
fontSource: require('../../../../packages/theme/fonts/RobotoMono-Regular.ttf'),
fontSize: 20,
lineWidth: 230,
lineHeight: 25,
pagerOffset: 60,
};

const deviceToContentStyles: Record<DeviceModelInternal, DeviceModelLayoutProps> = {
[DeviceModelInternal.T1B1]: {
Expand All @@ -49,27 +56,15 @@ const deviceToContentStyles: Record<DeviceModelInternal, DeviceModelLayoutProps>
lineHeight: 17,
pagerOffset: 0,
},
[DeviceModelInternal.T2T1]: {
fontSource: require('../../../../packages/theme/fonts/RobotoMono-Regular.ttf'),
fontSize: 20,
lineWidth: 230,
lineHeight: 25,
pagerOffset: 60,
},
[DeviceModelInternal.T3T1]: {
fontSource: require('../../../../packages/theme/fonts/RobotoMono-Regular.ttf'),
fontSize: 20,
lineWidth: 230,
lineHeight: 25,
pagerOffset: 60,
},
[DeviceModelInternal.T2T1]: smallTouchscreenStyles,
[DeviceModelInternal.T3T1]: smallTouchscreenStyles,
[DeviceModelInternal.T3W1]: {
fontSource: require('../../../../packages/theme/fonts/RobotoMono-Regular.ttf'),
fontSize: 20,
lineWidth: 230,
lineHeight: 25,
pagerOffset: 60,
},
}, // TODO T3W1
[DeviceModelInternal.T2B1]: safe3Styles,
[DeviceModelInternal.T3B1]: safe3Styles,
};
Expand Down
17 changes: 12 additions & 5 deletions suite-native/receive/src/components/DeviceScreenPagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,29 @@ const deviceModelToSvg: Record<PaginationCompatibleDeviceModel, PaginationModelM
paginatorPrefixY: 4,
paginatorSuffixX: 182.5,
paginatorSuffixY: 82,

pagerSvg1: require('../../assets/pager1T2T1.svg'),
pagerSvg2: require('../../assets/pager2T2T1.svg'),
pagerX: 260,
pagerY: 30,
paginationSvgWidth: 40,
paginationSvgHeight: 17.5,
},
[DeviceModelInternal.T3W1]: {
paginationPrefixSvg: require('../../assets/addressPaginationPrefixT3W1.svg'),
paginationSuffixSvg: require('../../assets/addressPaginationSuffixT3W1.svg'),
paginationPrefixSvg: require('../../assets/addressPaginationPrefixT2T1.svg'),
paginationSuffixSvg: require('../../assets/addressPaginationPrefixT2T1.svg'),
paginatorPrefixX: 0,
paginatorPrefixY: 4,
paginatorSuffixX: 182.5,
paginatorSuffixY: 82,

pagerSvg1: require('../../assets/pager1T3W1.svg'),
pagerSvg2: require('../../assets/pager2T3W1.svg'),
pagerSvg1: require('../../assets/pager1T2T1.svg'),
pagerSvg2: require('../../assets/pager1T2T1.svg'),
pagerX: 260,
pagerY: 30,
paginationSvgWidth: 40,
paginationSvgHeight: 17.5,
},
}, // TODO T3W1
[DeviceModelInternal.T2B1]: safe3Svg,
[DeviceModelInternal.T3B1]: safe3Svg,
};
Expand Down

0 comments on commit c9c99ec

Please sign in to comment.