Skip to content

Commit d193c7c

Browse files
committed
icon fixes
1 parent 761f468 commit d193c7c

File tree

6 files changed

+13
-17
lines changed

6 files changed

+13
-17
lines changed

src/client/components/immutable-list/immutable-list.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@
2323
top: 5px;
2424
bottom: 5px;
2525
left: 24px;
26-
right: 0;
26+
width: 400px;
2727

2828
.list-title {
2929
display: flex;
3030
height: $list-title-height;
3131
padding-top: 12px;
32-
width: 400px;
3332
border-bottom: 1px solid $border-super-light;
3433

3534
.label {
@@ -63,7 +62,7 @@
6362
.empty-container {
6463
position: absolute;
6564
top: 50%;
66-
left: 10%;
65+
left: 50%;
6766
transform: translate(-50%, -50%);
6867
text-align: center;
6968
color: $text-light;

src/client/components/simple-list/simple-list.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,24 +99,21 @@ export class SimpleList extends React.Component<SimpleListProps, SimpleListState
9999
const { onEdit, onRemove, onReorder } = this.props;
100100
const { draggedItem, dropIndex } = this.state;
101101

102-
const svgize = (iconName: string) => iconName ? <SvgIcon svg={require(`../../icons/${iconName}.svg`)}/> : null;
103-
104102
return rows.map((row, i) => {
105103
let {title, description, icon} = row;
106104

107105
let dragHandle = <div className="drag-handle">
108106
<SvgIcon svg={require('../../icons/dragger.svg')}/>
109107
</div>;
110108

111-
let svg = svgize(icon);
112109
let text = <div className="text">
113110
<div className="title">{title}</div>
114111
<div className="description">{description}</div>
115112
</div>;
116113

117114
let actions = <div className="actions">
118-
<button onClick={onEdit.bind(this, i)}>{svgize('full-edit')}</button>
119-
<button onClick={onRemove.bind(this, i)}>{svgize('full-remove')}</button>
115+
<button onClick={onEdit.bind(this, i)}><SvgIcon svg={require(`../../icons/full-edit.svg`)}/></button>
116+
<button onClick={onRemove.bind(this, i)}><SvgIcon svg={require(`../../icons/full-remove.svg`)}/></button>
120117
</div>;
121118

122119
const isBeingDragged = draggedItem === row;
@@ -141,7 +138,7 @@ export class SimpleList extends React.Component<SimpleListProps, SimpleListState
141138
onDragStart={this.dragStart.bind(this, row)}
142139
>
143140
{onReorder ? dragHandle : null}
144-
{svg}
141+
{icon ? <SvgIcon svg={icon}/> : null}
145142
{text}
146143
{actions}
147144
</div>;

src/client/components/simple-table/simple-table.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export class SimpleTable extends React.Component<SimpleTableProps, SimpleTableSt
120120
className='cell action'
121121
key={`action-${i}`}
122122
onClick={action.callback.bind(this, row)}
123-
><SvgIcon svg={require(`../../icons/${action.icon}.svg`)}/></div>);
123+
><SvgIcon svg={action.icon}/></div>);
124124
}
125125

126126
return items;
@@ -240,7 +240,7 @@ export class SimpleTable extends React.Component<SimpleTableProps, SimpleTableSt
240240
key={`icon-${j}`}
241241
style={{width: ACTION_WIDTH}}
242242
>
243-
<SvgIcon svg={require(`../../icons/${action.icon}.svg`)}/>
243+
<SvgIcon svg={action.icon}/>
244244
</div>;
245245
});
246246

src/client/views/settings-view/clusters/clusters.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ export class Clusters extends React.Component<ClustersProps, ClustersState> {
109109
];
110110

111111
const actions: SimpleTableAction[] = [
112-
{icon: 'full-edit', callback: this.editCluster.bind(this)},
113-
{icon: 'full-remove', callback: this.removeCluster.bind(this)}
112+
{icon: require(`../../../icons/full-edit.svg`), callback: this.editCluster.bind(this)},
113+
{icon: require(`../../../icons/full-remove.svg`), callback: this.removeCluster.bind(this)}
114114
];
115115

116116
return <div className="clusters">

src/client/views/settings-view/data-cube-edit/data-cube-edit.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ export class DataCubeEdit extends React.Component<DataCubeEditProps, DataCubeEdi
254254
return {
255255
title: dimension.title,
256256
description: dimension.expression.toString(),
257-
icon: `dim-${dimension.kind}`
257+
icon: require(`../../../icons/dim-${dimension.kind}`)
258258
};
259259
});
260260

@@ -325,7 +325,7 @@ export class DataCubeEdit extends React.Component<DataCubeEditProps, DataCubeEdi
325325
return {
326326
title: measure.title,
327327
description: measure.expression.toString(),
328-
icon: `measure`
328+
icon: require(`../../icons/measures.svg`)
329329
};
330330
});
331331

src/client/views/settings-view/data-cubes/data-cubes.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ export class DataCubes extends React.Component<DataCubesProps, DataCubesState> {
110110
];
111111

112112
const actions: SimpleTableAction[] = [
113-
{icon: 'full-edit', callback: this.editCube.bind(this)},
114-
{icon: 'full-remove', callback: this.removeCube.bind(this)}
113+
{icon: require(`../../../icons/full-edit.svg`), callback: this.editCube.bind(this)},
114+
{icon: require(`../../../icons/full-remove.svg`), callback: this.removeCube.bind(this)}
115115
];
116116

117117
return <div className="data-cubes">

0 commit comments

Comments
 (0)