Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 1 addition & 5 deletions src/containers/AMMPool/InfoCards/AuctionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const AuctionCard: FC<AuctionCardProps> = ({
replacementCostRaw != null ? getLPTokenUSD(replacementCostRaw) : null

return (
<div className="amm-pool-info-card">
<div className="info-card">
<h3 className="info-card-title">
<AuctionIcon className="info-card-icon" />
{t('auction')}
Expand All @@ -142,7 +142,6 @@ export const AuctionCard: FC<AuctionCardProps> = ({
)}
</span>
</div>
<div className="info-card-separator" />
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remove these lines since we no longer explicitly need a div element to create the divider line. That will be achieved using CSS.

<div className="info-card-row">
<span className="info-card-label">{t('expiration')}</span>
<span className="info-card-value">
Expand All @@ -155,14 +154,12 @@ export const AuctionCard: FC<AuctionCardProps> = ({
: '--'}
</span>
</div>
<div className="info-card-separator" />
<div className="info-card-row">
<span className="info-card-label">{t('discounted_fee')}</span>
<span className="info-card-value info-card-value-orange">
{discountedFee}
</span>
</div>
<div className="info-card-separator" />
<div className="info-card-row">
<span className="info-card-label">{t('price_paid')}</span>
<span className="info-card-value">
Expand All @@ -182,7 +179,6 @@ export const AuctionCard: FC<AuctionCardProps> = ({
)}
</span>
</div>
<div className="info-card-separator" />
<div className="info-card-row">
<span className="info-card-label">{t('replacement_cost')}</span>
<span className="info-card-value">
Expand Down
29 changes: 12 additions & 17 deletions src/containers/AMMPool/InfoCards/BasicInfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const BasicInfoCard: FC<BasicInfoCardProps> = ({
: '--'

return (
<div className="amm-pool-info-card">
<div className="info-card">
<h3 className="info-card-title">
<BasicInfoIcon className="info-card-icon" />
{t('basic_info')}
Expand All @@ -54,29 +54,24 @@ export const BasicInfoCard: FC<BasicInfoCardProps> = ({
</span>
</div>
{lpTokenCurrency && (
<>
<div className="info-card-separator" />
<div className="info-card-row">
<span className="info-card-label">
{t('lp_token_currency_code')}
</span>
<span className="info-card-value">
<CopyableText
text={lpTokenCurrency}
displayText={shortenLPToken(lpTokenCurrency)}
/>
</span>
</div>
</>
<div className="info-card-row">
<span className="info-card-label">
{t('lp_token_currency_code')}
</span>
<span className="info-card-value">
<CopyableText
text={lpTokenCurrency}
displayText={shortenLPToken(lpTokenCurrency)}
/>
</span>
</div>
)}
<div className="info-card-separator" />
<div className="info-card-row">
<span className="info-card-label">{t('trading_fee')}</span>
<span className="info-card-value info-card-value-orange">
{tradingFeePercent}%
</span>
</div>
<div className="info-card-separator" />
<div className="info-card-row">
<span className="info-card-label">{t('created_on')}</span>
<span className="info-card-value">{createdDate}</span>
Expand Down
74 changes: 31 additions & 43 deletions src/containers/AMMPool/InfoCards/MarketDataCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const MarketDataCard: FC<MarketDataCardProps> = ({
)

return (
<div className="amm-pool-info-card">
<div className="info-card">
<h3 className="info-card-title">
<MarketDataIcon className="info-card-icon" />
{t('market_data')}
Expand All @@ -84,7 +84,6 @@ export const MarketDataCard: FC<MarketDataCardProps> = ({
: '--'}
</span>
</div>
<div className="info-card-separator" />
<div className="info-card-row">
<span className="info-card-label">
{t('volume_24h')}
Expand All @@ -96,7 +95,6 @@ export const MarketDataCard: FC<MarketDataCardProps> = ({
: '--'}
</span>
</div>
<div className="info-card-separator" />
<div className="info-card-row">
<span className="info-card-label">
{t('fees_24h')}
Expand All @@ -108,7 +106,6 @@ export const MarketDataCard: FC<MarketDataCardProps> = ({
: '--'}
</span>
</div>
<div className="info-card-separator" />
<div className="info-card-row">
<span className="info-card-label">
{t('apr_24h')}
Expand All @@ -123,49 +120,40 @@ export const MarketDataCard: FC<MarketDataCardProps> = ({
</>
)}
{balance1 && (
<>
<div className="info-card-separator" />
<div className="info-card-row">
<BalanceLabel
currency={balance1.currency}
issuer={balance1.issuer}
/>
<span className="info-card-value">
{parseAmount(balance1.amount)}
</span>
</div>
</>
<div className="info-card-row">
<BalanceLabel
currency={balance1.currency}
issuer={balance1.issuer}
/>
<span className="info-card-value">
{parseAmount(balance1.amount)}
</span>
</div>
)}
{balance2 && (
<>
<div className="info-card-separator" />
<div className="info-card-row">
<BalanceLabel
currency={balance2.currency}
issuer={balance2.issuer}
/>
<span className="info-card-value">
{parseAmount(balance2.amount)}
</span>
</div>
</>
<div className="info-card-row">
<BalanceLabel
currency={balance2.currency}
issuer={balance2.issuer}
/>
<span className="info-card-value">
{parseAmount(balance2.amount)}
</span>
</div>
)}
{lpTokenBalance && (
<>
<div className="info-card-separator" />
<div className="info-card-row">
<span className="info-card-label">{t('lp_tokens')}</span>
<span className="info-card-value">
<div>{parseAmount(lpTokenBalance)}</div>
{losData && (
<div className="info-card-subtitle">
{parseIntegerAmount(losData.liquidity_provider_count)}{' '}
{t('liquidity_providers')}
</div>
)}
</span>
</div>
</>
<div className="info-card-row">
<span className="info-card-label">{t('lp_tokens')}</span>
<span className="info-card-value">
<div>{parseAmount(lpTokenBalance)}</div>
{losData && (
<div className="info-card-subtitle">
{parseIntegerAmount(losData.liquidity_provider_count)}{' '}
{t('liquidity_providers')}
</div>
)}
</span>
</div>
)}
</div>
</div>
Expand Down
97 changes: 1 addition & 96 deletions src/containers/AMMPool/styles.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@use '../shared/css/variables' as *;
@use '../shared/css/table';
@use '../shared/css/data-tables-notice';
@use '../shared/css/info-card';

.amm-pool-page {
.loader {
Expand Down Expand Up @@ -139,102 +140,6 @@
}
}

.amm-pool-info-card {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The follow block is removed and the similar CSS is put in info-card.scss to avoid duplicate CSS

padding: 24px;
border: 1px solid $black-60;
border-radius: 8px;
background: $black-80;

.info-card-title {
display: flex;
align-items: center;
margin: 0 0 16px;
color: $white;
font-size: 20px;
gap: 8px;
@include bold;
}

.info-card-icon {
width: 24px;
height: 24px;
flex-shrink: 0;
}

.info-card-rows {
display: flex;
flex-direction: column;
gap: 10px;
}

.info-card-row {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 4px;

&:not(:last-child)::after {
display: none;
}
}

.info-card-separator {
width: 100%;
height: 1px;
background: $black-60;
}

.info-card-label {
display: flex;
align-items: center;
color: $black-40;
font-size: 14px;
line-height: 1.5;
text-transform: uppercase;
@include semibold;

.hover {
width: 14px;
height: 14px;
margin-left: 4px;
cursor: default;
}
}

.info-card-value {
color: $white;
font-size: 14px;
line-height: 1.5;
text-align: right;
word-break: break-all;
@include regular;

&-green {
color: $green;
}

&-orange {
color: $orange;
}

&-link {
color: $green-30;

a {
color: $green-30;
}
}
}

.info-card-subtitle {
margin-top: 4px;
color: $black-40;
font-size: 12px;
line-height: 1.5;
@include regular;
}
}

// ============================================================
// Tables section (matching IOU Token page tab style)
// ============================================================
Expand Down
56 changes: 26 additions & 30 deletions src/containers/AMMRankings/GeneralInfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,55 +53,51 @@ export const GeneralInfoCard: FC<GeneralInfoCardProps> = ({
)

return (
<div className="general-info-card">
<div className="card-header">
<InfoIcon className="info-icon" />
<span className="card-title">{t('general_info')}</span>
</div>

<div className="stats-container">
<div className="stat-row">
<div className="stat-label">
<div className="info-card">
<h3 className="info-card-title">
<InfoIcon className="info-card-icon" />
{t('general_info')}
</h3>
<div className="info-card-rows">
<div className="info-card-row">
<span className="info-card-label">
{t('tvl')}
{renderTooltip('tvl')}
</div>
<div className="stat-value">
</span>
<span className="info-card-value">
{tvl ? formatCurrencyAmount(tvl) : DEFAULT_EMPTY_VALUE}
</div>
</span>
</div>

<div className="stat-row">
<div className="stat-label">
<div className="info-card-row">
<span className="info-card-label">
{t('number_of_amms')}
{renderTooltip('number_of_amms')}
</div>
<div className="stat-value">
</span>
<span className="info-card-value">
{stats.amm_pool_count
? stats.amm_pool_count.toLocaleString()
: DEFAULT_EMPTY_VALUE}
</div>
</span>
</div>

<div className="stat-row">
<div className="stat-label">
<div className="info-card-row">
<span className="info-card-label">
{t('number_of_lps')}
{renderTooltip('number_of_lps')}
</div>
<div className="stat-value">
</span>
<span className="info-card-value">
{stats.liquidity_provider_count
? stats.liquidity_provider_count.toLocaleString()
: DEFAULT_EMPTY_VALUE}
</div>
</span>
</div>

<div className="stat-row">
<div className="stat-label">
<div className="info-card-row">
<span className="info-card-label">
{t('volume_24h' as any)}
{renderTooltip('volume_24h_all')}
</div>
<div className="stat-value">
</span>
<span className="info-card-value">
{volume24h ? formatCurrencyAmount(volume24h) : DEFAULT_EMPTY_VALUE}
</div>
</span>
</div>
</div>
</div>
Expand Down
Loading
Loading