Skip to content

Commit

Permalink
refactor: replace deprecated mixins with Text component in qr-code-vi…
Browse files Browse the repository at this point in the history
…ew (#25637)

## **Description**

This pull request replaces deprecated mixins @include H1 - @include H9
in the SCSS file with the Text component in the `qr-code-view`
component. The changes include updating the SCSS file to remove the
deprecated mixins and modifying the JavaScript file to use the Text
component with appropriate properties.

Devin Run Link :
https://preview.devin.ai/devin/8158744e0716415fb64b023769e4ffab

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25637?quickstart=1)

## **Related issues**

Partially Fixes:
#20496

## **Manual testing steps**

1. Go to the latest build of storybook in this PR
2. Verify that the QrCodeView component renders correctly without any
visual issues
3. Ensure that the Text component is used instead of the deprecated
mixins

## **Screenshots/Recordings**

### **Before**

![Before
Changes](https://api.devin.ai/attachments/9a8904f8-6bff-4d54-90c8-2b0522e7f345/79852720-e3a7-4bb5-b62a-38679aca0b28.png)

### **After**

![After
Changes](https://api.devin.ai/attachments/9a8904f8-6bff-4d54-90c8-2b0522e7f345/79852720-e3a7-4bb5-b62a-38679aca0b28.png)

## **Pre-merge author checklist**

- [X] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [X] I've completed the PR template to the best of my ability
- [X] I’ve included tests if applicable
- [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [X] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

[This Devin
run](https://preview.devin.ai/devin/8158744e0716415fb64b023769e4ffab)
was requested by Devin.

---------

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: George Marshall <[email protected]>
  • Loading branch information
2 people authored and dawnseeker8 committed Aug 12, 2024
1 parent 8871567 commit 5510b7a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
16 changes: 0 additions & 16 deletions ui/components/ui/qr-code-view/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
color: var(--color-text-muted);
}

&__message {
@include design-system.H7;

color: var(--color-warning-default);
}

&__error {
display: flex;
justify-content: center;
Expand All @@ -37,14 +31,4 @@
width: 100%;
}
}

&__address {
@include design-system.H7;

background-color: var(--color-background-alternative);
width: 76%;
padding: 8px 12px;
word-break: break-all;
text-align: center;
}
}
13 changes: 11 additions & 2 deletions ui/components/ui/qr-code-view/qr-code-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ import {
MetaMetricsEventName,
} from '../../../../shared/constants/metametrics';
import type { CombinedBackgroundAndReduxState } from '../../../store/store';
import { Text } from '../../component-library';
import {
TextVariant,
TextColor,
} from '../../../helpers/constants/design-system';

export default connect(mapStateToProps)(QrCodeView);

Expand Down Expand Up @@ -49,9 +54,13 @@ function QrCodeView({
{Array.isArray(message) ? (
<div className="qr-code__message-container">
{message.map((msg, index) => (
<div className="qr_code__message" key={index}>
<Text
key={index}
variant={TextVariant.bodyXs}
color={TextColor.warningDefault}
>
{msg}
</div>
</Text>
))}
</div>
) : (
Expand Down

0 comments on commit 5510b7a

Please sign in to comment.