onairos 0.1.357 → 0.1.360

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,30 +5,24 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = TestTelegramButton;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
- var _sdkReact = require("@telegram-apps/sdk-react");
9
8
  var _jsxRuntime = require("react/jsx-runtime");
10
9
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
10
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
11
  function TestTelegramButton() {
13
12
  const [error, setError] = (0, _react.useState)(null);
14
13
  const [logs, setLogs] = (0, _react.useState)([]);
15
- (0, _react.useEffect)(() => {
16
- try {
17
- (0, _sdkReact.init)();
18
- addLog('Telegram SDK initialized successfully');
19
- } catch (error) {
20
- console.error('Failed to initialize Telegram SDK:', error);
21
- addLog('Failed to initialize Telegram SDK: ' + error.message);
22
- setError('Failed to initialize Telegram SDK: ' + error.message);
23
- }
24
- }, []);
25
14
  const addLog = message => {
26
15
  setLogs(prevLogs => [...prevLogs, message]);
27
16
  };
28
17
  const handleClick = () => {
29
18
  try {
30
19
  addLog('Opening external browser...');
31
- const testUrl = 'https://onairos.uk/test-page';
20
+ const data = {
21
+ key: 'value'
22
+ }; // Example data
23
+ const queryString = new URLSearchParams(data).toString();
24
+ const testUrl = `https://internship.onairos.uk/auth?${queryString}`;
25
+ // const testUrl = `https://onairos.uk/auth?${queryString}`;
32
26
 
33
27
  // Use standard JavaScript to open the link in a new tab
34
28
  window.open(testUrl, '_blank');
@@ -43,10 +37,27 @@ function TestTelegramButton() {
43
37
  children: [error && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
44
38
  className: "bg-red-100 border border-red-400 text-red-700 px-4 py-2 rounded mb-4",
45
39
  children: error
46
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
40
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
47
41
  onClick: handleClick,
48
- className: "bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600",
49
- children: "Test External Browser"
42
+ className: "flex flex-col items-center justify-center px-4 py-2 border border-gray-300 rounded-full shadow-sm bg-white hover:bg-gray-50",
43
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
44
+ className: "relative",
45
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
46
+ src: "google-icon.png",
47
+ alt: "Google",
48
+ className: "w-10 h-10 rounded-full"
49
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
50
+ className: "absolute bottom-0 right-0 w-4 h-4",
51
+ fill: "currentColor",
52
+ viewBox: "0 0 20 20",
53
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
54
+ d: "M10 3a1 1 0 011 1v6h6a1 1 0 110 2h-6v6a1 1 0 11-2 0v-6H3a1 1 0 110-2h6V4a1 1 0 011-1z"
55
+ })
56
+ })]
57
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
58
+ className: "text-gray-700 mt-2",
59
+ children: "Open Window"
60
+ })]
50
61
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
51
62
  className: "mt-4 w-full max-w-md",
52
63
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h3", {