@@ -4,14 +4,88 @@ import { connect } from 'react-redux';
4
4
import { Link } from 'react-router-dom' ;
5
5
import { bindActionCreators } from 'redux' ;
6
6
import { withTranslation } from 'react-i18next' ;
7
+ import styled from 'styled-components' ;
7
8
import MenuItem from '../../../../components/Dropdown/MenuItem' ;
8
9
import TableDropdown from '../../../../components/Dropdown/TableDropdown' ;
9
10
import * as ProjectActions from '../../actions/project' ;
10
11
import * as CollectionsActions from '../../actions/collections' ;
11
12
import * as IdeActions from '../../actions/ide' ;
12
13
import * as ToastActions from '../../actions/toast' ;
13
14
import dates from '../../../../utils/formatDate' ;
15
+ import { remSize , prop } from '../../../../theme' ;
14
16
17
+ const SketchsTableRow = styled . tr `
18
+ &&& {
19
+ margin: ${ remSize ( 10 ) } ;
20
+ height: ${ remSize ( 72 ) } ;
21
+ font-size: ${ remSize ( 16 ) } ;
22
+ }
23
+ &:nth-child(odd) {
24
+ background: ${ prop ( 'tableRowStripeColor' ) } ;
25
+ }
26
+
27
+ > th:nth-child(1) {
28
+ padding-left: ${ remSize ( 12 ) } ;
29
+ }
30
+
31
+ > td {
32
+ padding-left: ${ remSize ( 8 ) } ;
33
+ }
34
+
35
+ a {
36
+ color: ${ prop ( 'primaryTextColor' ) } ;
37
+ }
38
+
39
+ &.is-deleted > * {
40
+ font-style: italic;
41
+ }
42
+ @media (max-width: 770px) {
43
+ &&& {
44
+ margin: 0;
45
+ position: relative;
46
+ display: flex;
47
+ flex-wrap: wrap;
48
+ padding: ${ remSize ( 15 ) } ;
49
+ height: fit-content;
50
+ gap: ${ remSize ( 8 ) } ;
51
+ border: 1px solid ${ prop ( 'modalBorderColor' ) } ;
52
+ background-color: ${ prop ( 'searchBackgroundColor' ) } ;
53
+ > th {
54
+ padding-left: 0;
55
+ width: 100%;
56
+ font-weight: bold;
57
+ margin-bottom: ${ remSize ( 6 ) } ;
58
+ }
59
+ > td {
60
+ padding-left: 0;
61
+ width: 30%;
62
+ font-size: ${ remSize ( 14 ) } ;
63
+ color: ${ prop ( 'modalBorderColor' ) } ;
64
+ }
65
+ }
66
+ }
67
+ ` ;
68
+ const SketchesTableName = styled . span `
69
+ &&& {
70
+ display: flex;
71
+ align-items: center;
72
+ }
73
+ ` ;
74
+ const SketchlistDropdownColumn = styled . td `
75
+ &&& {
76
+ position: relative;
77
+ width: ${ remSize ( 60 ) } ;
78
+ }
79
+ @media (max-width: 770px) {
80
+ &&& {
81
+ position: absolute;
82
+ top: 0;
83
+ right: ${ remSize ( 4 ) } ;
84
+ width: auto !important;
85
+ margin: ${ remSize ( 8 ) } ;
86
+ }
87
+ }
88
+ ` ;
15
89
const formatDateCell = ( date , mobile = false ) =>
16
90
dates . format ( date , { showTime : ! mobile } ) ;
17
91
@@ -126,18 +200,18 @@ const CollectionListRowBase = (props) => {
126
200
const { collection, mobile } = props ;
127
201
128
202
return (
129
- < tr className = "sketches-table__row" key = { collection . id } >
203
+ < SketchsTableRow key = { collection . id } >
130
204
< th scope = "row" >
131
- < span className = "sketches-table__name" > { renderCollectionName ( ) } </ span >
205
+ < SketchesTableName > { renderCollectionName ( ) } </ SketchesTableName >
132
206
</ th >
133
207
< td > { formatDateCell ( collection . createdAt , mobile ) } </ td >
134
208
< td > { formatDateCell ( collection . updatedAt , mobile ) } </ td >
135
209
< td >
136
210
{ mobile && 'sketches: ' }
137
211
{ ( collection . items || [ ] ) . length }
138
212
</ td >
139
- < td className = "sketch-list__dropdown-column" > { renderActions ( ) } </ td >
140
- </ tr >
213
+ < SketchlistDropdownColumn > { renderActions ( ) } </ SketchlistDropdownColumn >
214
+ </ SketchsTableRow >
141
215
) ;
142
216
} ;
143
217
0 commit comments