|
|
@ -14,7 +14,7 @@ import ManagerApp from './ManagerApp' |
|
|
|
|
|
|
|
const List = styled(Box).attrs({ |
|
|
|
horizontal: true, |
|
|
|
m: -2, |
|
|
|
m: -3, |
|
|
|
})` |
|
|
|
flex-wrap: wrap; |
|
|
|
` |
|
|
@ -35,6 +35,7 @@ type jobHandlerOptions = { |
|
|
|
|
|
|
|
type LedgerApp = { |
|
|
|
name: string, |
|
|
|
version: string, |
|
|
|
icon: string, |
|
|
|
app: Object, |
|
|
|
} |
|
|
@ -86,7 +87,9 @@ class AppsList extends PureComponent<Props, State> { |
|
|
|
this.setState({ status: 'busy' }) |
|
|
|
try { |
|
|
|
const { job, successResponse, errorResponse } = options |
|
|
|
const { device: { path: devicePath } } = this.props |
|
|
|
const { |
|
|
|
device: { path: devicePath }, |
|
|
|
} = this.props |
|
|
|
const data = { appParams, devicePath } |
|
|
|
await runJob({ channel: 'usb', job, successResponse, errorResponse, data }) |
|
|
|
this.setState({ status: 'success' }) |
|
|
@ -109,7 +112,7 @@ class AppsList extends PureComponent<Props, State> { |
|
|
|
|
|
|
|
handleCloseModal = () => this.setState({ status: 'idle' }) |
|
|
|
|
|
|
|
render() { |
|
|
|
renderList() { |
|
|
|
const { status, error } = this.state |
|
|
|
return ( |
|
|
|
<List> |
|
|
@ -117,6 +120,7 @@ class AppsList extends PureComponent<Props, State> { |
|
|
|
<ManagerApp |
|
|
|
key={c.name} |
|
|
|
name={c.name} |
|
|
|
version={`Version ${c.version}`} |
|
|
|
icon={ICONS_FALLBACK[c.icon] || c.icon} |
|
|
|
onInstall={this.handleInstall(c)} |
|
|
|
onUninstall={this.handleUninstall(c)} |
|
|
@ -146,6 +150,19 @@ class AppsList extends PureComponent<Props, State> { |
|
|
|
</List> |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
render() { |
|
|
|
return ( |
|
|
|
<Box flow={6}> |
|
|
|
<Box> |
|
|
|
<Box mb={4} color="dark" ff="Museo Sans" fontSize={6}> |
|
|
|
{'All apps'} |
|
|
|
</Box> |
|
|
|
{this.renderList()} |
|
|
|
</Box> |
|
|
|
</Box> |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
export default AppsList |
|
|
|