Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: replace deprecated mixins with text component in loading-swaps-quotes #25553

Merged
merged 6 commits into from
Aug 12, 2024
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
22 changes: 0 additions & 22 deletions ui/pages/swaps/loading-swaps-quotes/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,6 @@
max-height: 445px;
}

&__quote-counter {
@include design-system.H7;

color: var(--color-text-alternative);
margin-top: 3px;
display: flex;
justify-content: center;
width: 100%;
margin-bottom: 4px;
}

&__quote-name-check {
@include design-system.H4;

font-weight: bold;
color: var(--color-text-default);
display: flex;
justify-content: center;
width: 100%;
text-transform: capitalize;
}

&__background-1,
&__background-2 {
width: 265.18px;
Expand Down
34 changes: 30 additions & 4 deletions ui/pages/swaps/loading-swaps-quotes/loading-swaps-quotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ import { MetaMetricsContext } from '../../../contexts/metametrics';
import Mascot from '../../../components/ui/mascot';
import { MetaMetricsEventCategory } from '../../../../shared/constants/metametrics';
import SwapsFooter from '../swaps-footer';
import { Text } from '../../../components/component-library';
import {
TextVariant,
TextColor,
BlockSize,
Display,
JustifyContent,
TextTransform,
} from '../../../helpers/constants/design-system';
import BackgroundAnimation from './background-animation';

export default function LoadingSwapsQuotes({
Expand Down Expand Up @@ -118,17 +127,34 @@ export default function LoadingSwapsQuotes({
<div className="loading-swaps-quotes">
<div className="loading-swaps-quotes__content">
<>
<div className="loading-swaps-quotes__quote-counter">
<Text
variant={TextVariant.bodyXs}
data-testid="loading-swaps-quotes-quote-counter"
color={TextColor.textAlternative}
marginTop={1}
display={Display.Flex}
justifyContent={JustifyContent.center}
width={BlockSize.Full}
marginBottom={1}
>
<span>
{t('swapFetchingQuoteNofN', [
Math.min(quoteCount + 1, numberOfQuotes),
numberOfQuotes,
])}
</span>
</div>
<div className="loading-swaps-quotes__quote-name-check">
</Text>
<Text
variant={TextVariant.headingSm}
data-testid="loading-swaps-quotes-quote-name-check"
color={TextColor.textDefault}
display={Display.Flex}
justifyContent={JustifyContent.center}
width={BlockSize.Full}
textTransform={TextTransform.Capitalize}
>
<span>{t('swapFetchingQuotes')}</span>
</div>
</Text>
<div className="loading-swaps-quotes__loading-bar-container">
<div
className="loading-swaps-quotes__loading-bar"
Expand Down