Skip to content

Commit

Permalink
fix(Web3Profile): mf-3299 list/unlist NFTs
Browse files Browse the repository at this point in the history
blame cdf8458
  • Loading branch information
UncleBill committed Feb 3, 2023
1 parent a696e1c commit f5cf8a0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 23 deletions.
Expand Up @@ -28,9 +28,6 @@ const useStyles = makeStyles()((theme) => {
':hover': {
cursor: 'pointer',
},
'&:first-child:hover': {
cursor: 'default',
},
},
currentTag: {
width: '46px',
Expand Down
Expand Up @@ -37,9 +37,6 @@ const useStyles = makeStyles()((theme) => {
height: 126,
borderRadius: 12,
userSelect: 'none',
'&:nth-last-child(-n+4)': {
marginBottom: 0,
},
},
link: {
cursor: 'pointer',
Expand Down Expand Up @@ -168,15 +165,10 @@ export function WalletAssetsCard(props: WalletAssetsCardProps) {
) : (
<Box>
<Empty
content={
hasUnlisted
? t.all_collection_hidden({
collection: collectionName ?? SceneMap[Scene.NFTSetting].title,
})
: t.no_collection_item({
collection: collectionName ?? SceneMap[Scene.NFTSetting].title,
})
}
content={t.no_collection({
context: hasUnlisted ? 'hidden' : 'empty',
collection: collectionName ?? SceneMap[Scene.NFTSetting].title,
})}
/>
</Box>
)}
Expand Down
8 changes: 4 additions & 4 deletions packages/plugins/Web3Profile/src/SNSAdaptor/utils.ts
Expand Up @@ -141,14 +141,14 @@ export const getUnlistedConfig = async (publicKey: string): Promise<UnlistedConf
if (!publicKey) return

const res = await NextIDStorage.get<PersonaKV>(publicKey)
if (!res.ok) return
if (!res.proofs) return

const wallets: UnlistedConfig['wallets'] = {}
const collections: UnlistedConfig['collections'] = {}

res.val.proofs
?.filter((x) => x.platform === NextIDPlatform.Twitter)
?.forEach((y) => {
res.proofs
.filter((x) => x.platform === NextIDPlatform.Twitter)
.forEach((y) => {
wallets[y.identity] = y.content?.[PLUGIN_ID]?.hiddenAddresses!
collections[y.identity] = y.content?.[PLUGIN_ID]?.unListedCollections!
})
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/Web3Profile/src/locales/en-US.json
Expand Up @@ -48,8 +48,8 @@
"wallets_add_collectible": "Add Collectible",
"add_collectible": "Add collectible",
"nft_add_dialog_title": "Add Collectible",
"no_collection_item": "No {{collection}} found.",
"all_collection_hidden": "All {{collection}} unlisted.",
"no_collection$empty": "No {{collection}} found.",
"no_collection$hidden": "All {{collection}} unlisted.",
"no_unlisted_collection": "Click items in listed area to hidden your {{collection}} on Web3 Profile.",
"no_listed_collection": "Click items in Unlisted area to show your {{collection}} on Web3 Profile.",
"wallet_setting_hint": "Toggle the button to manage wallet display settings.",
Expand Down
4 changes: 2 additions & 2 deletions packages/web3-providers/src/NextID/kv.ts
Expand Up @@ -77,8 +77,8 @@ export class NextIDStorageAPI implements NextIDBaseAPI.Storage {
const result = compact(response.values.map((x) => x.content[pluginID]))
return Ok(result)
}
async get<T>(personaPublicKey: string): Promise<Result<T, string>> {
return fetchJSON(urlcat(BASE_URL, '/v1/kv', { persona: personaPublicKey }))
async get<T>(personaPublicKey: string): Promise<T> {
return fetchJSON<T>(urlcat(BASE_URL, '/v1/kv', { persona: personaPublicKey }))
}
/**
* Get signature payload for updating
Expand Down

0 comments on commit f5cf8a0

Please sign in to comment.