From c2e81364f655ecaba4a07c7aefc7bd60596ad260 Mon Sep 17 00:00:00 2001 From: Keith Date: Fri, 2 Aug 2024 02:15:48 +0900 Subject: [PATCH 1/6] fix: hide some nft tags --- src/components/NFTTag/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/NFTTag/index.tsx b/src/components/NFTTag/index.tsx index 35e45418e..ee31024bd 100644 --- a/src/components/NFTTag/index.tsx +++ b/src/components/NFTTag/index.tsx @@ -5,10 +5,14 @@ import styles from './styles.module.scss' export const whiteList = ['invalid', 'suspicious', 'out-of-length-range', 'rgb++', 'layer-1-asset', 'layer-2-asset'] +const HIDDEN_TAGS = ['duplicate', 'suspicious', 'utility', 'supply-unlimited', 'out-of-length-range'] + const NFTTag = ({ tagName, to }: { tagName: string; to?: string }) => { const { t } = useTranslation() const { push } = useHistory() + if (HIDDEN_TAGS.includes(tagName)) return null + let tag = tagName let content = t(`xudt.tags.${tag}`) if (tag.startsWith('verified-on-')) { From b4a560fe0230acea191bddea9367d19eb06f9f64 Mon Sep 17 00:00:00 2001 From: Keith Date: Fri, 2 Aug 2024 11:09:24 +0900 Subject: [PATCH 2/6] refactor: refactor hidden tag of nft --- src/components/NFTTag/index.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/NFTTag/index.tsx b/src/components/NFTTag/index.tsx index ee31024bd..c56ef26e5 100644 --- a/src/components/NFTTag/index.tsx +++ b/src/components/NFTTag/index.tsx @@ -3,16 +3,19 @@ import { useTranslation } from 'react-i18next' import { useHistory } from 'react-router-dom' import styles from './styles.module.scss' -export const whiteList = ['invalid', 'suspicious', 'out-of-length-range', 'rgb++', 'layer-1-asset', 'layer-2-asset'] - -const HIDDEN_TAGS = ['duplicate', 'suspicious', 'utility', 'supply-unlimited', 'out-of-length-range'] +export const whiteList = [ + // 'suspicious', + // 'invalid', + // 'out-of-length-range', + 'rgb++', + 'layer-1-asset', + 'layer-2-asset', +] const NFTTag = ({ tagName, to }: { tagName: string; to?: string }) => { const { t } = useTranslation() const { push } = useHistory() - if (HIDDEN_TAGS.includes(tagName)) return null - let tag = tagName let content = t(`xudt.tags.${tag}`) if (tag.startsWith('verified-on-')) { From 8107528a0eb33aa044979be4432b10b2841f8729 Mon Sep 17 00:00:00 2001 From: Keith Date: Fri, 2 Aug 2024 11:18:56 +0900 Subject: [PATCH 3/6] fix: fix rgb++ compatible tag --- src/components/XUDTTag/index.tsx | 2 +- src/pages/Xudts/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/XUDTTag/index.tsx b/src/components/XUDTTag/index.tsx index d1e433b81..755584800 100644 --- a/src/components/XUDTTag/index.tsx +++ b/src/components/XUDTTag/index.tsx @@ -22,7 +22,7 @@ const XUDTTag = ({ tagName, to }: { tagName: string; to?: string }) => { // FIXME: data should be updated in the backend // issue: https://github.com/Magickbase/ckb-explorer-public-issues/issues/754 - if (tag === 'rgb++') { + if (tag === 'rgb++' || tag === 'rgbpp-compatible') { content = 'RGB++' } diff --git a/src/pages/Xudts/index.tsx b/src/pages/Xudts/index.tsx index a3ea9493f..e11af710c 100644 --- a/src/pages/Xudts/index.tsx +++ b/src/pages/Xudts/index.tsx @@ -308,7 +308,7 @@ const Xudts = () => { ...token, // FIXME: data should be updated in the backend // issue: https://github.com/Magickbase/ckb-explorer-public-issues/issues/754 - xudtTags: token.xudtTags?.filter(tag => tag !== 'rgb++'), + xudtTags: token.xudtTags?.filter(tag => !['rgb++', 'rgbpp-compatible'].includes(tag)), })), total, pageSize, From 1332d894d8855ffef063f9093931da78b85774b3 Mon Sep 17 00:00:00 2001 From: Keith Date: Fri, 2 Aug 2024 11:41:44 +0900 Subject: [PATCH 4/6] fix: fix rgbpp tag on xudt page --- src/components/NFTTag/index.tsx | 5 +++++ src/components/XUDTTag/styles.module.scss | 1 + src/pages/NftCollections/List.tsx | 6 ++++++ src/pages/Xudt/UDTComp.tsx | 5 ----- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/components/NFTTag/index.tsx b/src/components/NFTTag/index.tsx index c56ef26e5..335c4baca 100644 --- a/src/components/NFTTag/index.tsx +++ b/src/components/NFTTag/index.tsx @@ -7,6 +7,7 @@ export const whiteList = [ // 'suspicious', // 'invalid', // 'out-of-length-range', + 'rgbpp-compatible', 'rgb++', 'layer-1-asset', 'layer-2-asset', @@ -17,7 +18,11 @@ const NFTTag = ({ tagName, to }: { tagName: string; to?: string }) => { const { push } = useHistory() let tag = tagName + let content = t(`xudt.tags.${tag}`) + if (['rgb++', 'rgbpp-compatible'].includes(tag)) { + content = 'RGB++' + } if (tag.startsWith('verified-on-')) { // FIXME: should be i18n content = content.replace('Platform', tag.replace('verified-on-', '')) diff --git a/src/components/XUDTTag/styles.module.scss b/src/components/XUDTTag/styles.module.scss index 9826c78fe..790dcd43f 100644 --- a/src/components/XUDTTag/styles.module.scss +++ b/src/components/XUDTTag/styles.module.scss @@ -66,6 +66,7 @@ color: #00a7cc; } + &[data-type='rgbpp-compatible'], &[data-type='rgb++'] { border: none; background: linear-gradient(90deg, #ffd176 0.23%, #ffdb81 6.7%, #84ffcb 99.82%); diff --git a/src/pages/NftCollections/List.tsx b/src/pages/NftCollections/List.tsx index 288892a37..d481b7a8a 100644 --- a/src/pages/NftCollections/List.tsx +++ b/src/pages/NftCollections/List.tsx @@ -71,6 +71,12 @@ const filterList = [ title: , to: '/nft-collections', }, + { + key: 'rgbpp-compatible', + value: 'rgb++', + title: , + to: '/nft-collections', + }, { key: 'duplicate', value: 'duplicate', diff --git a/src/pages/Xudt/UDTComp.tsx b/src/pages/Xudt/UDTComp.tsx index f2f7558b8..714d3e4ef 100644 --- a/src/pages/Xudt/UDTComp.tsx +++ b/src/pages/Xudt/UDTComp.tsx @@ -185,11 +185,6 @@ export const UDTOverviewCard = ({ ) const tags = xudt?.xudtTags ?? [] - // FIXME: data should be updated in the backend - // issue: https://github.com/Magickbase/ckb-explorer-public-issues/issues/754 - if (!tags.includes('rgb++')) { - tags.unshift('rgb++') - } return ( <> From a1cc19053a33e81ed64d98a77d65420d415fd3e4 Mon Sep 17 00:00:00 2001 From: Keith Date: Fri, 2 Aug 2024 11:52:25 +0900 Subject: [PATCH 5/6] fix: remove rgbpp-compatible from nft list --- src/pages/NftCollections/List.tsx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/pages/NftCollections/List.tsx b/src/pages/NftCollections/List.tsx index d481b7a8a..288892a37 100644 --- a/src/pages/NftCollections/List.tsx +++ b/src/pages/NftCollections/List.tsx @@ -71,12 +71,6 @@ const filterList = [ title: , to: '/nft-collections', }, - { - key: 'rgbpp-compatible', - value: 'rgb++', - title: , - to: '/nft-collections', - }, { key: 'duplicate', value: 'duplicate', From 35952255a13ac62836150a5d5c47f3a116569ea5 Mon Sep 17 00:00:00 2001 From: Keith Date: Fri, 2 Aug 2024 12:21:26 +0900 Subject: [PATCH 6/6] fix: update tag style for rgbpp-compatible --- src/components/NFTTag/styles.module.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/NFTTag/styles.module.scss b/src/components/NFTTag/styles.module.scss index 1bebdd422..06e1c5a32 100644 --- a/src/components/NFTTag/styles.module.scss +++ b/src/components/NFTTag/styles.module.scss @@ -63,6 +63,7 @@ color: #00a7cc; } + &[data-type='rgbpp-compatible'], &[data-type='rgb++'] { border: none; background: linear-gradient(90deg, #ffd176 0.23%, #ffdb81 6.7%, #84ffcb 99.82%);