diff --git a/src/pages/names/NamesPage.less b/src/pages/names/NamesPage.less new file mode 100644 index 0000000..c893245 --- /dev/null +++ b/src/pages/names/NamesPage.less @@ -0,0 +1,27 @@ +// Copyright (c) 2020-2021 Drew Lemmy +// This file is part of KristWeb 2 under GPL-3.0. +// Full details: https://github.com/tmpim/KristWeb2/blob/master/LICENSE.txt +@import (reference) "../../App.less"; + +.names-page { + // Highlight unpaid names + .ant-table .name-row-unpaid { + background: fade(@kw-primary, 15%); + + td.ant-table-cell { + border-bottom-color: fade(@kw-primary, 20%); + } + + .ant-table-cell.ant-table-column-sort { + background: fade(@kw-primary, 20%); + } + + &:hover td.ant-table-cell { + background: fade(@kw-primary, 20%); + + &.ant-table-cell.ant-table-column-sort { + background: fade(@kw-primary, 35%); + } + } + } +} diff --git a/src/pages/names/NamesPage.tsx b/src/pages/names/NamesPage.tsx index f18f9ce..788b39e 100644 --- a/src/pages/names/NamesPage.tsx +++ b/src/pages/names/NamesPage.tsx @@ -16,6 +16,8 @@ import { useWallets } from "../../krist/wallets/Wallet"; import { useBooleanSetting } from "../../utils/settings"; +import "./NamesPage.less"; + /** The type of name listing to search by. */ export enum ListingType { /** Names owned by the user's wallets */ diff --git a/src/pages/names/NamesTable.tsx b/src/pages/names/NamesTable.tsx index fe7a794..f84997a 100644 --- a/src/pages/names/NamesTable.tsx +++ b/src/pages/names/NamesTable.tsx @@ -2,7 +2,7 @@ // This file is part of KristWeb 2 under GPL-3.0. // Full details: https://github.com/tmpim/KristWeb2/blob/master/LICENSE.txt import React, { useState, useEffect, Dispatch, SetStateAction } from "react"; -import { Table } from "antd"; +import { Table, Tag } from "antd"; import { useTranslation } from "react-i18next"; @@ -66,6 +66,8 @@ onChange={handleLookupTableChange(setOptions)} pagination={getTablePaginationSettings(t, res, "names.tableTotal")} + rowClassName={name => name.unpaid > 0 ? "name-row-unpaid" : ""} + columns={[ // Name { @@ -125,8 +127,9 @@ title: t("names.columnUnpaid"), dataIndex: "unpaid", key: "unpaid", - // TODO: highlight this? - render: unpaid => unpaid && unpaid.toLocaleString(), + render: unpaid => unpaid > 0 + ? {unpaid.toLocaleString()} + : <>, width: 50, sorter: true