@@ -2,7 +2,7 @@ import React from 'react';
22import { useTranslation } from 'react-i18next' ;
33import { useNavigate , useParams } from 'react-router-dom' ;
44
5- import { Box , Button , ColumnLayout , Container , Header , Link , Loader , Popover , SpaceBetween , StatusIndicator } from 'components' ;
5+ import { Box , Button , ColumnLayout , Header , Link , Loader , Popover , SpaceBetween , StatusIndicator } from 'components' ;
66import { PermissionGuard } from 'components/PermissionGuard' ;
77
88import { useAppSelector , useBreadcrumbs , usePermissionGuard } from 'hooks' ;
@@ -52,63 +52,59 @@ export const Settings: React.FC = () => {
5252
5353 return (
5454 < div >
55- < Container
56- header = {
57- < Header
58- variant = "h2"
59- actions = {
60- < Button onClick = { editUserHandler } disabled = { isDisabledUserEditing ( ) } >
61- { t ( 'common.edit' ) }
62- </ Button >
63- }
64- >
65- { t ( 'users.account_settings' ) }
66- </ Header >
55+ < Header
56+ variant = "h2"
57+ actions = {
58+ < Button onClick = { editUserHandler } disabled = { isDisabledUserEditing ( ) } >
59+ { t ( 'common.edit' ) }
60+ </ Button >
6761 }
6862 >
69- { isLoading && < Loader /> }
63+ { t ( 'users.account_settings' ) }
64+ </ Header >
7065
71- { data && (
72- < ColumnLayout columns = { 2 } variant = "text-grid" >
73- < SpaceBetween size = "l" >
74- { /*<div>*/ }
75- { /* <Box variant="awsui-key-label">{t('users.user_name')}</Box>*/ }
76- { /* <div>{data.user_name}</div>*/ }
77- { /*</div>*/ }
66+ { isLoading && < Loader /> }
7867
79- < div >
80- < Box variant = "awsui-key-label" > { t ( 'users.email' ) } </ Box >
81- < div > { data . email ? < Link href = { `mailto:${ data . email } ` } > { data . email } </ Link > : '-' } </ div >
82- </ div >
68+ { data && (
69+ < ColumnLayout columns = { 2 } variant = "text-grid" >
70+ < SpaceBetween size = "l" >
71+ { /*<div>*/ }
72+ { /* <Box variant="awsui-key-label">{t('users.user_name')}</Box>*/ }
73+ { /* <div>{data.user_name}</div>*/ }
74+ { /*</div>*/ }
8375
84- < PermissionGuard allowedGlobalRoles = { [ GlobalUserRole . ADMIN ] } >
85- < div >
86- < Box variant = "awsui-key-label" > { t ( 'users.global_role' ) } </ Box >
87- < div > { t ( `roles.${ data . global_role } ` ) } </ div >
88- </ div >
89- </ PermissionGuard >
76+ < div >
77+ < Box variant = "awsui-key-label" > { t ( 'users.email' ) } </ Box >
78+ < div > { data . email ? < Link href = { `mailto:${ data . email } ` } > { data . email } </ Link > : '-' } </ div >
79+ </ div >
9080
81+ < PermissionGuard allowedGlobalRoles = { [ GlobalUserRole . ADMIN ] } >
9182 < div >
92- < Box variant = "awsui-key-label" > { t ( 'users.token' ) } </ Box >
93-
94- < div className = { styles . token } >
95- < Popover
96- dismissButton = { false }
97- position = "top"
98- size = "small"
99- triggerType = "custom"
100- content = { < StatusIndicator type = "success" > { t ( 'users.token_copied' ) } </ StatusIndicator > }
101- >
102- < Button formAction = "none" iconName = "copy" variant = "link" onClick = { onCopyToken } />
103- </ Popover >
104-
105- < div > { data . creds . token } </ div >
106- </ div >
83+ < Box variant = "awsui-key-label" > { t ( 'users.global_role' ) } </ Box >
84+ < div > { t ( `roles.${ data . global_role } ` ) } </ div >
85+ </ div >
86+ </ PermissionGuard >
87+
88+ < div >
89+ < Box variant = "awsui-key-label" > { t ( 'users.token' ) } </ Box >
90+
91+ < div className = { styles . token } >
92+ < Popover
93+ dismissButton = { false }
94+ position = "top"
95+ size = "small"
96+ triggerType = "custom"
97+ content = { < StatusIndicator type = "success" > { t ( 'users.token_copied' ) } </ StatusIndicator > }
98+ >
99+ < Button formAction = "none" iconName = "copy" variant = "link" onClick = { onCopyToken } />
100+ </ Popover >
101+
102+ < div > { data . creds . token } </ div >
107103 </ div >
108- </ SpaceBetween >
109- </ ColumnLayout >
110- ) }
111- </ Container >
104+ </ div >
105+ </ SpaceBetween >
106+ </ ColumnLayout >
107+ ) }
112108 </ div >
113109 ) ;
114110} ;
0 commit comments