diff --git a/src/components/addresses/ContextualAddress.tsx b/src/components/addresses/ContextualAddress.tsx index a7a18e0..6fda9ad 100644 --- a/src/components/addresses/ContextualAddress.tsx +++ b/src/components/addresses/ContextualAddress.tsx @@ -16,7 +16,7 @@ import { KristNameLink } from "../names/KristNameLink"; import { ConditionalLink } from "@comp/ConditionalLink"; -import { getVerified, VerifiedAddress } from "./VerifiedAddress"; +import { getVerified, VerifiedAddressLink } from "./VerifiedAddress"; import "./ContextualAddress.less"; @@ -59,7 +59,7 @@ return verified ? ( // Verified address - + ) : ( // Regular address @@ -174,7 +174,7 @@ ) : (verified // Display the verified address if possible - ? + ? : ( // Display the regular address or label debounce(async ( nameSuffix: string, @@ -153,18 +158,29 @@ // Whether or not to show certain hints/anything at all const showWalletHint = !!foundWallet; + const showVerifiedHint = !!foundVerified && !showWalletHint; const showAddressHint = foundAddress !== undefined; const showNameHint = foundName !== undefined; - const foundAnything = showWalletHint || showAddressHint || showNameHint; + const foundAnything = showWalletHint || showVerifiedHint + || showAddressHint || showNameHint; // Whether or not to show a separator between the wallet hint and address or // name hint (i.e. if two hints are shown) - const showSep = showWalletHint && (showAddressHint || showNameHint); + const showSep = (showWalletHint || showVerifiedHint) + && (showAddressHint || showNameHint); if (foundAnything) return
{/* Show a wallet hint if possible */} {foundWallet && } + {/* Show a verified hint if possible */} + {foundVerified && ( + // Make it look like a contextual address to inherit the styles + + + + )} + {/* Show a separator if there are two hints */} {showSep && } diff --git a/src/components/addresses/picker/VerifiedHint.tsx b/src/components/addresses/picker/VerifiedHint.tsx new file mode 100644 index 0000000..75c2899 --- /dev/null +++ b/src/components/addresses/picker/VerifiedHint.tsx @@ -0,0 +1,15 @@ +// 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 { VerifiedAddress, VerifiedAddressLink } from "@comp/addresses/VerifiedAddress"; + +interface Props { + address: string; + verified: VerifiedAddress; +} + +export function VerifiedHint({ address, verified }: Props): JSX.Element { + return + + ; +}