Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -22,6 +22,7 @@ import {
HashId
} from '@audius/sdk'
import moment from 'moment'
import { useNavigate } from 'react-router-dom-v5-compat'
import { Cell } from 'react-table'

import { TokenIcon } from 'components/buy-sell-modal/TokenIcon'
Expand DownExpand Up@@ -140,7 +141,10 @@ const renderBuyCell = (
css={{
boxShadow: '0 0 0 1px inset var(--harmony-border-default) !important'
}}
onClick={() => handleBuy(coin.ticker ?? '')}
onClick={(e) => {
e.stopPropagation()
handleBuy(coin.ticker ?? '')
}}
>
{walletMessages.buy}
</Button>
Expand DownExpand Up@@ -238,6 +242,7 @@ const isEmptyRow = (row: any) => {

export const ArtistCoinsTable = ({ searchQuery }: ArtistCoinsTableProps) => {
const mainContentRef = useMainContentRef()
const navigate = useNavigate()
const { onOpen: openBuySellModal } = useBuySellModal()
const [sortMethod, setSortMethod] = useState<GetCoinsSortMethodEnum>(
GetCoinsSortMethodEnum.MarketCap
Expand DownExpand Up@@ -283,6 +288,16 @@ export const ArtistCoinsTable = ({ searchQuery }: ArtistCoinsTableProps) => {
[openBuySellModal]
)

const handleRowClick = useRequiresAccountCallback(
(e: React.MouseEvent<HTMLTableRowElement>, rowInfo: any) => {
const coin = rowInfo.original
if (coin?.ticker) {
navigate(ASSET_DETAIL_PAGE.replace(':ticker', coin.ticker))
}
},
[navigate]
)

const columns = useMemo(() => {
const baseColumns = { ...tableColumnMap }
baseColumns.buy = {
Expand DownExpand Up@@ -329,6 +344,7 @@ export const ArtistCoinsTable = ({ searchQuery }: ArtistCoinsTableProps) => {
data={coins}
isVirtualized
onSort={onSort}
onClickRow={handleRowClick}
isEmptyRow={isEmptyRow}
fetchMore={fetchMore}
fetchBatchSize={ARTIST_COINS_BATCH_SIZE}
Expand Down