@streamlayer/react-ui 0.34.0 → 0.35.0

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.
@@ -1,6 +1,7 @@
1
- import { jsx as i } from "react/jsx-runtime";
1
+ import { jsx as r } from "react/jsx-runtime";
2
2
  import "@streamlayer/sdk-web-anonymous-auth";
3
3
  import { Login as m } from "../login/index.js";
4
+ import { useStore as n } from "@nanostores/react";
4
5
  import "react";
5
6
  import "react-auth-code-input";
6
7
  import "react-phone-number-input";
@@ -14,11 +15,11 @@ import "@connectrpc/connect";
14
15
  import "@connectrpc/connect-web";
15
16
  import "@streamlayer/sl-eslib/users/users_connect";
16
17
  import "../login/styles.js";
17
- const A = ({ sdk: o }) => /* @__PURE__ */ i(m, { login: async (t) => {
18
+ const A = ({ sdk: o }) => n(o.getUserStore()).data ? /* @__PURE__ */ r("button", { onClick: o.logout, children: "logout" }) : /* @__PURE__ */ r(m, { login: async (i) => {
18
19
  try {
19
- await o.authorizationBypass("streamlayer:streamlayer", t);
20
- } catch (r) {
21
- throw console.log("login err", r), r;
20
+ await o.authorizationBypass("streamlayer:streamlayer", i);
21
+ } catch (t) {
22
+ throw console.log("login err", t), t;
22
23
  }
23
24
  }, anonymousLogin: o.anonymousAuthorization, host: o.host });
24
25
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamlayer/react-ui",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./lib/index.d.ts",