Skip to content

Commit e9ad261

Browse files
committed
💄 omit creation date on sketch and collection list
1 parent 6e323fd commit e9ad261

File tree

6 files changed

+51
-17
lines changed

6 files changed

+51
-17
lines changed

client/modules/App/App.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ class App extends React.Component {
3434
render() {
3535
return (
3636
<div className="app">
37-
{this.state.isMounted && !window.devToolsExtension && getConfig('NODE_ENV') === 'development' && <DevTools />}
37+
<div style={{ display: 'none' }}>
38+
39+
{this.state.isMounted && !window.devToolsExtension && getConfig('NODE_ENV') === 'development' && <DevTools />}
40+
</div>
3841
{this.props.children}
3942
</div>
4043
);

client/modules/IDE/components/CollectionList/CollectionList.jsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ class CollectionList extends React.Component {
127127

128128
render() {
129129
const username = this.props.username !== undefined ? this.props.username : this.props.user.username;
130+
const { mobile } = this.props;
130131

131132
return (
132133
<article className="sketches-table-container">
@@ -141,15 +142,16 @@ class CollectionList extends React.Component {
141142
<thead>
142143
<tr>
143144
{this._renderFieldHeader('name', 'Name')}
144-
{this._renderFieldHeader('createdAt', 'Date Created')}
145-
{this._renderFieldHeader('updatedAt', 'Date Updated')}
145+
{(!mobile) && this._renderFieldHeader('createdAt', 'Date Created')}
146+
{(!mobile) && this._renderFieldHeader('updatedAt', 'Date Updated')}
146147
{this._renderFieldHeader('numItems', '# sketches')}
147148
<th scope="col"></th>
148149
</tr>
149150
</thead>
150151
<tbody>
151152
{this.props.collections.map(collection =>
152153
(<CollectionListRow
154+
mobile={mobile}
153155
key={collection.id}
154156
collection={collection}
155157
user={this.props.user}
@@ -209,7 +211,8 @@ CollectionList.propTypes = {
209211
owner: PropTypes.shape({
210212
id: PropTypes.string
211213
})
212-
})
214+
}),
215+
mobile: PropTypes.bool,
213216
};
214217

215218
CollectionList.defaultProps = {
@@ -218,7 +221,8 @@ CollectionList.defaultProps = {
218221
id: undefined,
219222
owner: undefined
220223
},
221-
username: undefined
224+
username: undefined,
225+
mobile: false
222226
};
223227

224228
function mapStateToProps(state, ownProps) {

client/modules/IDE/components/CollectionList/CollectionListRow.jsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ class CollectionListRowBase extends React.Component {
199199
}
200200

201201
render() {
202-
const { collection } = this.props;
202+
const { collection, mobile } = this.props;
203203

204204
return (
205205
<tr
@@ -211,8 +211,8 @@ class CollectionListRowBase extends React.Component {
211211
{this.renderCollectionName()}
212212
</span>
213213
</th>
214-
<td>{format(new Date(collection.createdAt), 'MMM D, YYYY')}</td>
215-
<td>{format(new Date(collection.updatedAt), 'MMM D, YYYY')}</td>
214+
{(!mobile) && <td>{format(new Date(collection.createdAt), 'MMM D, YYYY')}</td>}
215+
{(!mobile) && <td>{format(new Date(collection.updatedAt), 'MMM D, YYYY')}</td>}
216216
<td>{(collection.items || []).length}</td>
217217
<td className="sketch-list__dropdown-column">
218218
{this.renderActions()}
@@ -245,6 +245,11 @@ CollectionListRowBase.propTypes = {
245245
deleteCollection: PropTypes.func.isRequired,
246246
editCollection: PropTypes.func.isRequired,
247247
onAddSketches: PropTypes.func.isRequired,
248+
mobile: PropTypes.bool,
249+
};
250+
251+
CollectionListRowBase.defaultProps = {
252+
mobile: false,
248253
};
249254

250255
function mapDispatchToPropsSketchListRow(dispatch) {

client/modules/IDE/components/SketchList.jsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ class SketchListRowBase extends React.Component {
251251
const {
252252
sketch,
253253
username,
254+
mobile
254255
} = this.props;
255256
const { renameOpen, renameValue } = this.state;
256257
let url = `/${username}/sketches/${sketch.id}`;
@@ -287,7 +288,7 @@ class SketchListRowBase extends React.Component {
287288
<th scope="row">
288289
{name}
289290
</th>
290-
<td>{format(new Date(sketch.createdAt), 'MMM D, YYYY h:mm A')}</td>
291+
{(!mobile) && <td>{format(new Date(sketch.createdAt), 'MMM D, YYYY h:mm A')}</td>}
291292
<td>{format(new Date(sketch.updatedAt), 'MMM D, YYYY h:mm A')}</td>
292293
{this.renderDropdown()}
293294
</tr>
@@ -312,7 +313,12 @@ SketchListRowBase.propTypes = {
312313
cloneProject: PropTypes.func.isRequired,
313314
exportProjectAsZip: PropTypes.func.isRequired,
314315
changeProjectName: PropTypes.func.isRequired,
315-
onAddToCollection: PropTypes.func.isRequired
316+
onAddToCollection: PropTypes.func.isRequired,
317+
mobile: PropTypes.bool
318+
};
319+
320+
SketchListRowBase.defaultProps = {
321+
mobile: false
316322
};
317323

318324
function mapDispatchToPropsSketchListRow(dispatch) {
@@ -413,6 +419,7 @@ class SketchList extends React.Component {
413419

414420
render() {
415421
const username = this.props.username !== undefined ? this.props.username : this.props.user.username;
422+
const { mobile } = this.props;
416423
return (
417424
<article className="sketches-table-container">
418425
<Helmet>
@@ -425,14 +432,15 @@ class SketchList extends React.Component {
425432
<thead>
426433
<tr>
427434
{this._renderFieldHeader('name', 'Sketch')}
428-
{this._renderFieldHeader('createdAt', 'Date Created')}
435+
{(!mobile) && this._renderFieldHeader('createdAt', 'Date Created')}
429436
{this._renderFieldHeader('updatedAt', 'Date Updated')}
430437
<th scope="col"></th>
431438
</tr>
432439
</thead>
433440
<tbody>
434441
{this.props.sketches.map(sketch =>
435442
(<SketchListRow
443+
mobile={mobile}
436444
key={sketch.id}
437445
sketch={sketch}
438446
user={this.props.user}
@@ -482,10 +490,12 @@ SketchList.propTypes = {
482490
field: PropTypes.string.isRequired,
483491
direction: PropTypes.string.isRequired
484492
}).isRequired,
493+
mobile: PropTypes.bool,
485494
};
486495

487496
SketchList.defaultProps = {
488-
username: undefined
497+
username: undefined,
498+
mobile: false,
489499
};
490500

491501
function mapStateToProps(state) {

client/modules/Mobile/MobileDashboardView.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const getCreatePathname = (panel, username) => (CreatePathname[panel] || '#').re
7272

7373
const isOwner = (user, params) => user && params && user.username === params.username;
7474

75-
const renderPanel = (name, props) => (Component => (Component && <Component {...props} />))(Panels[name]);
75+
const renderPanel = (name, props) => (Component => (Component && <Component {...props} mobile />))(Panels[name]);
7676

7777
const MobileDashboard = ({ params, location }) => {
7878
const user = useSelector(state => state.user);

client/modules/Mobile/MobileViewContent.jsx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,34 @@ import { remSize } from '../../theme';
44

55

66
export default styled.div`
7+
/* Dashboard Styles */
78
z-index: 0;
89
margin-top: ${props => remSize(props.slimheader ? 50 : 68)};
910
10-
.sketch-list__sort-button { padding: 0 }
11+
12+
13+
/* Dashboard Styles */
14+
1115
1216
td {
1317
font-size: ${remSize(10)};
1418
min-width: ${remSize(72)};
1519
};
1620
tbody th {
17-
flex-direction: row;
1821
font-size: ${remSize(14)};
1922
/* font-weight: bold; */
20-
/* width: 100%; */
21-
max-width: ${remSize(140)};
23+
width: 100%;
24+
/* max-width: ${remSize(280)}; */
25+
2226
2327
};
28+
29+
.sketch-list__sort-button { padding: 0 }
30+
.sketches-table__row {
31+
height: ${remSize(48)};
32+
}
33+
34+
.sketches-table-container { padding-bottom: ${remSize(160)} }
35+
2436
td.sketch-list__dropdown-column { min-width: unset; }
2537
`;

0 commit comments

Comments
 (0)