Grab tool data from web server

This commit is contained in:
2018-02-03 01:48:49 -07:00
parent 976f764123
commit 3b5509000d
3 changed files with 120 additions and 74 deletions
+12 -4
View File
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
import { Breadcrumb, Button, Container, Dropdown, Header, Icon, Image, Item, Menu, Segment, Table, Input } from 'semantic-ui-react'
import { Breadcrumb, Button, Container, Dropdown, Header, Icon, Image, Item, Label, Menu, Segment, Table, Input } from 'semantic-ui-react'
import { Link } from 'react-router-dom';
class Tool extends Component {
@@ -16,6 +16,8 @@ class Tool extends Component {
x.id == match.params.id
);
const approved = user.authorizedTools.includes(tool.id);
return (
<div>
<Container>
@@ -28,14 +30,20 @@ class Tool extends Component {
</Breadcrumb>
<Segment>
<Image src={tool.photo} size='medium' centered />
<Image src={tool.photo} size='medium' centered rounded />
<Segment textAlign='center' basic>
<Button color='green'>
<p>Status: Off</p>
<div>
<Button color='green' disabled={!approved}>
<Icon name='lightning' /> Arm
</Button>
<Button color='red'>
<Button color='red' disabled={!approved}>
<Icon name='stop' /> Disarm
</Button>
</div>
{approved || <Label basic color='red' pointing>
Not authorized! Please take the xyz course.
</Label>}
</Segment>
<Table basic='very' unstackable>