Skip to content

Commit

Permalink
interface fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
radumojic committed Mar 15, 2024
1 parent 52d3ff1 commit 7b2b1de
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 18 deletions.
8 changes: 8 additions & 0 deletions src/assets/scss/_shared-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -483,3 +483,11 @@ img.loading {
);
background-size: contain;
}

.text-break {
word-wrap: break-word;
word-break: break-word;
white-space: break-spaces;
overflow-wrap: break-word; // inline elements
line-break: auto; // characters
}
6 changes: 3 additions & 3 deletions src/components/HeroDetailsCard/HeroDetailsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export const HeroDetailsCard = ({
<div className='hero-details-card-overview d-flex flex-column flex-fill col-9'>
{title && (
<div
className={classNames('hero-details-card-title', {
className={classNames('hero-details-card-title text-break', {
'mb-spacer': !Boolean(description || descriptionContent)
})}
>
Expand Down Expand Up @@ -173,9 +173,9 @@ export const HeroDetailsCard = ({
})}
data-testid={`${testIdPrefix}title`}
>
<span>{title}</span>{' '}
<span className='title-container'>{title}</span>
{isVerified && (
<>{verifiedComponent ?? <VerifiedBadge />}</>
<> {verifiedComponent ?? <VerifiedBadge />}</>
)}
</h1>
</div>
Expand Down
14 changes: 8 additions & 6 deletions src/components/HeroDetailsCard/heroDetailsCard.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
@include media-breakpoint-up(xxl) {
&.has-content {
display: contents;
span {
.title-container {
display: block;
max-width: 46rem;
overflow: hidden;
Expand All @@ -72,17 +72,19 @@
}
}
.trim {
max-width: calc(90vw - 4rem);
max-width: calc(90vw - 5rem);
letter-spacing: normal;
span {
.left span,
.right span,
.ellipsis {
font-size: 1.5rem;
letter-spacing: normal;
@include media-breakpoint-up(md) {
font-size: 2.5rem;
}
}
@include media-breakpoint-up(md) {
max-width: 32rem;
span {
font-size: 2.5rem;
}
}
@include media-breakpoint-up(lg) {
max-width: 44rem;
Expand Down
7 changes: 7 additions & 0 deletions src/components/Trim/trim.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@
color: var(--primary-200);
}
}
&.text-neutral-400 {
.ellipsis,
.left span,
.right span {
color: var(--neutral-400);
}
}

/* IE fix */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ export const TransactionErrorDisplay = ({
transform={{ rotate: 45 }}
/>
<div className='d-flex flex-wrap'>
<small className={`${messageColor} transaction-error-message me-1`}>
<small
className={`${messageColor} transaction-error-message text-break me-1`}
>
{capitalizeFirstLetter(transactionMessage.toString().trim())}
</small>
<div className='d-flex align-items-center justify-content-center gap-1'>
Expand Down Expand Up @@ -111,7 +113,7 @@ export const TransactionErrorDisplay = ({
style={{ marginTop: '2px' }}
transform={{ rotate: 45 }}
/>
<small className='transaction-error-message text-danger'>
<small className='transaction-error-message text-break text-danger'>
Block Reverted
</small>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
.transaction-info {
.transaction-error-message {
font-size: 0.75rem; // use rem instead of em because on long texts Chrome breaks the layout
word-wrap: break-word;
word-break: break-word;
white-space: break-spaces;
overflow-wrap: break-word; // inline elements
line-break: auto; // characters
}

.status-success {
Expand Down
1 change: 1 addition & 0 deletions src/types/growthWidgets/mostUsed.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface MostUsedApplicationsType extends MostUsedBaseType {
extraInfo?: {
assets?: AccountAssetType;
deployedAt?: number;
isVerified?: boolean;
};
}

Expand Down
16 changes: 14 additions & 2 deletions src/widgets/MostUsed/MostUsedApplications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import BigNumber from 'bignumber.js';
import classNames from 'classnames';
import { useSelector } from 'react-redux';

import { Loader, ShowcaseCard, Trim, NetworkLink } from 'components';
import { Loader, Overlay, ShowcaseCard, Trim, NetworkLink } from 'components';
import { urlBuilder, addressIsBech32 } from 'helpers';
import { useIsMainnet, useFetchGrowthMostUsed, useScollInView } from 'hooks';
import { faAngleLeft, faAngleRight } from 'icons/solid';
import { faAngleLeft, faAngleRight, faBadgeCheck } from 'icons/solid';
import { growthMostUsedSelector } from 'redux/selectors';
import { applicationsRoutes } from 'routes';
import { WithClassnameType } from 'types';
Expand Down Expand Up @@ -121,6 +121,18 @@ export const MostUsedApplications = ({
{contract.extraInfo?.assets?.name ?? (
<Trim text={contract.key} />
)}
{contract.extraInfo?.isVerified && (
<Overlay
title='Verified'
className='ms-1 d-inline-flex align-self-center'
>
<FontAwesomeIcon
icon={faBadgeCheck}
size='2xs'
className='text-primary'
/>
</Overlay>
)}
</span>
}
icon={
Expand Down

0 comments on commit 7b2b1de

Please sign in to comment.