Skip to content

Commit

Permalink
feat: risky tokens banner
Browse files Browse the repository at this point in the history
  • Loading branch information
He1DAr committed Jan 10, 2025
1 parent bafbd39 commit e3a5d30
Show file tree
Hide file tree
Showing 2 changed files with 174 additions and 2 deletions.
168 changes: 168 additions & 0 deletions banditState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
{
"users": {
"45c6d267-4742-4d42-8b6f-67258c3d2e93": {
"preferences": {
"interestingContracts": [],
"interestingAddresses": []
},
"linucb": {
"dimension": 7,
"alpha": 10,
"actions": {
"0": {
"A": [
[
0,
0,
0,
0,
0,
0,
0
],
[
0,
0,
0,
0,
0,
0,
0
],
[
0,
0,
0,
0,
0,
0,
0
],
[
0,
0,
0,
0,
0,
0,
0
],
[
0,
0,
0,
0,
0,
0,
0
],
[
0,
0,
0,
0,
0,
0,
0
],
[
0,
0,
0,
0,
0,
0,
0
]
],
"b": [
0,
0,
0,
0,
0,
0,
0
]
},
"1": {
"A": [
[
0,
0,
0,
0,
0,
0,
0
],
[
0,
0,
0,
0,
0,
0,
0
],
[
0,
0,
0,
0,
0,
0,
0
],
[
0,
0,
0,
0,
0,
0,
0
],
[
0,
0,
0,
0,
0,
0,
0
],
[
0,
0,
0,
0,
0,
0,
0
],
[
0,
0,
0,
0,
0,
0,
0
]
],
"b": [
0,
0,
0,
0,
0,
0,
0
]
}
}
}
}
}
}
8 changes: 6 additions & 2 deletions src/app/token/[tokenId]/PageClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { Tabs } from './Tabs';
import { TokenInfo } from './TokenInfo';
import { TokenInfoProps } from './types';

const RISKY_TOKENS = ['SP1J45NVEGQ7ZA4M57TGF0RAB00TMYCYG00X8EF5B.granite-btc'];

export default function PageClient({
tokenId,
tokenInfo,
Expand All @@ -25,6 +27,8 @@ export default function PageClient({
const categories = tokenInfo.extended?.categories || [];
const hasSBTCInName = getHasSBTCInName(name ?? '', symbol ?? '');
const isSBTC = getIsSBTC(tokenId);
const isRisky = RISKY_TOKENS.includes(tokenId);
const showWarning = isRisky || (hasSBTCInName && !isSBTC);
return (
<>
<Stack gap={2}>
Expand Down Expand Up @@ -56,7 +60,7 @@ export default function PageClient({
</Flex>
</Tag>
)}
{hasSBTCInName && !isSBTC && (
{showWarning && (
<Tag
color="red.600"
bg="red.200"
Expand All @@ -72,7 +76,7 @@ export default function PageClient({
)}
</Flex>
</Stack>
{hasSBTCInName && !isSBTC && (
{showWarning && (
<Box borderRadius="xl" bg="red.200" p={4}>
<Flex gap={2}>
<Icon as={Warning} h={4} w={4} color="red.600" />
Expand Down

0 comments on commit e3a5d30

Please sign in to comment.