66
77import React , { useCallback , useEffect , useMemo , useState } from 'react' ;
88
9+ import styled from '@emotion/styled' ;
910import { Container , Divider , Link , Padding , Row , Text } from '@zextras/carbonio-design-system' ;
1011import { t , useUserSettings } from '@zextras/carbonio-shell-ui' ;
1112import { compact , orderBy } from 'lodash' ;
13+ import { Trans } from 'react-i18next' ;
1214
1315import { AuthOutline } from './assets/icons/auth-outline' ;
1416import { AppMobile } from './components/operations/app-mobile' ;
@@ -17,17 +19,20 @@ import { ExchangeActiveSync } from './components/operations/exchange-active-sync
1719import { OTPAuthentication } from './components/operations/otp-authentication' ;
1820import { RecoveryPassword } from './components/operations/recovery-password' ;
1921import { ResetPassword } from './components/operations/reset-password' ;
20- import { ColumnFull , ColumnLeft , ColumnRight , Shell } from './components/shared/shell' ;
2122import { SidebarNavigation } from './components/shared/sidebar-navigation' ;
2223import { checkSupportedZextras } from './network/checkSupportedZextras' ;
2324import { fetchSoap } from './network/fetchSoap' ;
2425import { Password , Tab } from './types' ;
2526
27+ const ColumnRight = styled ( Row ) `
28+ width: ${ ( { theme, width } ) : string => `calc(${ width } - ${ theme . sizes . padding . large } )` } ;
29+ ` ;
30+
2631function Instruction ( {
2732 instruction,
2833 link
2934} : Readonly < {
30- instruction : string ;
35+ instruction : React . ReactNode ;
3136 link ?: string ;
3237} > ) : React . JSX . Element {
3338 return (
@@ -74,8 +79,14 @@ function useAuthTabs(): {
7479 name : 'changepassword' ,
7580 label : t ( 'changePassword.title' , 'Change Password' ) ,
7681 view : ChangePassword ,
77- instruction : t ( 'instruction.changePassword' , 'Here you can change your password.' ) ,
78- link : 'https://docs.zextras.com/suite/html/auth.html#auth-change-pass'
82+ instruction : (
83+ < Trans
84+ t = { t }
85+ i18nKey = "instruction.changePassword"
86+ components = { { br : < br /> } }
87+ defaults = "Here you can change your password.<br>For more information, contact your administrator."
88+ />
89+ )
7990 } ;
8091
8192 const resetPasswordItem = {
@@ -140,15 +151,6 @@ function useAuthTabs(): {
140151 link : 'https://docs.zextras.com/suite/html/auth.html#create-new-credentials-mobile-apps'
141152 } ,
142153 otpAuthenticationItem
143- /* section is hidden cause not officially supported yet
144- ref: AUTH-543
145- {
146- name: 'desktop',
147- label: t('appDesktop.title', 'Desktop Apps'),
148- view: AppDesktop,
149- instruction: t('instruction.desktop', 'Here you can manage Desktop App password.'),
150- link: 'https://docs.zextras.com/suite/html/auth.html#create-new-credentials-mobile-apps'
151- }, */
152154 ] ) ;
153155
154156 return { links, linksWithoutZextras, otpAuthenticationItem } ;
@@ -250,34 +252,46 @@ export default function App(): React.JSX.Element {
250252 } , [ checkHasZextras ] ) ;
251253
252254 const occupyFull = useMemo ( ( ) => window . innerWidth <= 1800 , [ ] ) ;
255+
253256 return (
254- < Shell >
257+ < Container
258+ orientation = "horizontal"
259+ mainAlignment = "flex-start"
260+ crossAlignment = "flex-start"
261+ height = "100%"
262+ background = "gray5"
263+ padding = { { all : 'large' } }
264+ >
255265 < SideBar
256266 activeTab = { activeTab }
257267 setActiveTab = { setActiveTab }
258268 hasZextras = { hasZextras }
259269 links = { links }
260270 linksWithoutZextras = { linksWithoutZextras }
261271 />
262- < ColumnFull data-testid = "active-panel" mainAlignment = "space-between" takeAvailableSpace >
263- < ColumnLeft
272+ < Row
273+ width = "100%"
274+ height = "100%"
275+ data-testid = "active-panel"
276+ mainAlignment = "space-between"
277+ takeAvailableSpace
278+ >
279+ < Row
280+ height = "100%"
264281 width = { `${ occupyFull ? '100%' : 'calc(60% - 6.25rem)' } ` }
265282 mainAlignment = "flex-start"
266283 crossAlignment = "flex-start"
267284 >
268285 { activeTab && < ActiveTab activeTab = { activeTab } /> }
269- </ ColumnLeft >
286+ </ Row >
270287 { ! occupyFull && (
271- < ColumnRight width = "calc(40% + 6.25rem)" >
288+ < ColumnRight width = "calc(40% + 6.25rem)" height = "100%" >
272289 { activeTab ?. instruction && (
273- < Instruction
274- instruction = { activeTab && activeTab . instruction }
275- link = { activeTab && activeTab . link }
276- />
290+ < Instruction instruction = { activeTab ?. instruction } link = { activeTab ?. link } />
277291 ) }
278292 </ ColumnRight >
279293 ) }
280- </ ColumnFull >
281- </ Shell >
294+ </ Row >
295+ </ Container >
282296 ) ;
283297}
0 commit comments