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

fix: Swap out Spinner component exposed to Snaps #29143

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented Dec 12, 2024

Description

Swap out the Spinner component exposed to Snaps for the Preloader component.

Open in GitHub Codespaces

Screenshots/Recordings

image

Manual Testing Steps

import type { OnRpcRequestHandler } from '@metamask/snaps-sdk';
import { Box, Spinner } from '@metamask/snaps-sdk/jsx';

/**
 * Handle incoming JSON-RPC requests, sent through `wallet_invokeSnap`.
 *
 * @param args - The request handler args as object.
 * @param args.origin - The origin of the request, e.g., the website that
 * invoked the snap.
 * @param args.request - A validated JSON-RPC request object.
 * @returns The result of `snap_dialog`.
 * @throws If the request method is not valid for this snap.
 */
export const onRpcRequest: OnRpcRequestHandler = async ({
  origin,
  request,
}) => {
  switch (request.method) {
    case 'hello':
      return snap.request({
        method: 'snap_dialog',
        params: {
          type: 'confirmation',
          content: (
            <Box>
              <Spinner />
            </Box>
          ),
        },
      });
    default:
      throw new Error('Method not found.');
  }
};

@FrederikBolding FrederikBolding requested a review from a team as a code owner December 12, 2024 15:05
@metamaskbot metamaskbot added the team-snaps-platform Snaps Platform team label Dec 12, 2024
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Dec 12, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [dacf943]
Page Load Metrics (1571 ± 51 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint30418821519300144
domContentLoaded1405183615509948
load14091879157110751
domInteractive239139168
backgroundConnect677252110
firstReactRender156720115
getState45113157
initialActions01000
loadScripts1036147111619747
setupStore65118189
uiStartup15832133178613565
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 148 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@FrederikBolding FrederikBolding added this pull request to the merge queue Dec 13, 2024
Merged via the queue into main with commit 71cafe7 Dec 13, 2024
85 checks passed
@FrederikBolding FrederikBolding deleted the fb/swap-snaps-spinner-component branch December 13, 2024 10:36
@github-actions github-actions bot locked and limited conversation to collaborators Dec 13, 2024
@metamaskbot metamaskbot added the release-12.11.0 Issue or pull request that will be included in release 12.11.0 label Dec 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
INVALID-PR-TEMPLATE PR's body doesn't match template release-12.11.0 Issue or pull request that will be included in release 12.11.0 team-snaps-platform Snaps Platform team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants