-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #415 from alleslabs/feat/icns
feat: icns
- Loading branch information
Showing
13 changed files
with
441 additions
and
138 deletions.
There are no files selected for viewing
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,10 @@ | ||
import { CustomIcon } from "lib/components/icon"; | ||
import { Tooltip } from "lib/components/Tooltip"; | ||
|
||
export const PrimaryNameMark = () => ( | ||
<Tooltip label="Primary name"> | ||
<div style={{ display: "flex" }}> | ||
<CustomIcon name="star-solid" color="accent.main" boxSize={3} m={0} /> | ||
</div> | ||
</Tooltip> | ||
); |
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
90 changes: 90 additions & 0 deletions
90
src/lib/pages/account-details/components/AccountHeader.tsx
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,90 @@ | ||
import { Flex, Heading, Image, Text } from "@chakra-ui/react"; | ||
|
||
import { CopyLink } from "lib/components/CopyLink"; | ||
import { CustomIcon } from "lib/components/icon"; | ||
import { PrimaryNameMark } from "lib/components/PrimaryNameMark"; | ||
import type { ICNSNamesResponse } from "lib/services/ns"; | ||
import type { HumanAddr, Option, PublicDetail } from "lib/types"; | ||
|
||
interface AccounHeaderProps { | ||
publicName: Option<string>; | ||
publicDetail: Option<PublicDetail>; | ||
icnsName: Option<ICNSNamesResponse>; | ||
accountAddress: HumanAddr; | ||
} | ||
|
||
export const AccountHeader = ({ | ||
publicName, | ||
publicDetail, | ||
icnsName, | ||
accountAddress, | ||
}: AccounHeaderProps) => { | ||
const displayName = icnsName?.primary_name || "Account Details"; | ||
|
||
return ( | ||
<Flex direction="column" gap={2}> | ||
<Flex gap={1} minH="36px" align="center"> | ||
{publicDetail?.logo || icnsName?.primary_name ? ( | ||
<Image | ||
src={ | ||
publicDetail?.logo ?? | ||
"https://celatone-api.alleslabs.dev/images/entities/icns" | ||
} | ||
borderRadius="full" | ||
alt={publicDetail?.name ?? icnsName?.primary_name} | ||
width={7} | ||
height={7} | ||
/> | ||
) : ( | ||
<CustomIcon name="wallet" boxSize={5} color="secondary.main" /> | ||
)} | ||
<Heading as="h5" variant={{ base: "h6", md: "h5" }}> | ||
{publicName ?? displayName} | ||
</Heading> | ||
</Flex> | ||
<Flex | ||
gap={{ base: 0, md: 2 }} | ||
mt={{ base: 1, md: 0 }} | ||
direction={{ base: "column", md: "row" }} | ||
> | ||
<Text fontWeight={500} color="text.dark" variant="body2"> | ||
Wallet Address: | ||
</Text> | ||
<CopyLink | ||
value={accountAddress} | ||
amptrackSection="account_top" | ||
type="user_address" | ||
/> | ||
</Flex> | ||
{icnsName?.primary_name && ( | ||
<Flex gap={2} align="center"> | ||
<Text fontWeight={500} color="text.dark" variant="body2"> | ||
Registered ICNS names: | ||
</Text> | ||
<Flex gap={1} align="center"> | ||
{icnsName.names.map((name) => ( | ||
<div key={name}> | ||
{name === icnsName.primary_name && <PrimaryNameMark />} | ||
<CopyLink | ||
value={name} | ||
type="icns_names" | ||
withoutIcon | ||
_after={{ | ||
content: '"/"', | ||
fontSize: "14px", | ||
ml: 1, | ||
}} | ||
_last={{ | ||
_after: { | ||
display: "none", | ||
}, | ||
}} | ||
/> | ||
</div> | ||
))} | ||
</Flex> | ||
</Flex> | ||
)} | ||
</Flex> | ||
); | ||
}; |
Oops, something went wrong.
bc89f47
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
celatone-frontend-staging – ./
celatone-frontend-staging-alleslabs.vercel.app
celatone-frontend-staging-git-develop-alleslabs.vercel.app
celatone-frontend-staging.vercel.app
bc89f47
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
osmosis-celatone-frontend-staging – ./
osmosis-celatone-frontend-staging-git-develop-alleslabs.vercel.app
celatone-staging.osmosis.zone
osmosis-celatone-frontend-staging-alleslabs.vercel.app
osmosis-staging.celat.one
staging.osmoscan.io
osmosis-celatone-frontend-staging.vercel.app