From a1707f66f380b6a09fcfff08315258838ffc7884 Mon Sep 17 00:00:00 2001 From: gregfromstl Date: Tue, 12 Nov 2024 20:13:54 +0000 Subject: [PATCH] [SDK] Fix: Add JSDoc documentation for getSocialIcon function (#5395) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CNCT-2324 --- ## PR-Codex overview This PR enhances the documentation for the `getSocialIcon` function, providing a detailed JSDoc comment that explains its purpose, parameters, return value, and includes usage examples. ### Detailed summary - Added a JSDoc comment for the `getSocialIcon` function. - Described the function's purpose, parameters, return value, and provided usage examples. - Changed the return type of `getSocialIcon` to explicitly specify it returns a `string`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` --- .../thirdweb/src/react/core/utils/walletIcon.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/thirdweb/src/react/core/utils/walletIcon.ts b/packages/thirdweb/src/react/core/utils/walletIcon.ts index b7a93f4132e..815d0c4765a 100644 --- a/packages/thirdweb/src/react/core/utils/walletIcon.ts +++ b/packages/thirdweb/src/react/core/utils/walletIcon.ts @@ -50,8 +50,17 @@ export const socialIcons = { github: githubIconUri, }; -// TODO: this should return actual elements so they can be themed -export function getSocialIcon(provider: AuthOption | ({} & string)) { +/** + * Gets the icon URI for a given social authentication provider + * @param provider - The authentication provider to get the icon for + * @returns A data URI containing the SVG icon for the provider, or a generic wallet icon if the provider is not recognized + * @example + * ```tsx + * const googleIcon = getSocialIcon("google") + * const appleIcon = getSocialIcon("apple") + * ``` + */ +export function getSocialIcon(provider: AuthOption | ({} & string)): string { switch (provider) { case "google": return googleIconUri;