Skip to content

Commit

Permalink
Enhancements: Add comments in tos.ts and switch Twitter icon to X (#1140
Browse files Browse the repository at this point in the history
)

* 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`
  • Loading branch information
NikolaiKryshnev authored Nov 7, 2024
1 parent 24dbe96 commit 2ee1723
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 39 deletions.
58 changes: 30 additions & 28 deletions apps/bridge/pages/api/tos.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/utils/socialPlatforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const socialPlatformCtaForDisplay = {
};

export const socialPlatformIconName: Record<SocialPlatform, string> = {
[SocialPlatform.Twitter]: 'twitter',
[SocialPlatform.Twitter]: 'x',
[SocialPlatform.Farcaster]: 'farcaster',
};

Expand All @@ -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 = {
Expand Down
16 changes: 7 additions & 9 deletions libs/base-ui/Icon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,16 @@ const ICONS: Record<string, (props: SvgProps) => JSX.Element> = {
</svg>
),
twitter: ({ color, width, height }: SvgProps) => (
<svg
<svg
viewBox="0 0 50 50"
width={width}
height={height}
viewBox="0 0 24 20"
fill="none"
xmlns="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M21.543 5.18103C21.5576 5.39261 21.5576 5.60419 21.5576 5.81771C21.5576 12.324 16.6045 19.8277 7.54759 19.8277V19.8238C4.87215 19.8277 2.25229 19.0613 0 17.6164C0.389031 17.6632 0.780012 17.6866 1.17197 17.6875C3.38915 17.6895 5.54296 16.9456 7.28726 15.5757C5.18026 15.5357 3.3326 14.1619 2.68714 12.1563C3.42523 12.2986 4.18574 12.2694 4.91018 12.0715C2.61304 11.6074 0.96039 9.58907 0.96039 7.24514V7.18274C1.64485 7.56397 2.41121 7.77554 3.19513 7.79894C1.03157 6.353 0.364656 3.47475 1.67118 1.22442C4.17112 4.30059 7.8596 6.17067 11.8191 6.3686C11.4223 4.65842 11.9644 2.86634 13.2436 1.66415C15.2268 -0.200081 18.3459 -0.104529 20.2101 1.87768C21.3129 1.66025 22.3698 1.25562 23.337 0.682308C22.9694 1.8221 22.2001 2.79029 21.1725 3.40553C22.1484 3.29047 23.102 3.02917 24 2.63039C23.3389 3.621 22.5063 4.48389 21.543 5.18103Z"
fill={color}
/>
</svg>
<path d="M 6.9199219 6 L 21.136719 26.726562 L 6.2285156 44 L 9.40625 44 L 22.544922 28.777344 L 32.986328 44 L 43 44 L 28.123047 22.3125 L 42.203125 6 L 39.027344 6 L 26.716797 20.261719 L 16.933594 6 L 6.9199219 6 z"
fill={color}
/>
</svg>
),
github: ({ color, width, height }: SvgProps) => (
<svg
Expand Down

0 comments on commit 2ee1723

Please sign in to comment.