From a6e44bbfd4648ac0f3762a18ce05ca00c80325b4 Mon Sep 17 00:00:00 2001 From: israellund Date: Thu, 6 Mar 2025 11:56:40 -0500 Subject: [PATCH] added warpcast icon and updated COmmuntiy Home --- .../client/scripts/helpers/link.ts | 7 +++ .../views/components/AuthButton/constants.ts | 35 +++++++++++++ .../views/components/AuthButton/types.ts | 7 ++- .../component_kit/cw_icons/cw_icon_lookup.ts | 3 +- .../component_kit/cw_icons/cw_icons.tsx | 36 +++++++++++++ .../sidebar/external_links_module.tsx | 9 ++++ .../views/components/social_accounts.tsx | 2 + .../TokenDetails/SocialLinks/SocialLinks.tsx | 52 ++++++++++++++++++- 8 files changed, 148 insertions(+), 3 deletions(-) diff --git a/packages/commonwealth/client/scripts/helpers/link.ts b/packages/commonwealth/client/scripts/helpers/link.ts index 20ceb0a7706..a874f53360e 100644 --- a/packages/commonwealth/client/scripts/helpers/link.ts +++ b/packages/commonwealth/client/scripts/helpers/link.ts @@ -9,6 +9,7 @@ export type LinkType = | 'tiktok' | 'github' | 'matrix' + | 'warpcast' | ''; export const getLinkType = (link: string): LinkType => { @@ -23,6 +24,7 @@ export const getLinkType = (link: string): LinkType => { return 'x (twitter)'; if (link.includes('github.com')) return 'github'; if (link.includes('matrix.to')) return 'matrix'; + if (link.includes('warpcast.com')) return 'warpcast'; return ''; }; @@ -34,6 +36,7 @@ export type CategorizedSocialLinks = { twitters: string[]; elements: string[]; slacks: string[]; + warpcasts: string[]; remainingLinks: string[]; }; @@ -48,6 +51,7 @@ export const categorizeSocialLinks = ( twitters: [], elements: [], slacks: [], + warpcasts: [], remainingLinks: [], }; @@ -75,6 +79,9 @@ export const categorizeSocialLinks = ( case 'matrix': categorized.elements.push(link); break; + case 'warpcast': + categorized.warpcasts.push(link); + break; default: categorized.remainingLinks.push(link); } diff --git a/packages/commonwealth/client/scripts/views/components/AuthButton/constants.ts b/packages/commonwealth/client/scripts/views/components/AuthButton/constants.ts index 4c0f536e9e2..374681296a3 100644 --- a/packages/commonwealth/client/scripts/views/components/AuthButton/constants.ts +++ b/packages/commonwealth/client/scripts/views/components/AuthButton/constants.ts @@ -166,4 +166,39 @@ export const AUTH_TYPES: AuthTypesList = { }, label: 'Farcaster', }, + telegram: { + icon: { + name: 'telegram', + isCustom: false, + }, + label: 'Telegram', + }, + tiktok: { + icon: { + name: 'tiktok', + isCustom: false, + }, + label: 'TikTok', + }, + warpcast: { + icon: { + name: 'warpcast', + isCustom: false, + }, + label: 'Warpcast', + }, + element: { + icon: { + name: 'element', + isCustom: false, + }, + label: 'Element', + }, + website: { + icon: { + name: 'website', + isCustom: false, + }, + label: 'Website', + }, }; diff --git a/packages/commonwealth/client/scripts/views/components/AuthButton/types.ts b/packages/commonwealth/client/scripts/views/components/AuthButton/types.ts index 0991239034d..880d5576df1 100644 --- a/packages/commonwealth/client/scripts/views/components/AuthButton/types.ts +++ b/packages/commonwealth/client/scripts/views/components/AuthButton/types.ts @@ -11,7 +11,12 @@ export type AuthSSOs = | 'apple' | 'email' | 'farcaster' - | 'SMS'; + | 'SMS' + | 'telegram' + | 'tiktok' + | 'warpcast' + | 'element' + | 'website'; export type CosmosWallets = 'keplr' | 'leap'; export type SubstrateWallets = 'polkadot'; export type SolanaWallets = 'phantom'; diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_icon_lookup.ts b/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_icon_lookup.ts index f4b7cd00e14..220031171c3 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_icon_lookup.ts +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_icon_lookup.ts @@ -130,6 +130,7 @@ export const iconLookup = { image: withPhosphorIcon(Image), clipboard: withPhosphorIcon(Clipboard), cloudArrowUp: withPhosphorIcon(CloudArrowUp), + element: Icons.CWElement, archiveTrayFilled: Icons.CWArchiveTrayFilled, arrowDownBlue500: Icons.CWArrowDownBlue500, arrowFatUp: Icons.CWArrowFatUp, @@ -211,7 +212,6 @@ export const iconLookup = { dotsHorizontal: Icons.CWDotsHorizontal, downvote: withPhosphorIcon(ArrowFatDown), edgeware: Icons.CWEdgeware, - element: Icons.CWElement, envelope: Icons.CWEnvelope, ethereum: Icons.CWEthereum, etherscan: Icons.CWEtherscan, @@ -321,6 +321,7 @@ export const iconLookup = { kanban: withPhosphorIcon(Kanban), xTwitter: withPhosphorIcon(XLogo), discordLogo: withPhosphorIcon(DiscordLogo), + warpcast: Icons.CWWarpcast, }; export const customIconLookup = { diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_icons.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_icons.tsx index 69366546c2a..83f74772497 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_icons.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/cw_icons/cw_icons.tsx @@ -1367,6 +1367,42 @@ export const CWDiscord = (props: IconProps) => { ); }; +// eslint-disable-next-line react/no-multi-comp +export const CWWarpcast = (props: IconProps) => { + const { + className, + componentType, + disabled, + iconButtonTheme, + iconSize, + selected, + ...otherProps + } = props; + return ( + ( + { className, disabled, iconButtonTheme, iconSize, selected }, + componentType, + )} + xmlns="http://www.w3.org/2000/svg" + width="32" + height="32" + viewBox="0 0 32 32" + style={{ fill: 'white' }} + {...otherProps} + > + + + + ); +}; + // eslint-disable-next-line react/no-multi-comp export const CWDiscordLogin = (props: IconProps) => { const { diff --git a/packages/commonwealth/client/scripts/views/components/sidebar/external_links_module.tsx b/packages/commonwealth/client/scripts/views/components/sidebar/external_links_module.tsx index 175bd500a18..cddde505feb 100644 --- a/packages/commonwealth/client/scripts/views/components/sidebar/external_links_module.tsx +++ b/packages/commonwealth/client/scripts/views/components/sidebar/external_links_module.tsx @@ -25,6 +25,7 @@ export const ExternalLinksModule = () => { telegrams, tiktoks, twitters, + warpcasts, } = categorizeSocialLinks( (community.social_links || []) .filter((link) => link) @@ -81,6 +82,14 @@ export const ExternalLinksModule = () => { onClick={() => window.open(link)} /> ))} + {warpcasts.map((link) => ( + window.open(link)} + /> + ))} {[...remainingLinks, ...slacks].map((link) => ( { return ; } else if (social.includes('tiktok')) { return ; + } else if (social.includes('warpcast')) { + return ; } else { return ; } diff --git a/packages/commonwealth/client/scripts/views/pages/CommunityHome/TokenDetails/SocialLinks/SocialLinks.tsx b/packages/commonwealth/client/scripts/views/pages/CommunityHome/TokenDetails/SocialLinks/SocialLinks.tsx index 42dcb339a45..adf20a12d92 100644 --- a/packages/commonwealth/client/scripts/views/pages/CommunityHome/TokenDetails/SocialLinks/SocialLinks.tsx +++ b/packages/commonwealth/client/scripts/views/pages/CommunityHome/TokenDetails/SocialLinks/SocialLinks.tsx @@ -13,7 +13,17 @@ const SocialLinks = () => { if (!app.chain || !community) return; - const { discords, githubs, twitters } = categorizeSocialLinks( + const { + discords, + githubs, + twitters, + telegrams, + warpcasts, + remainingLinks, + tiktoks, + elements, + slacks, + } = categorizeSocialLinks( (community.social_links || []) .filter((link) => link) .map((link) => link || ''), @@ -45,6 +55,46 @@ const SocialLinks = () => { onClick={() => window.open(link)} /> ))} + {telegrams.map((link) => ( + window.open(link)} + /> + ))} + {warpcasts.map((link) => ( + window.open(link)} + /> + ))} + {tiktoks.map((link) => ( + window.open(link)} + /> + ))} + {elements.map((link) => ( + window.open(link)} + /> + ))} + {[...remainingLinks, ...slacks].map((link) => ( + window.open(link)} + /> + ))} ); };