You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.4 KiB
51 lines
1.4 KiB
// @flow
|
|
|
|
import React, { Fragment } from 'react'
|
|
import { translate } from 'react-i18next'
|
|
|
|
import type { Node } from 'react'
|
|
import type { T } from 'types/common'
|
|
|
|
import AppsList from './AppsList'
|
|
// import DeviceInfos from './DeviceInfos'
|
|
import FirmwareUpdate from './FirmwareUpdate'
|
|
import EnsureDevice from './EnsureDevice'
|
|
import EnsureDashboard from './EnsureDashboard'
|
|
import EnsureGenuine from './EnsureGenuine'
|
|
|
|
type Props = {
|
|
t: T,
|
|
}
|
|
|
|
const ManagerPage = ({ t }: Props): Node => (
|
|
<Fragment>
|
|
<EnsureDevice>
|
|
{device => (
|
|
<EnsureDashboard device={device}>
|
|
{deviceInfo => (
|
|
<Fragment>
|
|
{deviceInfo.mcu && <span>bootloader mode</span>}
|
|
{deviceInfo.final && <span>osu mode</span>}
|
|
|
|
{!deviceInfo.mcu &&
|
|
!deviceInfo.final && (
|
|
<EnsureGenuine device={device} t={t}>
|
|
<FirmwareUpdate
|
|
infos={{
|
|
targetId: deviceInfo.targetId,
|
|
version: deviceInfo.version,
|
|
}}
|
|
device={device}
|
|
t={t}
|
|
/>
|
|
<AppsList device={device} />
|
|
</EnsureGenuine>
|
|
)}
|
|
</Fragment>
|
|
)}
|
|
</EnsureDashboard>
|
|
)}
|
|
</EnsureDevice>
|
|
</Fragment>
|
|
)
|
|
export default translate()(ManagerPage)
|
|
|