From f450ba85cf25109f715acc7f59b189fd75cd3105 Mon Sep 17 00:00:00 2001 From: lauti7 Date: Thu, 30 Nov 2023 13:54:37 -0300 Subject: [PATCH] fix: prettier --- .../RoyaltiesEarnedNotification.tsx | 50 +++++++-------- .../Notifications/Notifications.stories.tsx | 63 ++++++++++--------- .../Notifications/NotificationsFeed.tsx | 58 ++++++++++------- 3 files changed, 94 insertions(+), 77 deletions(-) diff --git a/src/components/Notifications/NotificationTypes/RoyaltiesEarnedNotification.tsx b/src/components/Notifications/NotificationTypes/RoyaltiesEarnedNotification.tsx index ce7369db..d774c70f 100644 --- a/src/components/Notifications/NotificationTypes/RoyaltiesEarnedNotification.tsx +++ b/src/components/Notifications/NotificationTypes/RoyaltiesEarnedNotification.tsx @@ -13,17 +13,17 @@ interface RoyaltiesEarnedNotificationProps { const i18N = { en: { - description_1: `You earned `, + description_1: `You earned `, description_2: `for selling `, title: 'Royalties Earned' }, es: { - description_1: `Ganaste `, + description_1: `Ganaste `, description_2: `por vender `, title: 'Regalias ganadas' }, zh: { - description_1: `您通过出售 `, + description_1: `您通过出售 `, description_2: `赚取了 `, title: '所得版税' } @@ -51,28 +51,28 @@ const RoyaltiesEarnedNotification = ({

{i18N[locale].title}

- { - locale == "zh" ? - ( -

- {i18N[locale].description_1} - - - {notification.metadata.nftName} - - - {' '}{i18N[locale].description_2}{Number(notification.metadata.royaltiesCut)} -

- ) : + {locale == 'zh' ? (

- {i18N[locale].description_1}{Number(notification.metadata.royaltiesCut)} - {' '}{i18N[locale].description_2} + {i18N[locale].description_1} + + + {notification.metadata.nftName} + + {' '} + {i18N[locale].description_2} + {Number(notification.metadata.royaltiesCut)} +

+ ) : ( +

+ {i18N[locale].description_1} + {Number(notification.metadata.royaltiesCut)}{' '} + {i18N[locale].description_2}

- } + )} ) } diff --git a/src/components/Notifications/Notifications.stories.tsx b/src/components/Notifications/Notifications.stories.tsx index 2600cac9..dec60523 100644 --- a/src/components/Notifications/Notifications.stories.tsx +++ b/src/components/Notifications/Notifications.stories.tsx @@ -43,11 +43,11 @@ storiesOf('Notifications Toggle', module) rarity: 'epic' as Rarity, seller: '0x8bc619e7f9ca9949b8440245fd9d8c4c002edf02', nftName: 'Green Atari Tee', - network: "ethereum", - category: "wearable" as NFTCategory + network: 'ethereum', + category: 'wearable' as NFTCategory }, - created_at: "2023-11-29T12:51:00.600Z", - updated_at: "2023-11-29T12:51:00.600Z" + created_at: '2023-11-29T12:51:00.600Z', + updated_at: '2023-11-29T12:51:00.600Z' } ]} locale="en" @@ -79,11 +79,11 @@ storiesOf('Notifications Toggle', module) rarity: 'epic' as Rarity, seller: '0x8bc619e7f9ca9949b8440245fd9d8c4c002edf02', nftName: 'Green Atari Tee', - network: "ethereum", - category: "wearable" as NFTCategory + network: 'ethereum', + category: 'wearable' as NFTCategory }, - created_at: "2023-11-29T12:51:00.600Z", - updated_at: "2023-11-29T12:51:00.600Z" + created_at: '2023-11-29T12:51:00.600Z', + updated_at: '2023-11-29T12:51:00.600Z' } ]} activeTab="newest" @@ -106,21 +106,22 @@ storiesOf('Notifications Toggle', module) userNotifications={[ { read: false, - type: "royalties_earned", + type: 'royalties_earned', address: '0xA', timestamp: 1701198655 * 1000, metadata: { - link: "https://market.decentraland.zone/contracts/0xb726634ed82ac04e6bca66b3b97cc41a2c10ec31/tokens/9", - image: 'https://peer.decentraland.org/lambdas/collections/contents/urn:decentraland:ethereum:collections-v1:binance_us_collection:binance_us_upper_body/thumbnail', - rarity: "common" as Rarity, - network: "polygon", - nftName: "NJacket", - category: "wearable" as NFTCategory, - royaltiesCut: "0.3", - royaltiesCollector: "0x2a39d4f68133491f0442496f601cde2a945b6d31" + link: 'https://market.decentraland.zone/contracts/0xb726634ed82ac04e6bca66b3b97cc41a2c10ec31/tokens/9', + image: + 'https://peer.decentraland.org/lambdas/collections/contents/urn:decentraland:ethereum:collections-v1:binance_us_collection:binance_us_upper_body/thumbnail', + rarity: 'common' as Rarity, + network: 'polygon', + nftName: 'NJacket', + category: 'wearable' as NFTCategory, + royaltiesCut: '0.3', + royaltiesCollector: '0x2a39d4f68133491f0442496f601cde2a945b6d31' }, - created_at: "2023-11-29T12:51:00.600Z", - updated_at: "2023-11-29T12:51:00.600Z" + created_at: '2023-11-29T12:51:00.600Z', + updated_at: '2023-11-29T12:51:00.600Z' }, { read: true, @@ -134,11 +135,11 @@ storiesOf('Notifications Toggle', module) rarity: 'uncommon' as Rarity, seller: '0x6b347a82fcac4e6a38d1fc40e3631bd8f9495e9f', nftName: 'Binance US Hoodie', - network: "ethereum", - category: "wearable" as NFTCategory + network: 'ethereum', + category: 'wearable' as NFTCategory }, - created_at: "2023-11-29T12:51:00.600Z", - updated_at: "2023-11-29T12:51:00.600Z" + created_at: '2023-11-29T12:51:00.600Z', + updated_at: '2023-11-29T12:51:00.600Z' }, { read: true, @@ -152,11 +153,11 @@ storiesOf('Notifications Toggle', module) rarity: 'uncommon' as Rarity, seller: '0x6b347a82fcac4e6a38d1fc40e3631bd8f9495e9f', nftName: 'Binance US Hoodie', - network: "ethereum", - category: "wearable" as NFTCategory + network: 'ethereum', + category: 'wearable' as NFTCategory }, - created_at: "2023-11-29T12:51:00.600Z", - updated_at: "2023-11-29T12:51:00.600Z" + created_at: '2023-11-29T12:51:00.600Z', + updated_at: '2023-11-29T12:51:00.600Z' }, { read: true, @@ -170,11 +171,11 @@ storiesOf('Notifications Toggle', module) rarity: 'uncommon' as Rarity, seller: '0x6b347a82fcac4e6a38d1fc40e3631bd8f9495e9f', nftName: 'Binance US Hoodie', - network: "ethereum", - category: "wearable" as NFTCategory + network: 'ethereum', + category: 'wearable' as NFTCategory }, - created_at: "2023-11-29T12:51:00.600Z", - updated_at: "2023-11-29T12:51:00.600Z" + created_at: '2023-11-29T12:51:00.600Z', + updated_at: '2023-11-29T12:51:00.600Z' } ]} activeTab="newest" diff --git a/src/components/Notifications/NotificationsFeed.tsx b/src/components/Notifications/NotificationsFeed.tsx index 680d3d0d..92cb7ac7 100644 --- a/src/components/Notifications/NotificationsFeed.tsx +++ b/src/components/Notifications/NotificationsFeed.tsx @@ -85,22 +85,25 @@ const i18N = { } } -const NotificationHandler = ({ locale, notification }: { notification: DCLNotification, locale: NotificationLocale }) => { +const NotificationHandler = ({ + locale, + notification +}: { + notification: DCLNotification + locale: NotificationLocale +}) => { switch (notification.type) { case 'item_sold': return ( - - ) - case 'royalties_earned': - return ( - - ) + + ) + case 'royalties_earned': + return ( + + ) default: return null } @@ -190,11 +193,15 @@ export default function NotificationsFeed({ {activeTab == 'newest' ? ( <>
- {unreadNotifications.map((notification) => )} + {unreadNotifications.map((notification) => ( + + ))}
- { - previousNotifications.length > 0 && ( -
+ {previousNotifications.length > 0 && ( +

Previous

- {previousNotifications.map((notification) => )} + {previousNotifications.map((notification) => ( + + ))}
- ) - } + )} ) : ( <> - {readNotifications.map((notification) => )} + {readNotifications.map((notification) => ( + + ))} )}