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

Add backgroundColor property to Container component #2950

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

david0xd
Copy link
Contributor

@david0xd david0xd commented Dec 11, 2024

This PR adds backgroundColor property to Container component.

Related task: #2906
Related extension PR: MetaMask/metamask-extension#29095

Notes

Examples (experiments with extension integration)

Confirmation example:
Screenshot 2024-12-11 at 13 14 02

Source code used for content:

      return snap.request({
        method: 'snap_dialog',
        params: {
          content: (
            <Container backgroundColor="default">
              <Box>
                <Text>Testing container background.</Text>
                <Button variant="primary">Primary button</Button>
                <Button variant="destructive">Destructive button</Button>
                <Button disabled={true}>Disabled button</Button>
              </Box>
              <Footer>
                <Button>Accept</Button>
                <Button name="footer_button">Cancel</Button>
              </Footer>
            </Container>
          ),
        },
      });

Transaction insight example where background color is deliberately ignored:
Screenshot 2024-12-11 at 13 07 40
Source code used for content:

    return {
      content: (
        <Container backgroundColor="alternative">
          <Box>
            <Text>Testing container background on transaction insight.</Text>
            <Text>Normal transaction.</Text>
          </Box>
        </Container>
      ),
      severity: SeverityLevel.Critical,
    };

@david0xd david0xd self-assigned this Dec 11, 2024
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.72%. Comparing base (5159929) to head (3e62e75).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2950   +/-   ##
=======================================
  Coverage   94.72%   94.72%           
=======================================
  Files         497      497           
  Lines       10826    10826           
  Branches     1654     1654           
=======================================
  Hits        10255    10255           
  Misses        571      571           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@david0xd david0xd force-pushed the dd/ui-container-background branch from eecfa9d to f3306bf Compare December 11, 2024 13:18
@david0xd david0xd marked this pull request as ready for review December 11, 2024 13:37
@david0xd david0xd requested a review from a team as a code owner December 11, 2024 13:37
Minor refactoring

Update manifest shasum

Update manifest shasum

Revert Box changes
@david0xd david0xd force-pushed the dd/ui-container-background branch from 9953986 to 3e62e75 Compare January 9, 2025 13:17
@FrederikBolding
Copy link
Member

FrederikBolding commented Jan 9, 2025

@david0xd We may wanna hold off on merging this until we have it working fully in extension with swapping the Section color etc

Otherwise, LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants