diff --git a/public/locales/en.json b/public/locales/en.json index e5993c2..709b524 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -462,6 +462,8 @@ "unpaid": "Unpaid blocks", "unpaidCount": "{{count, number}} block", "unpaidCount_plural": "{{count, number}} blocks", + "aRecord": "A record", + "aRecordEditTooltip": "Update A record", "cardRecentTransactionsTitle": "Recent transactions", "cardHistoryTitle": "Name history", diff --git a/src/components/DateTime.tsx b/src/components/DateTime.tsx index 218d52c..b839843 100644 --- a/src/components/DateTime.tsx +++ b/src/components/DateTime.tsx @@ -32,7 +32,7 @@ {timeAgo ? - : dayjs(realDate).format("YYYY-MM-DD HH:mm:ss")} + : dayjs(realDate).format("YYYY/MM/DD HH:mm:ss")} ; } diff --git a/src/components/Statistic.tsx b/src/components/Statistic.tsx index 1a25fbd..881fe72 100644 --- a/src/components/Statistic.tsx +++ b/src/components/Statistic.tsx @@ -11,13 +11,14 @@ interface Props { title?: string; titleKey?: string; + titleExtra?: React.ReactNode; value?: React.ReactNode; className?: string; green?: boolean; } -export function Statistic({ title, titleKey, value, className, green }: Props): JSX.Element { +export function Statistic({ title, titleKey, titleExtra, value, className, green }: Props): JSX.Element { const { t } = useTranslation(); const classes = classNames("kw-statistic", className, { @@ -25,7 +26,7 @@ }); return
- {titleKey ? t(titleKey) : title} + {titleKey ? t(titleKey) : title}{titleExtra} {value}
; } diff --git a/src/pages/names/NamePage.less b/src/pages/names/NamePage.less index 7a99d64..1b738cd 100644 --- a/src/pages/names/NamePage.less +++ b/src/pages/names/NamePage.less @@ -46,4 +46,25 @@ } } } + + .name-a-record-row { + max-width: 768px; + margin-bottom: @margin-lg; + + .kw-statistic .kw-statistic-value { + background: @kw-darker; + border-radius: @border-radius-base; + + display: inline-block; + margin-top: @padding-xs; + padding: 0.25em @padding-xs; + + font-size: 90%; + font-family: monospace; + } + + .name-a-record-edit { + margin-left: @padding-xs; + } + } } diff --git a/src/pages/names/NamePage.tsx b/src/pages/names/NamePage.tsx index 369616a..e64c6a3 100644 --- a/src/pages/names/NamePage.tsx +++ b/src/pages/names/NamePage.tsx @@ -2,7 +2,8 @@ // 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 } from "react"; -import { Row, Col, Skeleton, Typography } from "antd"; +import { Row, Col, Skeleton, Typography, Tooltip } from "antd"; +import { EditOutlined } from "@ant-design/icons"; import { useTranslation } from "react-i18next"; import { useParams } from "react-router-dom"; @@ -110,6 +111,25 @@ ) : <>} + {/* A record */} + {name.a && ( + + + + + + + + + } + value={{name.a}} + /> + + + )} + {/* Transactions and name history row */} {/* Recent transactions */} diff --git a/src/pages/names/NameTransactionsCard.tsx b/src/pages/names/NameTransactionsCard.tsx index 0211c59..818ab57 100644 --- a/src/pages/names/NameTransactionsCard.tsx +++ b/src/pages/names/NameTransactionsCard.tsx @@ -44,7 +44,7 @@ useEffect(() => { if (!syncNode) return; - // Remove the existing results in case the address changed + // Remove the existing results in case the name changed setRes(undefined); setLoading(true);