@@ -15,25 +15,19 @@ import {
15
15
} from 'material-ui/styles' ;
16
16
import Button from 'material-ui/Button' ;
17
17
import Grid from 'material-ui/Grid' ;
18
- import Paper from 'material-ui/Paper' ;
19
- import Table from 'material-ui/Table' ;
20
- import TableBody from 'material-ui/Table/TableBody' ;
21
- import TableCell from 'material-ui/Table/TableCell' ;
22
- import TableHead from 'material-ui/Table/TableHead' ;
23
- import TableRow from 'material-ui/Table/TableRow' ;
24
18
19
+ import LinodesListView from './LinodesListView' ;
25
20
import ViewList from 'material-ui-icons/ViewList' ;
26
21
import ViewModule from 'material-ui-icons/ViewModule' ;
27
22
28
23
import WithDocumentation from 'src/components/WithDocumentation' ;
29
24
import LinodeCard from './LinodeCard' ;
30
- import LinodeRow from './LinodeRow' ;
31
25
import ListLinodesEmptyState from './ListLinodesEmptyState' ;
32
26
33
27
import './linodes.css' ;
34
28
35
- type CSSClasses =
36
- 'toggleBox'
29
+ type CSSClasses =
30
+ 'toggleBox'
37
31
| 'toggleButton'
38
32
| 'toggleButtonActive'
39
33
| 'toggleButtonLeft'
@@ -112,46 +106,14 @@ class ListLinodes extends React.Component<CombinedProps> {
112
106
history . push ( `#${ style } ` ) ;
113
107
}
114
108
115
- linodeList ( ) {
116
- const { linodes, images, types } = this . props ;
117
109
118
- return (
119
- < Paper elevation = { 1 } >
120
- < Grid container >
121
- < Grid item xs = { 12 } >
122
- < Table >
123
- < TableHead >
124
- < TableRow >
125
- < TableCell > Label</ TableCell >
126
- < TableCell > Tags</ TableCell >
127
- < TableCell > IP Addresses</ TableCell >
128
- < TableCell > Region</ TableCell >
129
- < TableCell > </ TableCell >
130
- </ TableRow >
131
- </ TableHead >
132
- < TableBody >
133
- { linodes . map ( linode =>
134
- < LinodeRow
135
- key = { linode . id }
136
- linode = { linode }
137
- image = { images . find ( image => linode . image === image . id ) }
138
- type = { types . find ( type => linode . type === type . id ) }
139
- /> ,
140
- ) }
141
- </ TableBody >
142
- </ Table >
143
- </ Grid >
144
- </ Grid >
145
- </ Paper >
146
- ) ;
147
- }
148
110
149
111
linodeGrid ( ) {
150
112
const { linodes, images, types } = this . props ;
151
113
152
114
return (
153
115
< Grid container >
154
- { linodes . map ( linode =>
116
+ { linodes . map ( linode =>
155
117
< LinodeCard
156
118
key = { linode . id }
157
119
linode = { linode }
@@ -165,7 +127,7 @@ class ListLinodes extends React.Component<CombinedProps> {
165
127
166
128
toggleBox ( ) {
167
129
const { classes, location : { hash } } = this . props ;
168
-
130
+
169
131
return (
170
132
< div className = { classes . toggleBox } >
171
133
< Button
@@ -176,7 +138,7 @@ class ListLinodes extends React.Component<CombinedProps> {
176
138
${ classes . toggleButtonLeft } `
177
139
}
178
140
>
179
- < ViewList className = { classes . icon } />
141
+ < ViewList className = { classes . icon } />
180
142
List
181
143
</ Button >
182
144
< Button
@@ -187,7 +149,7 @@ class ListLinodes extends React.Component<CombinedProps> {
187
149
${ classes . toggleButtonRight } `
188
150
}
189
151
>
190
- < ViewModule className = { classes . icon } />
152
+ < ViewModule className = { classes . icon } />
191
153
Grid
192
154
</ Button >
193
155
</ div >
@@ -202,7 +164,11 @@ class ListLinodes extends React.Component<CombinedProps> {
202
164
{ this . toggleBox ( ) }
203
165
{ hash === '#grid'
204
166
? this . linodeGrid ( )
205
- : this . linodeList ( )
167
+ : < LinodesListView
168
+ linodes = { this . props . linodes }
169
+ images = { this . props . images }
170
+ types = { this . props . types }
171
+ />
206
172
}
207
173
</ React . Fragment >
208
174
) ;
0 commit comments