-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add more address type cases in addressHelper (all covered excep…
…t multi). Fix issue in computing bech32 for account in OutputView. Add nova own Bech32Address component.
- Loading branch information
Showing
12 changed files
with
138 additions
and
52 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import React from "react"; | ||
import * as H from "history"; | ||
import { IAddressDetails } from "~/models/api/nova/IAddressDetails"; | ||
import TruncatedId from "../../stardust/TruncatedId"; | ||
|
||
interface Bech32AddressProps { | ||
network?: string; | ||
history?: H.History; | ||
addressDetails?: IAddressDetails; | ||
advancedMode: boolean; | ||
hideLabel?: boolean; | ||
} | ||
|
||
const Bech32Address: React.FC<Bech32AddressProps> = ({ network, history, addressDetails, advancedMode, hideLabel }) => { | ||
return ( | ||
<div className="bech32-address"> | ||
{addressDetails?.bech32 && ( | ||
<div className="section--data"> | ||
{!hideLabel && <div className="label">{addressDetails.label} Address</div>} | ||
<div className="value row middle code"> | ||
{history && ( | ||
<button | ||
type="button" | ||
className="margin-r-t" | ||
onClick={() => history?.push(`/${network}/addr/${addressDetails?.bech32}`)} | ||
> | ||
<TruncatedId id={addressDetails.bech32} showCopyButton /> | ||
</button> | ||
)} | ||
{!history && <TruncatedId id={addressDetails.bech32} showCopyButton />} | ||
</div> | ||
</div> | ||
)} | ||
{advancedMode && addressDetails?.label && addressDetails?.hex && ( | ||
<div className="section--data"> | ||
<div className="label">{addressDetails.label} Id</div> | ||
<div className="value row middle code"> | ||
{history && ( | ||
<button | ||
type="button" | ||
className="margin-r-t" | ||
onClick={() => history?.push(`/${network}/addr/${addressDetails?.bech32}`)} | ||
> | ||
<TruncatedId id={addressDetails?.hex} showCopyButton /> | ||
</button> | ||
)} | ||
{!history && <TruncatedId id={addressDetails?.hex} showCopyButton />} | ||
</div> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Bech32Address; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters