diff --git a/src/global/AppRouter.tsx b/src/global/AppRouter.tsx index c97cb55..9271fbe 100644 --- a/src/global/AppRouter.tsx +++ b/src/global/AppRouter.tsx @@ -47,6 +47,8 @@ component: }, { path: "/network/names", name: "networkNames", component: }, + { path: "/network/names/new", name: "networkNamesNew", + component: }, { path: "/network/names/:name", name: "networkNames", component: }, { path: "/network/names/:name/history", name: "nameHistory", diff --git a/src/pages/dashboard/BlockValueCard.tsx b/src/pages/dashboard/BlockValueCard.tsx index d6c36f2..6abbc7a 100644 --- a/src/pages/dashboard/BlockValueCard.tsx +++ b/src/pages/dashboard/BlockValueCard.tsx @@ -38,7 +38,7 @@ Base value ()  +  - + {t("dashboard.blockValueBaseValueNames", { count: work.unpaid })} diff --git a/src/pages/names/NamesPage.tsx b/src/pages/names/NamesPage.tsx index dbeb9d0..f18f9ce 100644 --- a/src/pages/names/NamesPage.tsx +++ b/src/pages/names/NamesPage.tsx @@ -39,6 +39,7 @@ interface Props { listingType: ListingType; + sortNew?: boolean; } function getSiteTitle(t: TFunction, listingType: ListingType, address?: string): string { @@ -52,7 +53,7 @@ } } -export function NamesPage({ listingType }: Props): JSX.Element { +export function NamesPage({ listingType, sortNew }: Props): JSX.Element { const { t } = useTranslation(); const { address } = useParams(); @@ -83,10 +84,11 @@ const memoTable = useMemo(() => ( - ), [usedAddresses, usedRefreshID, setError]); + ), [usedAddresses, sortNew, usedRefreshID, setError]); const siteTitle = getSiteTitle(t, listingType, address); const subTitle = listingType === ListingType.NETWORK_ADDRESS diff --git a/src/pages/names/NamesTable.tsx b/src/pages/names/NamesTable.tsx index 0562a11..fe7a794 100644 --- a/src/pages/names/NamesTable.tsx +++ b/src/pages/names/NamesTable.tsx @@ -22,11 +22,14 @@ // Number used to trigger a refresh of the names listing refreshingID?: number; + // Whether or not to sort by newest first by default + sortNew?: boolean; + addresses?: string[]; setError?: Dispatch>; } -export function NamesTable({ refreshingID, addresses, setError }: Props): JSX.Element { +export function NamesTable({ refreshingID, sortNew, addresses, setError }: Props): JSX.Element { const { t } = useTranslation(); const [loading, setLoading] = useState(true); @@ -34,8 +37,8 @@ const [options, setOptions] = useState({ limit: 20, offset: 0, - orderBy: "name", - order: "ASC" + orderBy: sortNew ? "registered" : "name", + order: sortNew ? "DESC" : "ASC" }); // Fetch the names from the API, mapping the table options @@ -72,7 +75,7 @@ render: name => , sorter: true, - defaultSortOrder: "ascend" + defaultSortOrder: sortNew ? undefined : "ascend" }, // Owner @@ -137,7 +140,8 @@ render: time => , width: 200, - sorter: true + sorter: true, + defaultSortOrder: sortNew ? "descend" : undefined }, // Updated time