diff --git a/lib/build/recipe/thirdparty/providers/twitter.d.ts b/lib/build/recipe/thirdparty/providers/twitter.d.ts index 62286315c..8042d592d 100644 --- a/lib/build/recipe/thirdparty/providers/twitter.d.ts +++ b/lib/build/recipe/thirdparty/providers/twitter.d.ts @@ -1,10 +1,14 @@ /// import type { BuiltInProviderConfig } from "./types"; import Provider from "."; +export declare type TwitterProviderConfig = BuiltInProviderConfig & { + useLegacyTwitterLogo?: boolean; +}; export default class Twitter extends Provider { + private useLegacyTwitterLogo; private static instance?; - constructor(config?: BuiltInProviderConfig); + constructor(config?: TwitterProviderConfig); getLogo: () => JSX.Element; - static init(config?: BuiltInProviderConfig): Provider; + static init(config?: TwitterProviderConfig): Provider; static reset(): void; } diff --git a/lib/build/thirdparty-shared.js b/lib/build/thirdparty-shared.js index 9ecf3f819..947a6537e 100644 --- a/lib/build/thirdparty-shared.js +++ b/lib/build/thirdparty-shared.js @@ -1011,34 +1011,58 @@ var Twitter = /** @class */ (function (_super) { * Constructor. */ function Twitter(config) { - var _this = - _super.call(this, genericComponentOverrideContext.__assign({ id: "twitter", name: "Twitter" }, config)) || - this; + var _this = this; + var id = "x"; + var name = "X"; + var _useLegacyTwitterLogo = Boolean( + config === null || config === void 0 ? void 0 : config.useLegacyTwitterLogo + ); + if (_useLegacyTwitterLogo) { + id = "twitter"; + name = "Twitter"; + } + _this = _super.call(this, genericComponentOverrideContext.__assign({ id: id, name: name }, config)) || this; + _this.useLegacyTwitterLogo = false; _this.getLogo = function () { + if (_this.useLegacyTwitterLogo === true) { + return jsxRuntime.jsx( + "svg", + genericComponentOverrideContext.__assign( + { + xmlns: "http://www.w3.org/2000/svg", + width: "20.129", + height: "16.356", + viewBox: "0 0 20.129 16.356", + }, + { + children: jsxRuntime.jsx("g", { + children: jsxRuntime.jsx("g", { + children: jsxRuntime.jsx("path", { + fill: "#04ABEE", + d: "M45.232 35.964a8.242 8.242 0 0 1-2.372.649 4.141 4.141 0 0 0 1.816-2.284 8.268 8.268 0 0 1-2.623 1 4.133 4.133 0 0 0-7.037 3.771 11.724 11.724 0 0 1-8.516-4.317 4.133 4.133 0 0 0 1.282 5.517 4.1 4.1 0 0 1-1.87-.517v.052a4.132 4.132 0 0 0 3.313 4.049 4.147 4.147 0 0 1-1.865.071 4.134 4.134 0 0 0 3.858 2.868 8.338 8.338 0 0 1-6.114 1.71 11.745 11.745 0 0 0 18.08-9.894q0-.268-.012-.534a8.374 8.374 0 0 0 2.061-2.137z", + transform: + "translate(34.799 -7.41) translate(2.201 4.266) translate(-62.103 -30.883)", + }), + }), + }), + } + ) + ); + } return jsxRuntime.jsx( "svg", genericComponentOverrideContext.__assign( + { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 1200 1227" }, { - xmlns: "http://www.w3.org/2000/svg", - width: "20.129", - height: "16.356", - viewBox: "0 0 20.129 16.356", - }, - { - children: jsxRuntime.jsx("g", { - children: jsxRuntime.jsx("g", { - children: jsxRuntime.jsx("path", { - fill: "#04ABEE", - d: "M45.232 35.964a8.242 8.242 0 0 1-2.372.649 4.141 4.141 0 0 0 1.816-2.284 8.268 8.268 0 0 1-2.623 1 4.133 4.133 0 0 0-7.037 3.771 11.724 11.724 0 0 1-8.516-4.317 4.133 4.133 0 0 0 1.282 5.517 4.1 4.1 0 0 1-1.87-.517v.052a4.132 4.132 0 0 0 3.313 4.049 4.147 4.147 0 0 1-1.865.071 4.134 4.134 0 0 0 3.858 2.868 8.338 8.338 0 0 1-6.114 1.71 11.745 11.745 0 0 0 18.08-9.894q0-.268-.012-.534a8.374 8.374 0 0 0 2.061-2.137z", - transform: - "translate(34.799 -7.41) translate(2.201 4.266) translate(-62.103 -30.883)", - }), - }), + children: jsxRuntime.jsx("path", { + d: "M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z", + fill: "#000", }), } ) ); }; + _this.useLegacyTwitterLogo = _useLegacyTwitterLogo; return _this; } /* diff --git a/lib/ts/recipe/thirdparty/providers/twitter.tsx b/lib/ts/recipe/thirdparty/providers/twitter.tsx index 2f29ce637..06dda1ffd 100644 --- a/lib/ts/recipe/thirdparty/providers/twitter.tsx +++ b/lib/ts/recipe/thirdparty/providers/twitter.tsx @@ -21,10 +21,15 @@ import type { BuiltInProviderConfig } from "./types"; import Provider from "."; +export type TwitterProviderConfig = BuiltInProviderConfig & { + useLegacyTwitterLogo?: boolean; +}; + /* * Class. */ export default class Twitter extends Provider { + private useLegacyTwitterLogo = false; /* * Static Attributes. */ @@ -33,26 +38,47 @@ export default class Twitter extends Provider { /* * Constructor. */ - constructor(config?: BuiltInProviderConfig) { + constructor(config?: TwitterProviderConfig) { + let id = "x"; + let name = "X"; + const _useLegacyTwitterLogo = Boolean(config?.useLegacyTwitterLogo); + + if (_useLegacyTwitterLogo) { + id = "twitter"; + name = "Twitter"; + } + super({ - id: "twitter", - name: "Twitter", + id, + name, ...config, }); + + this.useLegacyTwitterLogo = _useLegacyTwitterLogo; } getLogo = (): JSX.Element => { - return ( - - + if (this.useLegacyTwitterLogo === true) { + return ( + - + + + - + + ); + } + return ( + + ); }; @@ -60,7 +86,7 @@ export default class Twitter extends Provider { /* * Static Methods */ - static init(config?: BuiltInProviderConfig): Provider { + static init(config?: TwitterProviderConfig): Provider { if (Twitter.instance !== undefined) { console.warn("Twitter Provider was already initialized"); return Twitter.instance;