feat(book): extract ConnectSocialAccounts, PersonaAvatar, PersonaPublicKey, LoadingPlaceholder into injected-ui - #12455
Merged
Conversation
…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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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'sSOCIAL_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 onToolboxHint/AccountConnectStatus.PersonaAvatar— its only import was@masknet/shared'sEmojiAvatar, itself fully pure. Duplicated (with itsEMOJI_LISTdata) aspackages/injected-ui/src/EmojiAvatar.tsxrather than touched, since it still has 4 other consumers outside this change.PersonaPublicKey— used@masknet/shared'sCopyButton, which defaults its tooltips viaTrans. Forked asCopyIconButtonwith the tooltips as plain-string-defaulting props instead (dropping the imperative ref handle, unused by any current caller) —CopyButtonitself is used in 11+ other places and is left untouched.LoadingPlaceholder— used@masknet/shared'sLoadingStatus, whose fallback text is also aTransdefault. Rebuilt directly on top ofLoadingBase(the safe spinner primitive@masknet/themealready 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-uikeeps per-component exports only (no barrelindex.ts).Closes # (NO_ISSUE)
Type of change
Previews
The Vercel preview deploy will build the book app — visit
/popups/ConnectSocialAccounts,/popups/EmojiAvatar,/popups/PersonaAvatar,/popups/CopyIconButton,/popups/PersonaPublicKey, and/popups/LoadingPlaceholderto see them rendered.Checklist
console.logsCopyIconButton, standaloneLoadingPlaceholder) rather than the original widely-used@masknet/sharedones)If this PR depends on external APIs:
🤖 Generated with Claude Code
https://claude.ai/code/session_01ED8N1kMNKJ5vinunnvcWY6
Generated by Claude Code