Device manager - data fetching (PSG-637) (#9151)

* add session manager tab to user settings

* fussy import ordering

* i18n

* extract device fetching logic into hook

* use new extended device type in device tile, add verified metadata

* add current session section, test

* tidy

* update types for DeviceWithVerification
This commit is contained in:
Kerry 2022-08-10 18:14:59 +02:00 committed by GitHub
parent 4e30d3c0fc
commit b7872f2ff7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 434 additions and 13 deletions

View file

@ -17,16 +17,26 @@ limitations under the License.
import React from 'react';
import { _t } from "../../../../../languageHandler";
import Spinner from '../../../elements/Spinner';
import { useOwnDevices } from '../../devices/useOwnDevices';
import DeviceTile from '../../devices/DeviceTile';
import SettingsSubsection from '../../shared/SettingsSubsection';
import SettingsTab from '../SettingsTab';
const SessionManagerTab: React.FC = () => {
const { devices, currentDeviceId, isLoading } = useOwnDevices();
const currentDevice = devices[currentDeviceId];
return <SettingsTab heading={_t('Sessions')}>
<SettingsSubsection
heading={_t('Current session')}
// TODO session content coming here
// in next PR
/>
data-testid='current-session-section'
>
{ isLoading && <Spinner /> }
{ !!currentDevice && <DeviceTile
device={currentDevice}
/> }
</SettingsSubsection>
</SettingsTab>;
};