diff --git a/packages/shared/components/atoms/tiles/tileContents/NftActivityTileContent.svelte b/packages/shared/components/atoms/tiles/tileContents/NftActivityTileContent.svelte index e58df78ca9..089a57ea3e 100644 --- a/packages/shared/components/atoms/tiles/tileContents/NftActivityTileContent.svelte +++ b/packages/shared/components/atoms/tiles/tileContents/NftActivityTileContent.svelte @@ -2,9 +2,8 @@ import { localize } from '@core/i18n' import { ActivityDirection, InclusionState, INftActivityData, Subject } from '@core/wallet' import { truncateString } from '@core/utils' - import { Text, FontWeight, Icon } from 'shared/components' + import { Text, FontWeight, NftMediaContainer, NftMediaSize } from 'shared/components' import { networkHrp } from '@core/network' - import { Icon as IconEnum } from '@lib/auxiliary/icon' export let inclusionState: InclusionState export let data: INftActivityData @@ -41,14 +40,7 @@
-
- -
+
diff --git a/packages/shared/components/enums/index.ts b/packages/shared/components/enums/index.ts index f6c0f8e3e4..599bce065d 100644 --- a/packages/shared/components/enums/index.ts +++ b/packages/shared/components/enums/index.ts @@ -2,4 +2,5 @@ export * from './button-type.enum' export * from './button-variant.enum' export * from './button-size.enum' export * from './font-weight.enum' +export * from './nft-media-size.enum' export * from './text-type.enum' diff --git a/packages/shared/components/enums/nft-media-size.enum.ts b/packages/shared/components/enums/nft-media-size.enum.ts new file mode 100644 index 0000000000..ba82d4c19e --- /dev/null +++ b/packages/shared/components/enums/nft-media-size.enum.ts @@ -0,0 +1,7 @@ +export enum NftMediaSize { + ExtraSmall = 'extraSmall', + Small = 'small', + Medium = 'medium', + Large = 'large', + ExtraLarge = 'extraLarge', +} diff --git a/packages/shared/components/molecules/NftMediaContainer.svelte b/packages/shared/components/molecules/NftMediaContainer.svelte new file mode 100644 index 0000000000..a4b538c661 --- /dev/null +++ b/packages/shared/components/molecules/NftMediaContainer.svelte @@ -0,0 +1,73 @@ + + +
+
+ {#if !isLoaded} + + {:else} +
+ +
+ {/if} +
+
diff --git a/packages/shared/components/molecules/NftPlaceholderIcon.svelte b/packages/shared/components/molecules/NftPlaceholderIcon.svelte new file mode 100644 index 0000000000..3c0812abd1 --- /dev/null +++ b/packages/shared/components/molecules/NftPlaceholderIcon.svelte @@ -0,0 +1,37 @@ + + + diff --git a/packages/shared/components/molecules/index.js b/packages/shared/components/molecules/index.js index 6e0284159b..2212965368 100644 --- a/packages/shared/components/molecules/index.js +++ b/packages/shared/components/molecules/index.js @@ -5,6 +5,8 @@ export { default as DateInputButton } from './DateInputButton.svelte' export { default as ExpirationTimePicker } from './ExpirationTimePicker.svelte' export { default as FoundryDetails } from './FoundryDetails.svelte' export { default as NftDetails } from './NftDetails.svelte' +export { default as NftMediaContainer } from './NftMediaContainer.svelte' +export { default as NftPlaceholderIcon } from './NftPlaceholderIcon.svelte' export { default as SelectorInput } from './SelectorInput.svelte' export { default as ShimmerClaimingAccountList } from './ShimmerClaimingAccountList.svelte' export { default as TransactionDetails } from './TransactionDetails.svelte' diff --git a/packages/shared/components/popups/send/SendNftFormPopup.svelte b/packages/shared/components/popups/send/SendNftFormPopup.svelte index 0fc2ddf87a..3bf43e94a4 100644 --- a/packages/shared/components/popups/send/SendNftFormPopup.svelte +++ b/packages/shared/components/popups/send/SendNftFormPopup.svelte @@ -7,7 +7,15 @@ selectedAccountActivities, updateNewNftTransactionDetails, } from '@core/wallet' - import { Button, Text, RecipientInput, NftInput, FontWeight } from 'shared/components' + import { + Button, + Text, + RecipientInput, + NftInput, + NftMediaSize, + NftMediaContainer, + FontWeight, + } from 'shared/components' import { closePopup, openPopup } from '@auxiliary/popup' import type { FeatureTypes } from '@iota/types' @@ -51,6 +59,7 @@ {localize('popups.sendNft.formTitle')} + diff --git a/packages/shared/lib/auxiliary/icon/constants/icon-svg.ts b/packages/shared/lib/auxiliary/icon/constants/icon-svg.ts index 086cb94fad..59e102118e 100644 --- a/packages/shared/lib/auxiliary/icon/constants/icon-svg.ts +++ b/packages/shared/lib/auxiliary/icon/constants/icon-svg.ts @@ -57,6 +57,7 @@ import { MINUS_SVG, NETWORK_SVG, PARCHMENT_SVG, + PICTURE_SVG, PLAY_SVG, PLUS_SVG, PROFILE_SVG, @@ -165,6 +166,7 @@ export const ICON_SVG = { [Icon.Network]: NETWORK_SVG, [Icon.NotVerified]: NOT_VERIFIED_SVG, [Icon.Parchment]: PARCHMENT_SVG, + [Icon.Picture]: PICTURE_SVG, [Icon.Play]: PLAY_SVG, [Icon.Plus]: PLUS_SVG, [Icon.Profile]: PROFILE_SVG, diff --git a/packages/shared/lib/auxiliary/icon/enums/icon.enum.ts b/packages/shared/lib/auxiliary/icon/enums/icon.enum.ts index 143b8f878f..76d3f9383d 100644 --- a/packages/shared/lib/auxiliary/icon/enums/icon.enum.ts +++ b/packages/shared/lib/auxiliary/icon/enums/icon.enum.ts @@ -60,6 +60,7 @@ export enum Icon { Network = 'network', NotVerified = 'not-verified', Parchment = 'parchment', + Picture = 'picture', Play = 'play', Plus = 'plus', Profile = 'profile', diff --git a/packages/shared/lib/auxiliary/icon/svgs/index.ts b/packages/shared/lib/auxiliary/icon/svgs/index.ts index de8bb972c1..8874c49ed3 100644 --- a/packages/shared/lib/auxiliary/icon/svgs/index.ts +++ b/packages/shared/lib/auxiliary/icon/svgs/index.ts @@ -56,6 +56,7 @@ export * from './minus.svg' export * from './network.svg' export * from './not-verified.svg' export * from './parchment.svg' +export * from './picture.svg' export * from './play.svg' export * from './plus.svg' export * from './profile.svg' diff --git a/packages/shared/lib/auxiliary/icon/svgs/picture.svg.ts b/packages/shared/lib/auxiliary/icon/svgs/picture.svg.ts new file mode 100644 index 0000000000..e1ff505b58 --- /dev/null +++ b/packages/shared/lib/auxiliary/icon/svgs/picture.svg.ts @@ -0,0 +1,16 @@ +import { ISvg } from '../interfaces' + +export const PICTURE_SVG: ISvg = { + width: 24, + height: 24, + path: [ + { + d: 'M15.5 10C16.3284 10 17 9.32843 17 8.5C17 7.67157 16.3284 7 15.5 7C14.6716 7 14 7.67157 14 8.5C14 9.32843 14.6716 10 15.5 10Z', + }, + { + d: 'M7 2C4.23858 2 2 4.23858 2 7V17C2 19.7614 4.23858 22 7 22H17C19.7614 22 22 19.7614 22 17V7C22 4.23858 19.7614 2 17 2H7ZM17 4H7C5.34315 4 4 5.34315 4 7V13.9555L6.47255 12.0324C8.21133 10.68 10.6303 10.6249 12.4289 11.8966L15.356 13.9663C16.1641 14.5376 17.2019 14.6737 18.13 14.33L20 13.6374V7C20 5.34315 18.6569 4 17 4ZM4 17V16.4892L7.70043 13.6111C8.7437 12.7997 10.1951 12.7666 11.2742 13.5296L14.2014 15.5993C15.5481 16.5516 17.2779 16.7784 18.8246 16.2055L20 15.7702V17C20 18.6569 18.6569 20 17 20H7C5.34315 20 4 18.6569 4 17Z', + fillRule: 'evenodd', + clipRule: 'evenodd', + }, + ], +} diff --git a/packages/shared/lib/core/nfts/enums/index.ts b/packages/shared/lib/core/nfts/enums/index.ts new file mode 100644 index 0000000000..b062fe72c8 --- /dev/null +++ b/packages/shared/lib/core/nfts/enums/index.ts @@ -0,0 +1 @@ +export * from './parent-mime-type.enum' diff --git a/packages/shared/lib/core/nfts/enums/parent-mime-type.enum.ts b/packages/shared/lib/core/nfts/enums/parent-mime-type.enum.ts new file mode 100644 index 0000000000..56843338dc --- /dev/null +++ b/packages/shared/lib/core/nfts/enums/parent-mime-type.enum.ts @@ -0,0 +1,9 @@ +export enum ParentMimeType { + Image = 'image', + Video = 'video', + Audio = 'audio', + Text = 'text', + Application = 'application', + Model = 'model', + Font = 'font', +} diff --git a/packages/shared/lib/core/nfts/index.ts b/packages/shared/lib/core/nfts/index.ts index 4e010e7bd1..a2d9a8ec2e 100644 --- a/packages/shared/lib/core/nfts/index.ts +++ b/packages/shared/lib/core/nfts/index.ts @@ -1,5 +1,6 @@ export * from './actions' export * from './constants' +export * from './enums' export * from './interfaces' export * from './stores' export * from './types' diff --git a/packages/shared/tailwind.config.js b/packages/shared/tailwind.config.js index 22e95309ae..b379102348 100644 --- a/packages/shared/tailwind.config.js +++ b/packages/shared/tailwind.config.js @@ -34,6 +34,7 @@ module.exports = { /^hover:font-/, /^dark:font-/, /^grid-cols-/, + /^rounded-/, // `p-${size}` /^p-/, 'scheme-dark',