1
- import { useEffect , useState } from 'react' ;
1
+ import { useEffect , useMemo , useState } from 'react' ;
2
2
3
3
import styled , { useTheme } from 'styled-components' ;
4
4
@@ -14,6 +14,7 @@ import {
14
14
TREZOR_URL ,
15
15
} from '@trezor/urls' ;
16
16
import { SUPPORTS_DEVICE_AUTHENTICITY_CHECK } from '@suite-common/suite-constants' ;
17
+ import { models } from '@trezor/connect/src/data/models' ;
17
18
18
19
import { goto } from 'src/actions/suite/routerActions' ;
19
20
import { useDispatch , useLayoutSize , useOnboarding , useSelector } from 'src/hooks/suite' ;
@@ -208,6 +209,14 @@ const SecurityCheckContent = ({
208
209
}
209
210
} , [ initialized , isRecoveryInProgress , updateAnalytics ] ) ;
210
211
212
+ const humanizedModelColor = useMemo (
213
+ ( ) =>
214
+ device ?. features ?. internal_model && device ?. features ?. unit_color
215
+ ? models [ device ?. features ?. internal_model ] ?. colors ?. [ device ?. features ?. unit_color ]
216
+ : null ,
217
+ [ device ] ,
218
+ ) ;
219
+
211
220
return isFailed ? (
212
221
< SecurityCheckFail
213
222
goBack = { toggleView }
@@ -222,7 +231,11 @@ const SecurityCheckContent = ({
222
231
< Text variant = "tertiary" >
223
232
< Translation id = "TR_YOU_HAVE_CONNECTED" />
224
233
</ Text >
225
- < DeviceName > { device ?. name } </ DeviceName >
234
+ < DeviceName >
235
+ { device ?. name }
236
+ { humanizedModelColor && < Text > { humanizedModelColor } </ Text > }
237
+ </ DeviceName >
238
+
226
239
< OnboardingButtonSkip onClick = { toggleView } >
227
240
< Translation id = "TR_CONNECTED_DIFFERENT_DEVICE" />
228
241
</ OnboardingButtonSkip >
0 commit comments