-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add token-transfer for address detail
- Loading branch information
Tien Nam Dao
committed
Oct 11, 2022
1 parent
39d5a7c
commit b56d0cf
Showing
37 changed files
with
2,848 additions
and
114 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import clsx from 'clsx' | ||
import { useState } from 'react' | ||
|
||
import styles from './style.module.scss' | ||
/*** | ||
* @param textCopy text copy into clipboard | ||
* @param textTitle text show on screen | ||
* @param onCopy trigger event copy | ||
* @param iconCopy only copy when user click on icon | ||
*/ | ||
interface Props { | ||
classes?: string | ||
textTitle?: string | ||
textClasses?: string | ||
content: string | ||
} | ||
|
||
const QrButton = ({ textTitle, textClasses, content, classes }: Props) => { | ||
const [view, setView] = useState(false) | ||
|
||
const onShowQr = (e: any) => { | ||
e.preventDefault() | ||
} | ||
|
||
return ( | ||
<a onClick={onShowQr} className={clsx('link block-hor-center contrast-color-100')}> | ||
{textTitle && <span className={clsx(styles.text, textClasses)}>{textTitle}</span>} | ||
<span className={clsx('padding-left-xs pointer qr-icon contrast-color-100')} /> | ||
</a> | ||
) | ||
} | ||
|
||
export default QrButton |
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,15 @@ | ||
.layoutContainer { | ||
min-height: 100vh; | ||
.layout { | ||
min-height: 56vh; | ||
} | ||
} | ||
|
||
@media (max-width: 960px) { | ||
.layoutContainer { | ||
min-height: 70vh; | ||
.layout { | ||
min-height: 50vh; | ||
} | ||
} | ||
} |
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
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
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,11 +1,71 @@ | ||
import { Breadcumbs } from '@astraprotocol/astra-ui' | ||
import Container from 'components/Container' | ||
import Head from 'next/head' | ||
import React from 'react' | ||
import { GetStaticProps } from 'next' | ||
import { ellipseBetweenText, LinkMaker } from 'utils/helper' | ||
import AddressDetailTabs from 'views/accounts/AddressDetailTabs' | ||
import AddressOverview from 'views/accounts/AddressOverview' | ||
import web3 from 'web3' | ||
import Layout from '../../components/Layout' | ||
|
||
type Props = {} | ||
type Props = { | ||
address: string | ||
} | ||
|
||
const AddressDetailPage: React.FC<Props> = props => { | ||
return <Layout>Implement Here</Layout> | ||
const { address } = props | ||
|
||
return ( | ||
<Layout> | ||
<Head> | ||
<title> | ||
Address {address} - {process.env.NEXT_PUBLIC_TITLE} | ||
</title> | ||
</Head> | ||
<Container> | ||
<Breadcumbs | ||
items={[{ label: 'Address', link: LinkMaker.address() }, { label: ellipseBetweenText(address) }]} | ||
/> | ||
<AddressOverview address={address} /> | ||
<AddressDetailTabs address={address} /> | ||
</Container> | ||
</Layout> | ||
) | ||
} | ||
|
||
export async function getServerSideProps({ params }) { | ||
const { address } = params | ||
if (web3.utils.isAddress(address)) | ||
return { | ||
props: { | ||
address | ||
} | ||
} | ||
// try { | ||
// const blockRes = await cosmosApi.get<BlockDetailResponse>(`${API_LIST.BLOCKS}${blockHeight}`) | ||
// const transactionRes = await cosmosApi.get<TransactionResponse>( | ||
// `${API_LIST.TRANSACTION_OF_BLOCK.replace(':id', blockHeight)}` | ||
// ) | ||
// const transactions = transactionRes.data.result | ||
// if (blockRes.status === 200) { | ||
// return { props: { blockDetail: blockRes.data.result, blockHeight, transactions } } | ||
// } else { | ||
// return { props: { data: {} } } | ||
// } | ||
// } catch (e) { | ||
// return { | ||
// redirect: { | ||
// destination: '/404', | ||
// permanent: false | ||
// } | ||
// } | ||
// } | ||
return { | ||
redirect: { | ||
destination: '/404', | ||
permanent: false | ||
} | ||
} | ||
} | ||
|
||
export default AddressDetailPage |
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
Oops, something went wrong.