Skip to content

feat(book): extract ConnectSocialAccounts, PersonaAvatar, PersonaPublicKey, LoadingPlaceholder into injected-ui - #12455

Merged
guanbinrui merged 3 commits into
developfrom
claude/injected-ui-popups-batch2
Sep 6, 2026
Merged

feat(book): extract ConnectSocialAccounts, PersonaAvatar, PersonaPublicKey, LoadingPlaceholder into injected-ui#12455
guanbinrui merged 3 commits into
developfrom
claude/injected-ui-popups-batch2

Conversation

@guanbinrui

Copy link
Copy Markdown
Member

Description

Continues the popups category (follow-up to #12454). Each of these needed one small fix before moving:

  • ConnectSocialAccounts — previously resolved each network's icon itself via @masknet/shared's SOCIAL_MEDIA_ROUND_ICON_MAPPING. Now takes pre-resolved {networkIdentifier, icon, name} entries, so the two containers (ConnectSocialAccountModal, SocialAccounts) do that mapping instead — same pattern as the icon props on ToolboxHint/AccountConnectStatus.
  • PersonaAvatar — its only import was @masknet/shared's EmojiAvatar, itself fully pure. Duplicated (with its EMOJI_LIST data) as packages/injected-ui/src/EmojiAvatar.tsx rather than touched, since it still has 4 other consumers outside this change.
  • PersonaPublicKey — used @masknet/shared's CopyButton, which defaults its tooltips via Trans. Forked as CopyIconButton with the tooltips as plain-string-defaulting props instead (dropping the imperative ref handle, unused by any current caller) — CopyButton itself is used in 11+ other places and is left untouched.
  • LoadingPlaceholder — used @masknet/shared's LoadingStatus, whose fallback text is also a Trans default. Rebuilt directly on top of LoadingBase (the safe spinner primitive @masknet/theme already exports) instead, defaulting to the plain string "Loading".

No new dependencies. Book demos added for all six new exports (ConnectSocialAccounts, EmojiAvatar, PersonaAvatar, CopyIconButton, PersonaPublicKey, LoadingPlaceholder).

As with the prior PRs, packages/injected-ui keeps per-component exports only (no barrel index.ts).

Closes # (NO_ISSUE)

Type of change

  • Documentation
  • Code refactoring (Restructuring existing code w/o changing its observable behavior)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (a fix or feature that would make something no longer possible to do/require old user must upgrade their Mask Network to this new version)

Previews

The Vercel preview deploy will build the book app — visit /popups/ConnectSocialAccounts, /popups/EmojiAvatar, /popups/PersonaAvatar, /popups/CopyIconButton, /popups/PersonaPublicKey, and /popups/LoadingPlaceholder to see them rendered.

Checklist

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
    • I have removed all in development console.logs
    • I have removed all commented code.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have read Internationalization Guide and moved text fields to the i18n JSON file. (no new user-facing strings — the only two Trans-backed defaults that moved, CopyButton's tooltips and LoadingStatus's fallback text, are replaced with plain-string prop defaults since these two pieces are net-new components (CopyIconButton, standalone LoadingPlaceholder) rather than the original widely-used @masknet/shared ones)

If this PR depends on external APIs:

  • N/A — no external API dependency in this change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ED8N1kMNKJ5vinunnvcWY6


Generated by Claude Code

…icKey, LoadingPlaceholder into injected-ui

Continues the popups category. Each of these needed one small fix
before moving:

- ConnectSocialAccounts: previously resolved each network's icon
  itself via @masknet/shared's SOCIAL_MEDIA_ROUND_ICON_MAPPING. Now
  takes pre-resolved {networkIdentifier, icon, name} entries, so the
  two containers (ConnectSocialAccountModal, SocialAccounts) do that
  mapping instead - same pattern as the icon props on ToolboxHint/
  AccountConnectStatus.
- PersonaAvatar: only import was @masknet/shared's EmojiAvatar, itself
  fully pure - duplicated (with its EMOJI_LIST data) as
  packages/injected-ui/src/EmojiAvatar.tsx rather than touched, since
  it still has 4 other consumers outside this change.
- PersonaPublicKey: used @masknet/shared's CopyButton, which defaults
  its tooltips via Trans. Forked as CopyIconButton with the tooltips
  as plain-string-defaulting props instead (dropping the imperative
  ref handle, unused by any current caller) - CopyButton itself is used
  in 11+ other places and is left untouched.
- LoadingPlaceholder: used @masknet/shared's LoadingStatus, whose
  fallback text is also a Trans default. Rebuilt directly on top of
  LoadingBase (the safe spinner primitive @masknet/theme already
  exports) instead, defaulting to the plain string "Loading".

No new dependencies. Book demos added for all six new exports
(ConnectSocialAccounts, EmojiAvatar, PersonaAvatar, CopyIconButton,
PersonaPublicKey, LoadingPlaceholder).

Follow-up to #12454.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ED8N1kMNKJ5vinunnvcWY6
@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
book Ready Ready Preview Sep 6, 2026 1:23pm UTC

Request Review

Type-check failure: CopyIconButtonProps extended LinkProps (whose
title is the native HTML string attribute) and LoadingPlaceholderProps
extended HTMLProps<HTMLDivElement> (same), while both redeclared
title as ReactNode without omitting the original - TS2430, interfaces
incorrectly extend their base. Add 'title' to each Omit<...> list.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ED8N1kMNKJ5vinunnvcWY6
@guanbinrui
guanbinrui merged commit afd3b9c into develop Sep 6, 2026
11 checks passed
@guanbinrui
guanbinrui deleted the claude/injected-ui-popups-batch2 branch September 6, 2026 13:28
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.

2 participants