From 2ee1723ba2fe2be17395ccc072f39aca10350c3b Mon Sep 17 00:00:00 2001 From: NikolaiKryshnev <63440682+NikolaiKryshnev@users.noreply.github.com> Date: Thu, 7 Nov 2024 23:50:38 +0300 Subject: [PATCH] Enhancements: Add comments in tos.ts and switch Twitter icon to X (#1140) * Update tos.ts: Add comments Included comments explaining the purpose of the array and the meaning of each code. * Update tos.ts Removed unnecessary parenthetical comment * Update index.tsx: switch Twitter icon to X switch Twitter icon to X in SVG assets * Update socialPlatforms.ts: rename Twitter to X - Renaming [SocialPlatform.Twitter]: 'twitter' to [SocialPlatform.Twitter]: 'x' - Modifying share link URL to `https://x.com/intent/tweet` --- apps/bridge/pages/api/tos.ts | 58 ++++++++++++++------------- apps/web/src/utils/socialPlatforms.ts | 4 +- libs/base-ui/Icon/index.tsx | 16 ++++---- 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/apps/bridge/pages/api/tos.ts b/apps/bridge/pages/api/tos.ts index be54946..2d7316c 100644 --- a/apps/bridge/pages/api/tos.ts +++ b/apps/bridge/pages/api/tos.ts @@ -1,36 +1,38 @@ import type { NextApiRequest, NextApiResponse } from 'next'; +// Array of two-letter country codes of European Union members (according to ISO 3166-1 alpha-2) const EU_COUNTRIES = [ - 'AT', - 'BE', - 'BG', - 'CY', - 'CZ', - 'DE', - 'DK', - 'EE', - 'ES', - 'FI', - 'FR', - 'GB', - 'GR', - 'HU', - 'HR', - 'IE', - 'IT', - 'LT', - 'LU', - 'LV', - 'MT', - 'NL', - 'PL', - 'PT', - 'RO', - 'SE', - 'SI', - 'SK', + 'AT', // Austria + 'BE', // Belgium + 'BG', // Bulgaria + 'CY', // Cyprus + 'CZ', // Czech Republic + 'DE', // Germany + 'DK', // Denmark + 'EE', // Estonia + 'ES', // Spain + 'FI', // Finland + 'FR', // France + 'GB', // United Kingdom + 'GR', // Greece + 'HU', // Hungary + 'HR', // Croatia + 'IE', // Ireland + 'IT', // Italy + 'LT', // Lithuania + 'LU', // Luxembourg + 'LV', // Latvia + 'MT', // Malta + 'NL', // Netherlands + 'PL', // Poland + 'PT', // Portugal + 'RO', // Romania + 'SE', // Sweden + 'SI', // Slovenia + 'SK', // Slovakia ]; + export default function handler(req: NextApiRequest, res: NextApiResponse) { const country = res.getHeader('x-cf-country') as string; const tosRegion = EU_COUNTRIES.includes(country) ? 'EU' : 'US'; diff --git a/apps/web/src/utils/socialPlatforms.ts b/apps/web/src/utils/socialPlatforms.ts index 0604bcd..c5795e6 100644 --- a/apps/web/src/utils/socialPlatforms.ts +++ b/apps/web/src/utils/socialPlatforms.ts @@ -25,7 +25,7 @@ export const socialPlatformCtaForDisplay = { }; export const socialPlatformIconName: Record = { - [SocialPlatform.Twitter]: 'twitter', + [SocialPlatform.Twitter]: 'x', [SocialPlatform.Farcaster]: 'farcaster', }; @@ -44,7 +44,7 @@ export const socialPlatformShareLinkFunction: SocialPlatformShareLinkFunction = url: url, }; - return urlWithQueryParams('https://twitter.com/intent/tweet', shareParams); + return urlWithQueryParams('https://x.com/intent/tweet', shareParams); }, [SocialPlatform.Farcaster]: ({ text, url }: SocialMediaShareParams) => { const shareParams: QueryParams = { diff --git a/libs/base-ui/Icon/index.tsx b/libs/base-ui/Icon/index.tsx index d080bc2..4bd7770 100644 --- a/libs/base-ui/Icon/index.tsx +++ b/libs/base-ui/Icon/index.tsx @@ -29,18 +29,16 @@ const ICONS: Record JSX.Element> = { ), twitter: ({ color, width, height }: SvgProps) => ( - - - + + ), github: ({ color, width, height }: SvgProps) => (