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

feat: Add Snap UI avatar component #27826

Merged
merged 2 commits into from
Oct 15, 2024

Conversation

FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented Oct 14, 2024

Description

Move Snaps UI avatar implementation to a separate component that can be consumed by Snaps.

Open in GitHub Codespaces

Related issues

Closes: MetaMask/snaps#2776

Manual testing steps

export const onRpcRequest: OnRpcRequestHandler = async ({
  origin,
  request,
}) => {
  switch (request.method) {
    case 'hello':
      return snap.request({
        method: 'snap_dialog',
        params: {
          type: 'confirmation',
          content: (
            <Box>
              <Text>
                Hello, <Bold>{origin}</Bold>!
              </Text>
              <Text>
                This custom confirmation is just for display purposes.
              </Text>
              <Text>
                But you can edit the snap source code to make it do something,
                if you want to!
              </Text>
              <Address address='eip155:1:0x1234567890123456789012345678901234567890' />
              <Avatar address="eip155:1:0x1234567890123456789012345678901234567890" />
              <Address address="bip122:000000000019d6689c085ae165831e93:128Lkh3S7CkDTBZ8W7BbpsN3YYizJMp8p6" />
              <Avatar address="bip122:000000000019d6689c085ae165831e93:128Lkh3S7CkDTBZ8W7BbpsN3YYizJMp8p6" />
              <Box direction="horizontal" alignment="space-between" center={true}>
                <Text>Avatar</Text>
                <Avatar address="bip122:000000000019d6689c085ae165831e93:128Lkh3S7CkDTBZ8W7BbpsN3YYizJMp8p6" />
              </Box>
 
            </Box>
          ),
        },
      });
    default:
      throw new Error('Method not found.');
  }
};

Screenshots/Recordings

Screenshot 2024-10-14 at 14 44 50

@FrederikBolding FrederikBolding added the team-snaps-platform Snaps Platform team label Oct 14, 2024
@FrederikBolding FrederikBolding requested review from a team as code owners October 14, 2024 12:47
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Oct 14, 2024
@Mrtenz Mrtenz force-pushed the mrtenz/bump-snaps-packages branch 2 times, most recently from 1d29e47 to fd58460 Compare October 14, 2024 15:18
@FrederikBolding FrederikBolding merged commit 0434349 into mrtenz/bump-snaps-packages Oct 15, 2024
15 of 17 checks passed
@FrederikBolding FrederikBolding deleted the fb/snap-avatar-component branch October 15, 2024 09:08
@github-actions github-actions bot locked and limited conversation to collaborators Oct 15, 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 team-snaps-platform Snaps Platform team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants