Skip to content

Conversation

@david0xd
Copy link
Contributor

@david0xd david0xd commented Dec 6, 2024

Description

This PR enables loading button variant for Snaps UI.

Open in GitHub Codespaces

Notes

Related issues

Fixes: MetaMask/snaps#2694

Related PR dependencies

Snaps monorepo: MetaMask/snaps#2930

Manual testing steps

  1. Create some example Snap for testing and add Snap UI Button with loading variant.
    Example:
<Button loading={true} variant="primary">
    Example Button
</Button>
<Button loading={true} variant="destructive">
    Example Button
</Button>

Screenshots/Recordings

Before

Loading button variant was not available before.

After

Screen.Recording.2024-12-09.at.16.26.44.mov

Pre-merge author checklist

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.

@david0xd david0xd added the team-snaps-platform-deprecated DEPRECATED: please use "team-core-platform" instead (or "team-new-networks" for Solana snap issues) label Dec 6, 2024
@david0xd david0xd self-assigned this Dec 6, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2024

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot
Copy link
Collaborator

Builds ready [346d6c6]
Page Load Metrics (1994 ± 83 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint30023931766631303
domContentLoaded16462386196716881
load16822394199417283
domInteractive25563284
backgroundConnect889292311
firstReactRender1693272010
getState842971525727
initialActions01000
loadScripts12001958150916981
setupStore77713157
uiStartup193628562351231111
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 151 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

david0xd added a commit to MetaMask/snaps that referenced this pull request Dec 9, 2024
This PR adds loading variant for Snap UI button. This button shows
loading icon with an infinite animation.

Related ticket: #2694
Related extension PR:
MetaMask/metamask-extension#28997

Loading button in action:


https://github.com/user-attachments/assets/a2f15262-dc68-44cb-bbd2-22e288d9d09c
@david0xd david0xd force-pushed the dd/add-snap-ui-loading-btn branch from a9f1364 to b63ac7c Compare December 17, 2024 13:37
@david0xd david0xd changed the base branch from main to fb/snaps-bump-v81 December 17, 2024 13:37
@david0xd david0xd marked this pull request as ready for review December 17, 2024 13:40
@david0xd david0xd requested a review from a team as a code owner December 17, 2024 13:40
@david0xd david0xd force-pushed the dd/add-snap-ui-loading-btn branch from 0885cec to eb52e60 Compare December 17, 2024 14:59
@david0xd david0xd merged commit 70c7e35 into fb/snaps-bump-v81 Dec 17, 2024
63 of 68 checks passed
@david0xd david0xd deleted the dd/add-snap-ui-loading-btn branch December 17, 2024 15:14
@github-actions github-actions bot locked and limited conversation to collaborators Dec 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

team-snaps-platform-deprecated DEPRECATED: please use "team-core-platform" instead (or "team-new-networks" for Solana snap issues)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce loading states to our custom UI buttons

4 participants