-
Notifications
You must be signed in to change notification settings - Fork 975
Refactor table.sortableTable #10265
Refactor table.sortableTable #10265
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,7 +56,7 @@ class ExtensionsTab extends ImmutableComponent { | |
|
||
return [ | ||
{ // Icon | ||
html: <img className={css(styles.table__row__column__icon)} src={this.getIcon(extension)} /> | ||
html: <img className={css(styles.tableRow__column__icon)} src={this.getIcon(extension)} /> | ||
}, | ||
{ // Name | ||
html: <span data-extension-id={extension.get('id')} | ||
|
@@ -91,12 +91,12 @@ class ExtensionsTab extends ImmutableComponent { | |
|
||
get columnClassNames () { | ||
return [ | ||
css(styles.table__row__column, styles.table__row__column_center), | ||
css(styles.table__row__column), | ||
css(styles.table__row__column), | ||
css(styles.table__row__column), | ||
css(styles.table__row__column, styles.table__row__column_center) | ||
// css(styles.table__row__column, styles.table__row__column_center) | ||
css(styles.tableRow__column, styles.tableRow__column_center), | ||
css(styles.tableRow__column), | ||
css(styles.tableRow__column), | ||
css(styles.tableRow__column), | ||
css(styles.tableRow__column, styles.tableRow__column_center) | ||
// css(styles.tableRow__column, styles.tableRow__column_center) | ||
] | ||
} | ||
|
||
|
@@ -107,12 +107,12 @@ class ExtensionsTab extends ImmutableComponent { | |
return <section> | ||
<DefaultSectionTitle data-l10n-id='extensions' /> | ||
<SortableTable | ||
fillAvailable | ||
sortingDisabled | ||
tableClassNames={css(styles.table)} | ||
headings={['icon', 'name', 'description', 'version', 'enabled'] /* 'exclude' */} | ||
columnClassNames={this.columnClassNames} | ||
rowClassNames={ | ||
this.props.extensions.map(entry => css(styles.table__row)).toJS() | ||
this.props.extensions.map(entry => css(styles.tableRow)).toJS() | ||
} | ||
rows={this.props.extensions.map(entry => this.getRow(entry))} /> | ||
<footer className={css(styles.moreInfo)}> | ||
|
@@ -129,13 +129,7 @@ class ExtensionsTab extends ImmutableComponent { | |
} | ||
|
||
const styles = StyleSheet.create({ | ||
table: { | ||
// TODO (Suguru): refactor sortableTable.js to remove !important | ||
width: '100% !important', | ||
marginBottom: '0 !important' | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The table as such does not require margin in the same way as the buttons do not. If margin is required, it should be specified as an option; otherwise the margin should be added to the other element which exists around the table. |
||
|
||
table__row: { | ||
tableRow: { | ||
fontSize: '15px', | ||
background: '#fff', | ||
|
||
|
@@ -151,15 +145,15 @@ const styles = StyleSheet.create({ | |
} | ||
}, | ||
|
||
table__row__column: { | ||
tableRow__column: { | ||
padding: '0 8px' | ||
}, | ||
|
||
table__row__column_center: { | ||
tableRow__column_center: { | ||
textAlign: 'center' | ||
}, | ||
|
||
table__row__column__icon: { | ||
tableRow__column__icon: { | ||
display: 'flex', | ||
margin: 'auto', | ||
width: '32px', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -273,7 +273,7 @@ class LedgerTable extends ImmutableComponent { | |
</div> | ||
</div> | ||
<SortableTable | ||
tableClassNames={css(styles.tableClass)} | ||
fillAvailable | ||
headings={['', 'publisher', 'include', 'views', 'timeSpent', 'percentage', 'actions']} | ||
defaultHeading='percentage' | ||
defaultHeadingSortOrder='desc' | ||
|
@@ -339,13 +339,6 @@ const styles = StyleSheet.create({ | |
} | ||
}, | ||
|
||
tableClass: { | ||
width: '100%', | ||
borderCollapse: 'collapse', | ||
border: 'none', | ||
margin: '0 auto' | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
tableTh: { | ||
color: paymentStylesVariables.tableHeader.fontColor, | ||
fontSize: '14px', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -159,8 +159,8 @@ class SyncTab extends ImmutableComponent { | |
defaultHeading='syncDeviceLastActive' | ||
defaultHeadingSortOrder='desc' | ||
rows={this.devicesTableRows} | ||
customCellClasses={css(styles.devices__devicesListCell)} | ||
tableClassNames={css(styles.devices__devicesList)} | ||
customCellClasses={css(styles.devices__devicesListCell)} | ||
/> | ||
</section> | ||
} | ||
|
@@ -590,10 +590,8 @@ const styles = StyleSheet.create({ | |
}, | ||
|
||
devices__devicesList: { | ||
// TODO: refactor sortableTable to remove !important | ||
marginBottom: `${globalStyles.spacing.dialogInsideMargin} !important`, | ||
boxSizing: 'border-box', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
width: '600px !important' | ||
marginBottom: globalStyles.spacing.dialogInsideMargin, | ||
width: '600px' | ||
}, | ||
devices__devicesListCell: { | ||
padding: '4px 8px' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -247,8 +247,6 @@ input[type="checkbox"][disabled] { | |
} | ||
|
||
table.sortableTable { | ||
width: 704px; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
tbody td:first-of-type { | ||
text-align: center; | ||
color: @braveOrange; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,11 +15,6 @@ table.sort { | |
} | ||
|
||
table.sortableTable { | ||
width: 100%; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is replaced with https://github.com/brave/browser-laptop/pull/10265/files#diff-159ff36704e059402c3f17fb8a35a6fcR489. The width is no longer specified by default (since it had to be overwritten with |
||
margin-bottom: 40px; | ||
cursor: default; | ||
border-spacing: 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the 3 properties above were replaced with https://github.com/brave/browser-laptop/pull/10265/files#diff-159ff36704e059402c3f17fb8a35a6fcR481. |
||
|
||
tr { | ||
height: 1.7em; | ||
padding: 5px 20px; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overrideDefaultStyle
is not used anywhere, so replaced it withtrue
. To override the default style, instead you could usetableClassNames={css(styles.foo)}
.The class
sortableTable
is used heavily for automated tests so it is not removed yet.