@@ -8,47 +8,32 @@ const renderContent = require('../lib/renderContent')
8
8
let Files = class extends React . Component {
9
9
render ( ) {
10
10
return (
11
- < Panel
12
- title = { this . props . title ? `"${ this . props . title } " Results` : 'Entries' }
13
- noPadding = { true }
14
- >
15
- < div style = { { overflow : 'auto' , height : this . props . height } } >
16
- < table className = "table" >
17
- < tbody >
18
- { this . props . files
19
- . filter ( x => x [ '.tag' ] === 'file' )
20
- . reverse ( )
21
- . map ( ( file , index ) => {
22
- var style = ''
23
- if ( file === this . props . selectedFile ) {
24
- style = 'cell-active'
11
+ < div style = { { overflow : 'auto' , height : this . props . height } } >
12
+ < div className = "list-group" >
13
+ { this . props . files
14
+ . filter ( x => x [ '.tag' ] === 'file' )
15
+ . reverse ( )
16
+ . map ( file => {
17
+ return (
18
+ < a
19
+ key = { file . name }
20
+ href = "javascript:void(0);"
21
+ onClick = { this . props . onClick . bind ( null , file ) }
22
+ className = {
23
+ file === this . props . selectedFile
24
+ ? 'list-group-item list-group-item-action active'
25
+ : 'list-group-item-action list-group-item '
25
26
}
26
-
27
- const cellStyle = { cursor : 'pointer' }
28
- if ( index === 0 ) cellStyle . borderTop = 0
29
- return (
30
- < tr key = { file . id } className = { style } >
31
- < td
32
- onClick = { this . props . onClick . bind ( null , file ) }
33
- style = { cellStyle }
34
- >
35
- < a
36
- href = "javascript:void(0);"
37
- onClick = { this . props . onClick . bind ( null , file ) }
38
- >
39
- < strong > { toDisplayName ( file . name ) } </ strong >
40
- < p className = "text-muted" style = { { marginBottom :0 } } >
41
- { prettyDate ( file . client_modified ) }
42
- </ p >
43
- </ a >
44
- </ td >
45
- </ tr >
46
- )
47
- } ) }
48
- </ tbody >
49
- </ table >
27
+ >
28
+ < h5 > { toDisplayName ( file . name ) } </ h5 >
29
+ < p style = { { marginBottom : 0 } } >
30
+ { prettyDate ( file . client_modified ) }
31
+ </ p >
32
+ </ a >
33
+ )
34
+ } ) }
50
35
</ div >
51
- </ Panel >
36
+ </ div >
52
37
)
53
38
}
54
39
}
@@ -63,20 +48,21 @@ const FilePreview = class extends React.Component {
63
48
}
64
49
render ( ) {
65
50
return (
66
- < Panel title = { toDisplayName ( this . props . file . name ) } noPadding = { true } >
67
- < div
68
- style = { {
69
- overflow : 'auto' ,
70
- height : this . props . height ,
71
- padding : '20px'
72
- } }
73
- >
74
- < If test = { this . props . loading } >
75
- < Loading />
76
- < div dangerouslySetInnerHTML = { this . createMarkup ( ) } />
77
- </ If >
78
- </ div >
79
- </ Panel >
51
+ < div
52
+ style = { {
53
+ overflow : 'auto' ,
54
+ height : this . props . height
55
+ } }
56
+ >
57
+ < If test = { this . props . loading } >
58
+ < Loading />
59
+ < div className = "list-group" >
60
+ < div className = "list-group-item" >
61
+ < div dangerouslySetInnerHTML = { this . createMarkup ( ) } />
62
+ </ div >
63
+ </ div >
64
+ </ If >
65
+ </ div >
80
66
)
81
67
}
82
68
}
@@ -111,34 +97,36 @@ module.exports = class extends React.Component {
111
97
}
112
98
113
99
render ( ) {
114
- var height = 'calc(100vh - 155px )'
100
+ var height = 'calc(100vh - 195px )'
115
101
if ( this . props . path ) {
116
- height = 'calc(100vh - 225px )'
102
+ height = 'calc(100vh - 240px )'
117
103
}
118
104
119
105
return (
120
106
< Page path = { this . props . path } >
121
- < div className = "row" >
122
- < div className = "col-md-3" >
123
- < Files
124
- height = { height }
125
- title = { this . props . searchTerm }
126
- files = { this . props . files }
127
- onClick = { this . onClick }
128
- selectedFile = { this . state . selectedFile }
129
- />
130
- </ div >
131
- < div className = "col-md-9" >
132
- < If test = { this . state . selectedFile } >
133
- < FilePreview
107
+ < Panel title = "Notes" >
108
+ < div className = "row" >
109
+ < div className = "col-md-3" >
110
+ < Files
134
111
height = { height }
135
- file = { this . state . selectedFile }
136
- loading = { this . state . loading }
137
- fileContent = { this . state . fileContent }
112
+ title = { this . props . searchTerm }
113
+ files = { this . props . files }
114
+ onClick = { this . onClick }
115
+ selectedFile = { this . state . selectedFile }
138
116
/>
139
- </ If >
117
+ </ div >
118
+ < div className = "col-md-9" >
119
+ < If test = { this . state . selectedFile } >
120
+ < FilePreview
121
+ height = { height }
122
+ file = { this . state . selectedFile }
123
+ loading = { this . state . loading }
124
+ fileContent = { this . state . fileContent }
125
+ />
126
+ </ If >
127
+ </ div >
140
128
</ div >
141
- </ div >
129
+ </ Panel >
142
130
</ Page >
143
131
)
144
132
}
@@ -149,7 +137,5 @@ function toDisplayName(value) {
149
137
}
150
138
151
139
function prettyDate ( value ) {
152
- const parts = value . split ( 'T' )
153
- const hourParts = parts [ 1 ] . split ( '.' ) [ 0 ] . split ( ':' )
154
- return `${ parts [ 0 ] } ${ hourParts [ 0 ] } :${ hourParts [ 1 ] } `
140
+ return new Date ( value ) . toLocaleString ( )
155
141
}
0 commit comments