forked from forbole/big-dipper-2.0-cosmos
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from CudoVentures/cudos-dev
merging for version Explorer v1.2.3.2
- Loading branch information
Showing
36 changed files
with
726 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
version: '3.6' | ||
services: | ||
big-dipper-2: | ||
container_name: explorer-v2 | ||
build: | ||
context: . | ||
dockerfile: Dockerfile-dev | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"overview": "CW20 Token Details", | ||
"name": "Name", | ||
"denom": "Denom", | ||
"exponent": "Exponent", | ||
"circulatingSupply": "Circulating Supply", | ||
"minter": "Minter", | ||
"maxSupply": "Maximum Supply", | ||
"projectUrl": "Project URL" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
NEXT_PUBLIC_GRAPHQL_URL=http://34.68.222.131:8080/v1/graphql | ||
NEXT_PUBLIC_GRAPHQL_WS=wss://34.68.222.131/v1/graphql | ||
NODE_ENV=production | ||
PORT=3000 | ||
NEXT_PUBLIC_URL=http://34.68.222.131:3000 | ||
NEXT_PUBLIC_WS_CHAIN_URL=ws://34.121.218.76:26657/websocket | ||
NEXT_PUBLIC_CHAIN_STATUS=testnet | ||
LOGGING_DRIVER=gcplogs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
NEXT_PUBLIC_GRAPHQL_URL=https://explorer-gql.cudos.org/v1/graphql | ||
NEXT_PUBLIC_GRAPHQL_WS=wss://explorer-gql.cudos.org/v1/graphql | ||
NODE_ENV=production | ||
PORT=3000 | ||
NEXT_PUBLIC_URL=https://explorer.cudos.org | ||
NEXT_PUBLIC_WS_CHAIN_URL=wss://mainnet-full-node-01.gcp.service.cudo.org:36657/websocket | ||
NEXT_PUBLIC_CHAIN_STATUS=mainnet | ||
LOGGING_DRIVER=gcplogs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
NEXT_PUBLIC_GRAPHQL_URL=https://explorer-gql.private-testnet.cudos.org/v1/graphql | ||
NEXT_PUBLIC_GRAPHQL_WS=wss://explorer-gql.private-testnet.cudos.org/v1/graphql | ||
NODE_ENV=production | ||
PORT=3000 | ||
NEXT_PUBLIC_URL=https://explorer.private-testnet.cudos.org/ | ||
NEXT_PUBLIC_WS_CHAIN_URL=wss://sentry-01.hosts.private-testnet.cudos.org:36657/websocket | ||
NEXT_PUBLIC_CHAIN_STATUS=testnet | ||
LOGGING_DRIVER=gcplogs |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
export const Cw20TokenBalancesDocument = /* GraphQL */` | ||
query Cw20TokenBalances($address: String!) { | ||
cw20token_balance(where: {address: {_eq: $address}}) { | ||
balance | ||
cw20token_info { | ||
address | ||
name | ||
symbol | ||
decimals | ||
logo | ||
} | ||
} | ||
} | ||
`; | ||
|
||
export const Cw20TokenInfoDocument = /* GraphQL */` | ||
query Cw20TokenInfo($address: String!) { | ||
cw20token_info_by_pk(address: $address) { | ||
circulating_supply | ||
decimals | ||
max_supply | ||
minter | ||
name | ||
project_url | ||
symbol | ||
} | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import TokenDetails from '@src/screens/token_details'; | ||
|
||
const TokenDetailsPage = () => { | ||
return ( | ||
<TokenDetails /> | ||
); | ||
}; | ||
|
||
export default TokenDetailsPage; |
86 changes: 86 additions & 0 deletions
86
src/screens/account_details/components/cw20_token_balances/components/desktop/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import React from 'react'; | ||
import classnames from 'classnames'; | ||
import useTranslation from 'next-translate/useTranslation'; | ||
import { | ||
Table, | ||
TableHead, | ||
TableRow, | ||
TableCell, | ||
TableBody, | ||
} from '@material-ui/core'; | ||
import { | ||
AvatarName, | ||
} from '@components'; | ||
import { formatNumber } from '@utils/format_token'; | ||
import { Cw20TokenBalance } from '@src/screens/account_details/types'; | ||
import { getMiddleEllipsis } from '@utils/get_middle_ellipsis'; | ||
import { TOKEN_DETAILS } from '@src/utils/go_to_page'; | ||
import { columns } from './utils'; | ||
|
||
const Desktop: React.FC<{ | ||
className?: string; | ||
balances?: Cw20TokenBalance[] | ||
}> = ({ | ||
className, | ||
balances, | ||
}) => { | ||
const { t } = useTranslation('accounts'); | ||
const balancesFormatted = balances.map((b) => { | ||
const balance = formatNumber(b.balance.toString(), b.exponent); | ||
return ({ | ||
token: ( | ||
<AvatarName | ||
name={`${b.name} (${b.denom.toUpperCase()})`} | ||
address={b.tokenAddress} | ||
imageUrl={b.logo} | ||
href={TOKEN_DETAILS} | ||
/> | ||
), | ||
balance: `${balance} ${b.denom.toUpperCase()}`, | ||
address: getMiddleEllipsis(b.tokenAddress, { | ||
beginning: 15, ending: 10, | ||
}), | ||
}); | ||
}); | ||
|
||
return ( | ||
<div className={classnames(className)}> | ||
<Table> | ||
<TableHead> | ||
<TableRow> | ||
{columns.map((column) => { | ||
return ( | ||
<TableCell | ||
key={column.key} | ||
align={column.align} | ||
style={{ width: `${column.width}%` }} | ||
> | ||
{t(column.key)} | ||
</TableCell> | ||
); | ||
})} | ||
</TableRow> | ||
</TableHead> | ||
<TableBody> | ||
{balancesFormatted.map((b, i) => ( | ||
<TableRow key={`holders-row-${i}`}> | ||
{columns.map((column) => { | ||
return ( | ||
<TableCell | ||
key={`holders-row-${i}-${column.key}`} | ||
align={column.align} | ||
style={{ width: `${column.width}%` }} | ||
> | ||
{b[column.key]} | ||
</TableCell> | ||
); | ||
})} | ||
</TableRow> | ||
))} | ||
</TableBody> | ||
</Table> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Desktop; |
20 changes: 20 additions & 0 deletions
20
src/screens/account_details/components/cw20_token_balances/components/desktop/utils.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export const columns:{ | ||
key: string; | ||
align?: 'left' | 'center' | 'right' | 'justify' | 'inherit'; | ||
width: number; | ||
}[] = [ | ||
{ | ||
key: 'token', | ||
width: 40, | ||
}, | ||
{ | ||
key: 'balance', | ||
width: 33, | ||
}, | ||
{ | ||
key: 'address', | ||
width: 33, | ||
align: 'right', | ||
|
||
}, | ||
]; |
7 changes: 7 additions & 0 deletions
7
src/screens/account_details/components/cw20_token_balances/components/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Desktop from './desktop'; | ||
import Mobile from './mobile'; | ||
|
||
export { | ||
Desktop, | ||
Mobile, | ||
}; |
75 changes: 75 additions & 0 deletions
75
src/screens/account_details/components/cw20_token_balances/components/mobile/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import React from 'react'; | ||
import classnames from 'classnames'; | ||
import useTranslation from 'next-translate/useTranslation'; | ||
import { | ||
Divider, | ||
Typography, | ||
} from '@material-ui/core'; | ||
import { AvatarName } from '@components'; | ||
import { formatNumber } from '@utils/format_token'; | ||
import { Cw20TokenBalance } from '@src/screens/account_details/types'; | ||
import { getMiddleEllipsis } from '@src/utils/get_middle_ellipsis'; | ||
import { TOKEN_DETAILS } from '@src/utils/go_to_page'; | ||
import { useStyles } from './styles'; | ||
|
||
const Mobile: React.FC<{ | ||
className?: string; | ||
balances?: Cw20TokenBalance[] | ||
}> = ({ | ||
className, | ||
balances, | ||
}) => { | ||
const classes = useStyles(); | ||
const { t } = useTranslation('accounts'); | ||
|
||
return ( | ||
<div className={classnames(className)}> | ||
{balances.map((b, i) => { | ||
return ( | ||
<React.Fragment key={`votes-mobile-${i}`}> | ||
<div className={classes.list}> | ||
<div className={classes.item}> | ||
<Typography variant="h4" className="label"> | ||
{t('token')} | ||
</Typography> | ||
<AvatarName | ||
name={`${b.name} (${b.denom.toUpperCase()})`} | ||
address={b.tokenAddress} | ||
imageUrl={b.logo} | ||
href={TOKEN_DETAILS} | ||
/> | ||
</div> | ||
<div className={classes.flex}> | ||
<div className={classes.item}> | ||
<Typography variant="h4" className="label"> | ||
{t('balance')} | ||
</Typography> | ||
<Typography variant="body1" className="value"> | ||
{formatNumber(b.balance.toString(), b.exponent)} | ||
{' '} | ||
{b.denom.toUpperCase()} | ||
</Typography> | ||
</div> | ||
</div> | ||
<div className={classes.flex}> | ||
<div className={classes.item}> | ||
<Typography variant="h4" className="label"> | ||
{t('address')} | ||
</Typography> | ||
<Typography variant="body1" className="value"> | ||
{getMiddleEllipsis(b.tokenAddress, { | ||
beginning: 15, ending: 10, | ||
})} | ||
</Typography> | ||
</div> | ||
</div> | ||
</div> | ||
{i !== balances.length - 1 && <Divider />} | ||
</React.Fragment> | ||
); | ||
})} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Mobile; |
Oops, something went wrong.