Skip to content

Commit 78b0eb2

Browse files
authored
refactor(accounts): use sortedTable for history (@fehmer) (monkeytypegame#6747)
replace sortable table on accounts page with `SortedTable`
1 parent 1cf316a commit 78b0eb2

File tree

3 files changed

+143
-241
lines changed

3 files changed

+143
-241
lines changed

frontend/src/html/pages/account.html

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -685,10 +685,19 @@
685685
<thead>
686686
<tr>
687687
<td></td>
688-
<td type="button" class="sortable history-wpm-header">wpm</td>
689-
<td type="button" class="sortable history-raw-header">raw</td>
690-
<td type="button" class="sortable history-acc-header">accuracy</td>
691-
<td type="button" class="sortable history-consistency-header">
688+
<td data-sort-property="wpm" data-sort-default-direction="desc">
689+
wpm
690+
</td>
691+
<td data-sort-property="rawWpm" data-sort-default-direction="desc">
692+
raw
693+
</td>
694+
<td data-sort-property="acc" data-sort-default-direction="desc">
695+
accuracy
696+
</td>
697+
<td
698+
data-sort-property="consistency"
699+
data-sort-default-direction="desc"
700+
>
692701
consistency
693702
</td>
694703
<td
@@ -701,9 +710,11 @@
701710
<!-- <td>punctuation</td> -->
702711
<td>info</td>
703712
<td>tags</td>
704-
<td type="button" class="sortable history-date-header">
713+
<td
714+
data-sort-property="timestamp"
715+
data-sort-default-direction="desc"
716+
>
705717
date
706-
<i class="fas fa-sort-down" aria-hidden="true"></i>
707718
</td>
708719
</tr>
709720
</thead>

frontend/src/styles/account.scss

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -440,18 +440,6 @@
440440
}
441441
}
442442
}
443-
444-
.headerSorted {
445-
font-weight: bold;
446-
}
447-
448-
.sortable:hover {
449-
cursor: pointer;
450-
-webkit-user-select: none;
451-
user-select: none;
452-
background-color: var(--sub-alt-color);
453-
}
454-
455443
.testActivity {
456444
// width: max-content;
457445
// justify-self: center;

0 commit comments

Comments
 (0)