Skip to content

Commit

Permalink
added link to games from profile and tx table
Browse files Browse the repository at this point in the history
  • Loading branch information
Gorshtak committed Mar 6, 2023
1 parent 00edfc2 commit ba80611
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 13 deletions.
28 changes: 21 additions & 7 deletions src/components/ParlayTransactionsTable/ParlayTransactionsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
convertPositionNameToPositionType,
formatMarketOdds,
getOddTooltipText,
getParentMarketAddress,
getSpreadTotalText,
getSymbolText,
isParlayClaimable,
Expand All @@ -31,12 +32,16 @@ import { ShareTicketModalProps } from 'pages/Markets/Home/Parlay/components/Shar
import { Position } from 'constants/options';
import { ethers } from 'ethers';
import { CollateralByNetworkId } from 'utils/network';
import { buildMarketLink } from 'utils/routes';
import i18n from 'i18n';
import SPAAnchor from 'components/SPAAnchor';

const ParlayTransactionsTable: React.FC<{ parlayTx: ParlayMarket[]; searchText?: string }> = ({
parlayTx,
searchText,
}) => {
const { t } = useTranslation();
const language = i18n.language;
const selectedOddsType = useSelector(getOddsType);
const networkId = useSelector((state: RootState) => getNetworkId(state));

Expand Down Expand Up @@ -232,15 +237,24 @@ const ParlayTransactionsTable: React.FC<{ parlayTx: ParlayMarket[]; searchText?:

const symbolText = getSymbolText(positionEnum, position.market);
const spreadTotalText = getSpreadTotalText(position.market, positionEnum);

return (
<ParlayRow style={{ opacity: getOpacity(position) }} key={index}>
<ParlayRowText>
{getPositionStatus(position)}
<ParlayRowTeam title={position.market.homeTeam + ' vs ' + position.market.awayTeam}>
{position.market.homeTeam + ' vs ' + position.market.awayTeam}
</ParlayRowTeam>
</ParlayRowText>
<SPAAnchor
href={buildMarketLink(
getParentMarketAddress(position.market.parentMarket, position.market.address),
language
)}
>
<ParlayRowText style={{ cursor: 'pointer' }}>
{getPositionStatus(position)}
<ParlayRowTeam
title={position.market.homeTeam + ' vs ' + position.market.awayTeam}
>
{position.market.homeTeam + ' vs ' + position.market.awayTeam}
</ParlayRowTeam>
</ParlayRowText>
</SPAAnchor>

<PositionSymbol
symbolAdditionalText={{
text: formatMarketOdds(selectedOddsType, quote),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
convertPositionNameToPositionType,
formatMarketOdds,
getOddTooltipText,
getParentMarketAddress,
getSpreadTotalText,
getSymbolText,
isParlayClaimable,
Expand All @@ -32,9 +33,13 @@ import { ShareTicketModalProps } from 'pages/Markets/Home/Parlay/components/Shar
import { Position } from 'constants/options';
import { ethers } from 'ethers';
import { CollateralByNetworkId } from 'utils/network';
import { buildMarketLink } from 'utils/routes';
import SPAAnchor from 'components/SPAAnchor';
import i18n from 'i18n';

const ParlayTransactions: React.FC<{ searchText?: string }> = ({ searchText }) => {
const { t } = useTranslation();
const language = i18n.language;
const selectedOddsType = useSelector(getOddsType);
const walletAddress = useSelector((state: RootState) => getWalletAddress(state)) || '';
const isWalletConnected = useSelector((state: RootState) => getIsWalletConnected(state));
Expand Down Expand Up @@ -248,12 +253,21 @@ const ParlayTransactions: React.FC<{ searchText?: string }> = ({ searchText }) =

return (
<ParlayRow style={{ opacity: getOpacity(position) }} key={index}>
<ParlayRowText>
{getPositionStatus(position)}
<ParlayRowTeam title={position.market.homeTeam + ' vs ' + position.market.awayTeam}>
{position.market.homeTeam + ' vs ' + position.market.awayTeam}
</ParlayRowTeam>
</ParlayRowText>
<SPAAnchor
href={buildMarketLink(
getParentMarketAddress(position.market.parentMarket, position.market.address),
language
)}
>
<ParlayRowText style={{ cursor: 'pointer' }}>
{getPositionStatus(position)}
<ParlayRowTeam
title={position.market.homeTeam + ' vs ' + position.market.awayTeam}
>
{position.market.homeTeam + ' vs ' + position.market.awayTeam}
</ParlayRowTeam>
</ParlayRowText>
</SPAAnchor>
<PositionSymbol
symbolAdditionalText={{
text: formatMarketOdds(selectedOddsType, quote),
Expand Down

0 comments on commit ba80611

Please sign in to comment.