Skip to content

Commit

Permalink
feat:rebrand other assets (#1996)
Browse files Browse the repository at this point in the history
  • Loading branch information
evavirseda authored Aug 27, 2024
1 parent 2d846a5 commit eb3797b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 27 deletions.
7 changes: 4 additions & 3 deletions apps/ui-kit/src/lib/components/molecules/card/CardAction.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

import { ArrowRight } from '@iota/ui-icons';
import { ArrowRight, ArrowTopRight } from '@iota/ui-icons';
import { Button, ButtonSize, ButtonType } from '@/components/atoms/button';
import { CardActionType } from './card.enums';

Expand All @@ -10,16 +10,17 @@ export type CardActionProps = {
subtitle?: string;
type: CardActionType;
onClick?: () => void;
isExternalLink?: boolean;
};

export function CardAction({ type, onClick, subtitle, title }: CardActionProps) {
export function CardAction({ type, onClick, subtitle, title, isExternalLink }: CardActionProps) {
if (type === CardActionType.Link) {
return (
<div
onClick={onClick}
className="shrink-0 text-neutral-10 dark:text-neutral-92 [&_svg]:h-6 [&_svg]:w-6"
>
<ArrowRight />
{isExternalLink ? <ArrowTopRight /> : <ArrowRight />}
</div>
);
}
Expand Down
41 changes: 17 additions & 24 deletions apps/wallet/src/ui/app/pages/home/nfts/NonVisualAssets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
// SPDX-License-Identifier: Apache-2.0

import { ExplorerLink, ExplorerLinkType } from '_components';
import { Text } from '_src/ui/app/shared/text';
import { type IotaObjectData } from '@iota/iota-sdk/client';
import { formatAddress, parseStructTag } from '@iota/iota-sdk/utils';
import { Card, CardAction, CardActionType, CardBody, CardType } from '@iota/apps-ui-kit';

interface NonVisualAssetsProps {
items: IotaObjectData[];
Expand All @@ -15,36 +15,29 @@ export default function NonVisualAssets({ items }: NonVisualAssetsProps) {
return (
<div className="flex w-full flex-1 flex-col items-center gap-4">
{items?.length ? (
<div className="divide-gray-40 flex w-full flex-col flex-wrap gap-3 divide-x-0 divide-y divide-solid">
<div className="flex w-full flex-col">
{items.map((item) => {
const { address, module, name } = parseStructTag(item.type!);
return (
<div className="grid grid-cols-3 pt-3" key={item.objectId}>
<ExplorerLink
className="text-hero-dark no-underline"
objectID={item.objectId!}
type={ExplorerLinkType.Object}
>
<Text variant="pBody">{formatAddress(item.objectId!)}</Text>
</ExplorerLink>

<div className="col-span-2 break-all">
<Text
variant="pBodySmall"
weight="normal"
mono
color="steel"
title={item.type ?? ''}
>
{`${formatAddress(address)}::${module}::${name}`}
</Text>
</div>
</div>
<ExplorerLink
className="text-hero-dark no-underline"
objectID={item.objectId!}
type={ExplorerLinkType.Object}
key={item.objectId}
>
<Card type={CardType.Default}>
<CardBody
title={formatAddress(item.objectId!)}
subtitle={`${formatAddress(address)}::${module}::${name}`}
/>
<CardAction type={CardActionType.Link} isExternalLink />
</Card>
</ExplorerLink>
);
})}
</div>
) : (
<div className="text-steel-darker flex flex-1 items-center self-center text-caption font-semibold">
<div className="h-full content-center text-title-lg text-neutral-10">
No Assets found
</div>
)}
Expand Down

0 comments on commit eb3797b

Please sign in to comment.