nftychat-universe 1.2.0 → 1.3.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.
package/dist/index.cjs.js CHANGED
@@ -6212,7 +6212,7 @@ function getWrappedName(outerType, innerType, wrapperName) {
6212
6212
  */
6213
6213
 
6214
6214
 
6215
- function getDisplayName(Component) {
6215
+ function getDisplayName$1(Component) {
6216
6216
  if (Component == null) {
6217
6217
  return undefined;
6218
6218
  }
@@ -7825,7 +7825,7 @@ function createStyled(input = {}) {
7825
7825
  }
7826
7826
 
7827
7827
  if (displayName === undefined) {
7828
- displayName = `Styled(${getDisplayName(tag)})`;
7828
+ displayName = `Styled(${getDisplayName$1(tag)})`;
7829
7829
  }
7830
7830
 
7831
7831
  Component.displayName = displayName;
@@ -12349,6 +12349,45 @@ var Popover$1 = Popover;
12349
12349
 
12350
12350
  var logo = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAACo5JREFUeJzdnHtwVNUdx7+/s3cfSTbJbgiBBIggQuKgaNgwVusrIA+ZMhYpwWFMgNGKtjN2nLH1H6eWcTq1Tttx2qk1PrBsxKkBqS1KSSIErLVW2RQpahLAR0ISAwt57Wbf99c/8k727uPeuyHymYHk3nPO95z7u/fcc36/c24IU8idDQ2SJ9C6jIVYSoTFMstFBFoAIAOAfegnAHgBdAPwgvEFCWphRgvJ8kmrubDxaFlZeKraTKmuwFHvLARjE4AyEG4HI1OTIKEfjPcAPgKifa5Vla36tFSpuhSwtNaZIQkqJ+ZKALcDEKmoB4AMwjFmOMOMvSfXVHr1rkBXAznqq7IjctqPBNFjBJ6pp3Y8GOgWzC9z0Pisa/0Wt166uhjomoO/z7IJ+3428Apw6rttHJiID/eEejeeWfdon1YxzY9+aa3zsWzJdp4Fr5wGxgEAYqa7so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ebl20mHHkP+vuPweMXVkFVesh3th/ER/1aZ1/JEdAjuCVDk2zlXEIMWqLEQOFZa4hjaPZMFM97L95/iucD/n1kjvP/oF9wwcjBhr6GM2pRw3tgQGNPlDiXAj6sffClzoq0u9c63cMDB+NC5Sw0bATIE3OyzCvd51VjCfrya7OZgTkiF5yYZD5hbEnxhnIVbbFTSRrHvIBwBsJ46WOpkl7DvWksd+NY3Hi1slARHtdq8rHRTcmhdp83WkbAOhy6490d+K5tlMx40ZqYGYc6+7EL786oZ8mKOiT+h6aeD6qH1/6rvNnLOPXelVuIoHiDBusBuNIpWMrHrt4OO78pP8HHdEzvj58E/Tp1bxhHnetrvztxJOKgQ5H3e5mgKbHgnuKYaLPGldVLImWphjNzjTKNxFB99s07SD4zRnm25SSFQ10tGx7jyykzUrpVwgsIrTh37eUK+4Zjrke0rhyywEi2jl5//uVgQA/9fHaikOx8iQUbHUccj4PgUf0ada04RXX6soH42VKOBq9rK56P4E3aGvT9IBk7D++tnJjInkTXnIc/MZTfiF+zukMA0y7EzUOkOTOVtfqbY8MvpO+lS8lFsDPXWsqtiVTSNWCz/JD1WvZwPuZkfgC/GWFA2Bxn2tNRdKfl6ree3fzBzU5wX7/v0DQZ1tpqiB8bsqw3BprKI9dXCPL33U+GpHxLAFmrVr6wiEwP+Vas+1XWlR02fW9pKbGarH732DG3TQFf9UqJgwZAgdh9212lY7GddSi68UsaaixWkKBBwB+AkC+ntoJcIGYnw+b5OdOlG1X3viYJCm5244DVekwWTYRoYJBZUjhn+hixhEhqJr9A/vGRgL1IuXd4aaDr80NS7yRwCt58IuibI2SPQx+j5gOhyV+85OVW/X5xEeBKX1fbKqpMZyx+UsMzEuZsBhERWCaD3AWABtG90t6APQA1AfgS0BuIUaLDP5kYW/6ib3l5brFWOPxf6w6mf8F5a6JAAAAAElFTkSuQmCC";
12351
12351
 
12352
+ /**
12353
+ * Get ENS infomation resolved from the provided wallet address or ENS name
12354
+ * @param { string } - wallet address or ENS name
12355
+ * @returns { object } - { address, name, displayName, avatar }
12356
+ * @example getEnsInfo("0x8206a305Ad4dAb5117B5F1B7C200cD348d2b7a5D") returns { address: "0x...", displayName: "natt.eth" }
12357
+ * @example getEnsInfo("natt.eth") // returns { address: "0x...", displayName: "natt.eth" }
12358
+ * @example getEnsInfo("0x6CFd4180D5bFBFA467213e10e268B488F68e0460") // returns { address: "0x...", displayName: "0x..." } because not resolved to an ENS name
12359
+ */
12360
+ async function getDisplayName(param) {
12361
+ // Caching system
12362
+ // 1. Gets cached data and returns cached data if matched
12363
+ let sessionCache = sessionStorage.getItem("display_name_session_cache");
12364
+ let sessionCacheSerialize = {};
12365
+
12366
+ if (sessionCache !== null) {
12367
+ sessionCacheSerialize = JSON.parse(sessionCache);
12368
+ const cacheData = sessionCacheSerialize[param];
12369
+
12370
+ if (cacheData !== undefined) {
12371
+ console.log("cacheData", cacheData);
12372
+ return cacheData['displayName'];
12373
+ }
12374
+ } // Fetches data if not in cache
12375
+
12376
+
12377
+ const url = `https://api.ensideas.com/ens/resolve/${param}`;
12378
+ const response = await fetch(url);
12379
+ const data = await response.json(); // Caching system
12380
+ // 2. Set cache data
12381
+
12382
+ sessionCacheSerialize[param] = data;
12383
+ sessionStorage.setItem("display_name_session_cache", JSON.stringify(sessionCacheSerialize));
12384
+ console.log(data);
12385
+ return data['displayName'];
12386
+ }
12387
+ const shortenAddress = address => {
12388
+ return address.slice(0, 6) + "..." + address.slice(-4);
12389
+ };
12390
+
12352
12391
  function DmButton(props) {
12353
12392
  // Wamgi hooks
12354
12393
  const {
@@ -12366,10 +12405,14 @@ function DmButton(props) {
12366
12405
  } = wagmi.useSignMessage(); // Custom states
12367
12406
 
12368
12407
  const [numberOfNotifications, setNumberOfNotifications] = React.useState(0);
12369
- const mainUrl = "https://nftychat-staging.herokuapp.com";
12408
+ const mainUrl = "https://nftychat-staging.herokuapp.com"; // const mainUrl = "http://localhost:8080";
12409
+
12370
12410
  const [accessToken, setAccessToken] = React.useState(null);
12371
12411
  const [messageText, setMessageText] = React.useState("");
12372
- const [popoverAnchor, setPopoverAnchor] = React.useState(null); // const displayName = "Poapdispenser.eth";
12412
+ const [popoverAnchor, setPopoverAnchor] = React.useState(null);
12413
+ const [displayName, setDisplayName] = React.useState(props.displayName);
12414
+ const [conversations, setConversations] = React.useState([]);
12415
+ const [authenticated, setAuthenticated] = React.useState(false); // const displayName = "Poapdispenser.eth";
12373
12416
  // const address = "0x11B002247efc78A149F4e6aDc9F143b47bE9123D"
12374
12417
  // Wallet modal
12375
12418
  // Connectors 0: metamask, 1:WalletConnect, 2: coinbase
@@ -12380,7 +12423,18 @@ function DmButton(props) {
12380
12423
  if (wagmiError) {
12381
12424
  _t.error("Wallet not detected.");
12382
12425
  }
12383
- }, [wagmiError]);
12426
+ }, [wagmiError]); //useEffect if displayName not defined
12427
+
12428
+ React.useEffect(() => {
12429
+ async function resolveDisplayName() {
12430
+ if (!displayName || displayName === "") {
12431
+ const tempDisplayName = await getDisplayName(props.address);
12432
+ setDisplayName(tempDisplayName);
12433
+ }
12434
+ }
12435
+
12436
+ resolveDisplayName();
12437
+ }, [displayName, props.address]);
12384
12438
  React.useEffect(() => {
12385
12439
  fetch(mainUrl + "/v1/unread_message_count?address=" + props.address, {
12386
12440
  method: "get"
@@ -12388,19 +12442,14 @@ function DmButton(props) {
12388
12442
  return payload.json();
12389
12443
  }).then(data => {
12390
12444
  setNumberOfNotifications(data);
12445
+ console.log(data);
12391
12446
  });
12392
- }, [props.address]); // useEffect to close popover if user is same as props.address
12393
-
12394
- React.useEffect(() => {
12395
- if (props.address === wagmiAddress) {
12396
- setPopoverAnchor(null);
12397
- }
12398
- }, [props.address, wagmiAddress]);
12447
+ }, [props.address]);
12399
12448
 
12400
- async function sendClick() {
12401
- let tempAccessToken = accessToken;
12449
+ async function getAccessToken() {
12450
+ let tempAccessToken = localStorage.getItem("token_" + wagmiAddress);
12402
12451
 
12403
- if (accessToken === null) {
12452
+ if (!tempAccessToken) {
12404
12453
  const message_response = await fetch(mainUrl + "/v1/siwe_message?address=" + wagmiAddress);
12405
12454
  const data = await message_response.json();
12406
12455
  const siwe_message = data.siwe_message;
@@ -12410,6 +12459,49 @@ function DmButton(props) {
12410
12459
  tempAccessToken = await checkSignature(wagmiAddress, signature);
12411
12460
  }
12412
12461
 
12462
+ localStorage.setItem("token_" + wagmiAddress, tempAccessToken);
12463
+ setAuthenticated(true);
12464
+ return tempAccessToken;
12465
+ }
12466
+
12467
+ async function getConversations() {
12468
+ const tempAccessToken = await getAccessToken();
12469
+ fetch(mainUrl + "/v1/conversations", {
12470
+ headers: {
12471
+ Accept: "application/json",
12472
+ "Content-Type": "application/json",
12473
+ Authorization: "Bearer " + tempAccessToken
12474
+ }
12475
+ }).then(response => {
12476
+ if (!response.ok) {
12477
+ response.json().then(data => {
12478
+ _t.error(data["detail"]);
12479
+ }); // TODO: Unsure what error is trying to throw
12480
+
12481
+ throw new Error("error");
12482
+ }
12483
+
12484
+ return response.json();
12485
+ }).then(payload => {
12486
+ setConversations(payload.slice(0, 3));
12487
+ });
12488
+ } // useEffect to get signature after click
12489
+
12490
+
12491
+ React.useEffect(() => {
12492
+ if (!!wagmiAddress && !!popoverAnchor) {
12493
+ getAccessToken();
12494
+ }
12495
+ }, [popoverAnchor, wagmiAddress]); // useEffect to fetch conversations if user is same as props.address
12496
+
12497
+ React.useEffect(() => {
12498
+ if (props.address === wagmiAddress && authenticated) {
12499
+ getConversations();
12500
+ }
12501
+ }, [props.address, wagmiAddress, authenticated]);
12502
+
12503
+ async function sendClick() {
12504
+ const tempAccessToken = await getAccessToken();
12413
12505
  const payload = {
12414
12506
  address: props.address,
12415
12507
  message_text: messageText
@@ -12469,15 +12561,8 @@ function DmButton(props) {
12469
12561
  className: "universal_button__button",
12470
12562
  type: "button",
12471
12563
  onClick: event => {
12472
- if (wagmiAddress === props.address) {
12473
- window.open("https://nftychat.xyz/dms", "_blank");
12474
- } else {
12475
- if (!wagmiAddress) {
12476
- setWalletPopoverOpen(true);
12477
- }
12478
-
12479
- setPopoverAnchor(event.currentTarget);
12480
- }
12564
+ setWalletPopoverOpen(true);
12565
+ setPopoverAnchor(event.currentTarget);
12481
12566
  },
12482
12567
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
12483
12568
  className: "universal_button__icon_container",
@@ -12490,60 +12575,125 @@ function DmButton(props) {
12490
12575
  })]
12491
12576
  }), /*#__PURE__*/jsxRuntime.jsx("span", {
12492
12577
  className: "universal_button__text",
12493
- children: wagmiAddress === props.address ? "Check Messages" : `DM ${props.displayName}`
12578
+ children: popoverAnchor !== null && authenticated === false ? "Waiting for Signature" : wagmiAddress === props.address ? "Recent Messages" : `DM ${displayName ? displayName : shortenAddress(props.address)}`
12494
12579
  })]
12495
12580
  }), /*#__PURE__*/jsxRuntime.jsx(Popover$1, {
12496
12581
  anchorEl: popoverAnchor,
12497
12582
  anchorOrigin: {
12498
- vertical: "bottom",
12583
+ vertical: props.popoverDirection,
12499
12584
  horizontal: "center"
12500
12585
  },
12501
12586
  className: "universal_button_popover",
12587
+ style: props.popoverDirection === "bottom" ? {
12588
+ marginTop: 8
12589
+ } : {
12590
+ marginTop: -8
12591
+ },
12502
12592
  onClose: () => setPopoverAnchor(null),
12503
- open: popoverAnchor !== null && ![null, undefined].includes(wagmiAddress),
12593
+ open: popoverAnchor !== null && authenticated,
12504
12594
  transformOrigin: {
12505
- vertical: "top",
12595
+ vertical: props.popoverDirection === "bottom" ? "top" : "bottom",
12506
12596
  horizontal: "center"
12507
12597
  },
12508
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
12598
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
12509
12599
  className: props.theme === "dark" ? "universal_button_popover__container universal_button_popover__container___dark" : "universal_button_popover__container",
12510
- children: [/*#__PURE__*/jsxRuntime.jsx("textarea", {
12511
- className: "universal_button_popover__textarea",
12512
- spellCheck: false,
12513
- value: messageText,
12514
- onChange: e => setMessageText(e.target.value)
12515
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
12516
- className: "universal_button_popover__content",
12517
- children: [/*#__PURE__*/jsxRuntime.jsx("a", {
12518
- href: "https://nftychat.xyz",
12519
- rel: "noopener noreferrer",
12520
- target: "_blank",
12521
- styel: {
12522
- textDecoration: 'none'
12523
- },
12524
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
12525
- className: "universal_button_popover__content_left",
12526
- children: [/*#__PURE__*/jsxRuntime.jsx("img", {
12527
- src: logo,
12528
- alt: "Logo",
12529
- style: {
12530
- width: 24,
12531
- height: 24
12532
- }
12533
- }), /*#__PURE__*/jsxRuntime.jsx("span", {
12534
- className: "universal_button_popover__user_text",
12535
- children: "Sent via nftychat"
12600
+ children: wagmiAddress === props.address ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
12601
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
12602
+ className: "universal_button_popover__content",
12603
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
12604
+ className: "message_title",
12605
+ children: " Recent Messages "
12606
+ }), /*#__PURE__*/jsxRuntime.jsx("a", {
12607
+ href: "https://nftychat.xyz",
12608
+ rel: "noopener noreferrer",
12609
+ target: "_blank",
12610
+ styel: {
12611
+ textDecoration: 'none'
12612
+ },
12613
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
12614
+ className: "universal_button_popover__subtitle",
12615
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
12616
+ className: "universal_button_popover__link_text",
12617
+ children: "View All"
12618
+ }), /*#__PURE__*/jsxRuntime.jsx("img", {
12619
+ src: logo,
12620
+ alt: "Logo",
12621
+ style: {
12622
+ width: 24,
12623
+ height: 24
12624
+ }
12625
+ })]
12626
+ })
12627
+ })]
12628
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
12629
+ className: "message_separator"
12630
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
12631
+ className: "universal_button_popover__messages",
12632
+ children: conversations.map(conversation => /*#__PURE__*/jsxRuntime.jsxs("div", {
12633
+ className: "message__container",
12634
+ onClick: () => {
12635
+ window.open("https://nftychat.xyz/dms/" + conversation.conversation_id, "_blank");
12636
+ },
12637
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
12638
+ className: "hover_text",
12639
+ children: " View on nftychat"
12640
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
12641
+ className: "message_text__container",
12642
+ children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
12643
+ className: "message_title",
12644
+ children: [" ", conversation.conversation_name]
12645
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
12646
+ className: "message_text",
12647
+ children: conversation.latest_message_text
12648
+ })]
12649
+ }), conversation.unread_message_count > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
12650
+ className: "message__badge",
12651
+ children: conversation.unread_message_count
12536
12652
  })]
12653
+ }, conversation.conversation_id))
12654
+ })]
12655
+ }) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
12656
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
12657
+ className: "universal_button_popover__content_top",
12658
+ children: /*#__PURE__*/jsxRuntime.jsx("textarea", {
12659
+ className: "universal_button_popover__textarea",
12660
+ spellCheck: false,
12661
+ value: messageText,
12662
+ onChange: e => setMessageText(e.target.value)
12537
12663
  })
12538
- }), /*#__PURE__*/jsxRuntime.jsx("button", {
12539
- className: "universal_button_popover__send",
12540
- onClick: sendClick,
12541
- children: /*#__PURE__*/jsxRuntime.jsx(Icon, {
12542
- className: "universal_button_popover__send_icon",
12543
- icon: "ant-design:send-outlined"
12544
- })
12664
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
12665
+ className: "universal_button_popover__content_bottom",
12666
+ children: [/*#__PURE__*/jsxRuntime.jsx("a", {
12667
+ href: "https://nftychat.xyz",
12668
+ rel: "noopener noreferrer",
12669
+ target: "_blank",
12670
+ styel: {
12671
+ textDecoration: 'none'
12672
+ },
12673
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
12674
+ className: "universal_button_popover__content_left",
12675
+ children: [/*#__PURE__*/jsxRuntime.jsx("img", {
12676
+ src: logo,
12677
+ alt: "Logo",
12678
+ style: {
12679
+ width: 24,
12680
+ height: 24
12681
+ }
12682
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
12683
+ className: "universal_button_popover__user_text",
12684
+ children: "Sent via nftychat"
12685
+ })]
12686
+ })
12687
+ }), /*#__PURE__*/jsxRuntime.jsx("button", {
12688
+ className: "universal_button_popover__send",
12689
+ onClick: sendClick,
12690
+ children: /*#__PURE__*/jsxRuntime.jsx(Icon, {
12691
+ className: "universal_button_popover__send_icon",
12692
+ icon: "ant-design:send-outlined"
12693
+ })
12694
+ })]
12545
12695
  })]
12546
- })]
12696
+ })
12547
12697
  })
12548
12698
  }), /*#__PURE__*/jsxRuntime.jsx(Modal$1, {
12549
12699
  "aria-labelledby": "wallet_popover",
@@ -12567,7 +12717,7 @@ function DmButton(props) {
12567
12717
 
12568
12718
  var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
12569
12719
 
12570
- var css = ".universal_button,\n.universal_button *,\n.universal_button_popover__container,\n.universal_button_popover__container *,\n.wallet_popover__modal,\n.wallet_popover__modal * {\n --gray1: hsl(0 0% 99%);\n --gray2: hsl(0 0% 97.3%);\n --gray3: hsl(0 0% 95.1%);\n --gray4: hsl(0 0% 93%);\n --gray5: hsl(0 0% 90.9%);\n --gray6: hsl(0 0% 88.7%);\n --gray7: hsl(0 0% 85.8%);\n --gray8: hsl(0 0% 78%);\n --gray9: hsl(0 0% 56.1%);\n --gray10: hsl(0 0% 52.3%);\n --gray11: hsl(0 0% 43.5%);\n --gray12: hsl(0 0% 9%);\n\n --button-text: #467ee5;\n\n font-family: \"Inter\", sans-serif;\n}\n\n.universal_button___dark,\n.universal_button___dark *,\n.universal_button_popover__container___dark,\n.universal_button_popover__container___dark *,\n.wallet_popover__modal___dark,\n.wallet_popover__modal___dark * {\n --gray1: hsl(0 0% 8.5%);\n --gray2: hsl(0 0% 11%);\n --gray3: hsl(0 0% 13.6%);\n --gray4: hsl(0 0% 15.8%);\n --gray5: hsl(0 0% 17.9%);\n --gray6: hsl(0 0% 20.5%);\n --gray7: hsl(0 0% 24.3%);\n --gray8: hsl(0 0% 31.2%);\n --gray9: hsl(0 0% 43.9%);\n --gray10: hsl(0 0% 49.4%);\n --gray11: hsl(0 0% 62.8%);\n --gray12: hsl(0 0% 93%);\n\n --button-text: #94eede;\n}\n\n.universal_button {\n position: relative;\n}\n\n.universal_button__button {\n align-items: center;\n background-color: var(--gray1);\n border-radius: 9999px;\n border: 1px solid var(--gray2);\n box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);\n color: var(--button-text);\n cursor: pointer;\n display: flex;\n font-family: Inter, sans-serif;\n gap: 8px;\n justify-content: center;\n padding: 8px 16px;\n transition: color 200ms, background-color 200ms;\n}\n\n.universal_button__button:hover {\n background-color: var(--gray3);\n}\n\n.universal_button__icon_container {\n align-items: center;\n display: flex;\n height: 24px;\n justify-content: center;\n position: relative;\n width: 24px;\n}\n\n.universal_button__badge {\n align-items: center;\n background-color: #fa2449;\n border-radius: 9999px;\n color: white;\n display: flex;\n font-size: 10px;\n height: 14px;\n justify-content: center;\n position: absolute;\n right: -4px;\n top: -4px;\n width: 14px;\n}\n\n.universal_button__icon {\n height: 100%;\n width: 100%;\n}\n\n.universal_button__text {\n font-size: 16px;\n font-weight: 400;\n}\n\n.universal_button_popover {\n border-radius: 6px;\n margin-top: 8px;\n}\n\n.universal_button_popover__container {\n background-color: var(--gray1);\n display: flex;\n flex-direction: column;\n padding: 16px 16px 8px 16px;\n width: 384px;\n}\n\n.universal_button_popover__textarea {\n background-color: var(--gray1);\n border-radius: 6px;\n border: 1px solid var(--gray6);\n color: var(--gray12);\n font-family: Inter, sans-serif;\n font-size: 1rem;\n margin-bottom: 6px;\n min-height: 66px;\n outline: none;\n padding: 8px;\n resize: none;\n transition: border-color 200ms;\n}\n\n.universal_button_popover__textarea:focus {\n border-color: var(--gray8);\n}\n\n.universal_button_popover__content {\n align-items: center;\n display: flex;\n justify-content: space-between;\n}\n\n.universal_button_popover__content_left {\n align-items: center;\n display: flex;\n gap: 8px;\n}\n\n.universal_button_popover__user_text {\n text-decoration: none;\n color: var(--gray11);\n font-family: Inter, sans-serif;\n font-size: 16px;\n}\n\n.universal_button_popover__content a:hover, \n.universal_button_popover__content a:visited, \n.universal_button_popover__content a:link, \n.universal_button_popover__content a:active\n{\n text-decoration: none;\n}\n\n.universal_button_popover__send {\n align-items: center;\n background-color: transparent;\n border-radius: 9999px;\n border: none;\n color: var(--button-text);\n cursor: pointer;\n display: flex;\n height: 32px;\n justify-content: center;\n padding: 6px;\n transition: color 200ms, background-color 200ms;\n width: 32px;\n}\n\n.universal_button_popover__send:hover {\n background-color: var(--gray3);\n}\n\n.universal_button_popover__send_icon {\n height: 100%;\n width: 100%;\n}\n\n/* Wallet popover */\n.wallet_popover {\n /* border: red dashed 1px; */\n align-items: center;\n cursor: pointer;\n display: flex;\n height: 100vh;\n justify-content: center;\n width: 100vw;\n}\n\n.wallet_popover__modal {\n align-items: center;\n background-color: var(--gray1);\n border-radius: 14px;\n border: 1px solid var(--gray6);\n box-shadow: 0px 2px 4px rgb(0 0 0 / 6%), 0px 4px 6px rgb(0 0 0 / 10%);\n cursor: default;\n display: flex;\n flex-direction: column;\n gap: 16px;\n margin: 0 24px;\n max-width: 360px;\n overflow: hidden;\n padding: 24px;\n pointer-events: auto;\n position: relative;\n width: 100%;\n z-index: 1;\n}\n\n.wallet_popover__button {\n align-items: center;\n background-color: #298574;\n border-radius: 9999px;\n border: none;\n color: white;\n cursor: pointer;\n cursor: pointer;\n display: flex;\n font-size: 15px;\n font-weight: 500;\n height: 48px;\n justify-content: center;\n transition: background-color 150ms;\n user-select: none;\n width: 164px;\n}\n\n.wallet_popover__button:enabled:hover {\n background-color: hsl(169, 53%, 40%);\n}\n\n.wallet_popover__button:enabled:active {\n background-color: hsl(169, 53%, 45%);\n}\n\n.wallet_popover__button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n";
12720
+ var css = "* {\n --message-height:44px\n}\n.universal_button,\n.universal_button *,\n.universal_button_popover__container,\n.universal_button_popover__container *,\n.wallet_popover__modal,\n.wallet_popover__modal * {\n --gray1: hsl(0 0% 99%);\n --gray2: hsl(0 0% 97.3%);\n --gray3: hsl(0 0% 95.1%);\n --gray4: hsl(0 0% 93%);\n --gray5: hsl(0 0% 90.9%);\n --gray6: hsl(0 0% 88.7%);\n --gray7: hsl(0 0% 85.8%);\n --gray8: hsl(0 0% 78%);\n --gray9: hsl(0 0% 56.1%);\n --gray10: hsl(0 0% 52.3%);\n --gray11: hsl(0 0% 43.5%);\n --gray12: hsl(0 0% 9%);\n\n --button-text: #467ee5;\n\n font-family: \"Inter\", sans-serif;\n}\n\n.universal_button___dark,\n.universal_button___dark *,\n.universal_button_popover__container___dark,\n.universal_button_popover__container___dark *,\n.wallet_popover__modal___dark,\n.wallet_popover__modal___dark * {\n --gray1: hsl(0 0% 8.5%);\n --gray2: hsl(0 0% 11%);\n --gray3: hsl(0 0% 13.6%);\n --gray4: hsl(0 0% 15.8%);\n --gray5: hsl(0 0% 17.9%);\n --gray6: hsl(0 0% 20.5%);\n --gray7: hsl(0 0% 24.3%);\n --gray8: hsl(0 0% 31.2%);\n --gray9: hsl(0 0% 43.9%);\n --gray10: hsl(0 0% 49.4%);\n --gray11: hsl(0 0% 62.8%);\n --gray12: hsl(0 0% 93%);\n\n --button-text: #94eede;\n}\n\n.universal_button {\n position: relative;\n}\n\n.universal_button__button {\n align-items: center;\n background-color: var(--gray1);\n border-radius: 9999px;\n border: 1px solid var(--gray2);\n box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);\n color: var(--button-text);\n cursor: pointer;\n display: flex;\n font-family: Inter, sans-serif;\n gap: 8px;\n justify-content: center;\n padding: 8px 16px;\n transition: color 200ms, background-color 200ms;\n}\n\n.universal_button__button:hover {\n background-color: var(--gray3);\n}\n\n.universal_button__icon_container {\n align-items: center;\n display: flex;\n height: 24px;\n justify-content: center;\n position: relative;\n width: 24px;\n}\n\n.universal_button__badge {\n align-items: center;\n background-color: #fa2449;\n border-radius: 9999px;\n color: white;\n display: flex;\n font-size: 10px;\n height: 14px;\n justify-content: center;\n position: absolute;\n right: -4px;\n top: -4px;\n width: 14px;\n}\n\n.universal_button__icon {\n height: 100%;\n width: 100%;\n}\n\n.universal_button__text {\n font-size: 16px;\n font-weight: 400;\n}\n\n.universal_button_popover {\n border-radius: 6px;\n}\n\n\n.universal_button_popover__container {\n background-color: var(--gray1);\n display: flex;\n flex-direction: column;\n width: 384px;\n}\n\n.universal_button_popover__textarea {\n background-color: var(--gray1);\n border-radius: 6px;\n border: 1px solid var(--gray6);\n color: var(--gray12);\n font-family: Inter, sans-serif;\n font-size: 1rem;\n margin-bottom: 6px;\n min-height: 66px;\n outline: none;\n padding: 8px;\n resize: none;\n transition: border-color 200ms;\n flex: auto;\n}\n\n.universal_button_popover__textarea:focus {\n border-color: var(--gray8);\n}\n\n\n/* recent messages */\n.universal_button_popover__messages {\n display: flex;\n justify-content: space-between;\n margin: 12px; \n flex-direction: column;\n}\n\n.message__container{\n margin-bottom: 8px; \n display: flex;\n justify-content: space-between;\n cursor: pointer;\n height: var(--message-height);\n}\n\n.message_title{\n font-family: Inter;\n font-size: 16px;\n font-weight: 600;\n line-height: 19px;\n letter-spacing: 0em;\n text-align: left;\n color: var(--gray12)\n}\n.message_text{\n font-family: Inter;\n font-size: 16px;\n font-weight: 400;\n line-height: 24px;\n letter-spacing: 0em;\n text-align: left;\n color: var(--gray10);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.message_separator {\n width: 100%;\n border: 1px solid var(--gray6);\n height: 0px;\n margin-bottom: 12px;\n}\n.message_text__container{\n display: flex;\n flex-direction: column;\n}\n\n.message__badge {\n align-items: center;\n background-color: #fa2449;\n border-radius: 9999px;\n color: white;\n display: flex;\n font-size: 10px;\n height: 14px;\n justify-content: center;\n width: 14px;\n}\n.hover_text {\n color: var(--button-text);\n opacity: 0;\n -webkit-transition: all 300ms ease-in-out;\n -o-transition: all 300ms ease-in-out;\n transition: all 300ms ease-in-out;\n text-align: center;\n position: absolute;\n display: flex;\n align-items: center; /** Y-axis align **/\n justify-content: center; /** X-axis align **/\n width: 98%;\n height: var(--message-height);\n}\n.message__container:hover .message_text__container,\n.message__container:hover .message__badge{\n -webkit-transition: all 300ms ease-in-out;\n -o-transition: all 300ms ease-in-out;\n transition: all 300ms ease-in-out;\n -webkit-filter: blur(2px);\n -moz-filter: blur(2px);\n -ms-filter: blur(2px);\n -o-filter: blur(2px);\n filter: blur(2px);\n}\n.message__container:hover .hover_text {\n -webkit-opacity: 1;\n opacity: 1;\n}\n\n\n.universal_button_popover__content {\n align-items: center;\n display: flex;\n justify-content: space-between;\n margin: 12px;\n}\n\n.universal_button_popover__content_top {\n align-items: center;\n display: flex;\n justify-content: space-between;\n margin: 12px 12px 8px 12px;\n}\n\n.universal_button_popover__content_bottom {\n align-items: center;\n display: flex;\n justify-content: space-between;\n margin: 0px 12px 12px 12px;\n}\n\n.universal_button_popover__content_left {\n align-items: center;\n display: flex;\n gap: 8px;\n}\n\n.universal_button_popover__subtitle{\n align-items: center;\n display: flex;\n gap: 8px;\n}\n\n.universal_button_popover__user_text {\n text-decoration: none;\n color: var(--gray11);\n font-family: Inter, sans-serif;\n font-size: 16px;\n}\n\n\n.universal_button_popover__link_text{\n color: var(--button-text);\n}\n\n.universal_button_popover__content a:hover, \n.universal_button_popover__content a:visited, \n.universal_button_popover__content a:link, \n.universal_button_popover__content a:active\n{\n text-decoration: none;\n}\n\n.universal_button_popover__send {\n align-items: center;\n background-color: transparent;\n border-radius: 9999px;\n border: none;\n color: var(--button-text);\n cursor: pointer;\n display: flex;\n height: 32px;\n justify-content: center;\n padding: 6px;\n transition: color 200ms, background-color 200ms;\n width: 32px;\n}\n\n.universal_button_popover__send:hover {\n background-color: var(--gray3);\n}\n\n.universal_button_popover__send_icon {\n height: 100%;\n width: 100%;\n}\n\n/* Wallet popover */\n.wallet_popover {\n /* border: red dashed 1px; */\n align-items: center;\n cursor: pointer;\n display: flex;\n height: 100vh;\n justify-content: center;\n width: 100vw;\n}\n\n.wallet_popover__modal {\n align-items: center;\n background-color: var(--gray1);\n border-radius: 14px;\n border: 1px solid var(--gray6);\n box-shadow: 0px 2px 4px rgb(0 0 0 / 6%), 0px 4px 6px rgb(0 0 0 / 10%);\n cursor: default;\n display: flex;\n flex-direction: column;\n gap: 16px;\n margin: 0 24px;\n max-width: 360px;\n overflow: hidden;\n padding: 24px;\n pointer-events: auto;\n position: relative;\n width: 100%;\n z-index: 1;\n}\n\n.wallet_popover__button {\n align-items: center;\n background-color: #298574;\n border-radius: 9999px;\n border: none;\n color: white;\n cursor: pointer;\n cursor: pointer;\n display: flex;\n font-size: 15px;\n font-weight: 500;\n height: 48px;\n justify-content: center;\n transition: background-color 150ms;\n user-select: none;\n width: 164px;\n}\n\n.wallet_popover__button:enabled:hover {\n background-color: hsl(169, 53%, 40%);\n}\n\n.wallet_popover__button:enabled:active {\n background-color: hsl(169, 53%, 45%);\n}\n\n.wallet_popover__button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n";
12571
12721
  n(css,{});
12572
12722
 
12573
12723
  const {
@@ -12597,7 +12747,8 @@ function UniversalDm(props) {
12597
12747
  children: [/*#__PURE__*/jsxRuntime.jsx(Ie, {}), /*#__PURE__*/jsxRuntime.jsx(DmButton, {
12598
12748
  address: props.address,
12599
12749
  displayName: props.displayName,
12600
- theme: props.theme || "light"
12750
+ theme: props.theme || "light",
12751
+ popoverDirection: props.popoverDirection || "top"
12601
12752
  })]
12602
12753
  });
12603
12754
  }
package/dist/index.esm.js CHANGED
@@ -5,7 +5,7 @@ import { CoinbaseWalletConnector } from 'wagmi/connectors/coinbaseWallet';
5
5
  import { MetaMaskConnector } from 'wagmi/connectors/metaMask';
6
6
  import { WalletConnectConnector } from 'wagmi/connectors/walletConnect';
7
7
  import { publicProvider } from 'wagmi/providers/public';
8
- import { jsxs, jsx } from 'react/jsx-runtime';
8
+ import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
9
9
  import * as ReactDOM from 'react-dom';
10
10
  import ReactDOM__default from 'react-dom';
11
11
 
@@ -6185,7 +6185,7 @@ function getWrappedName(outerType, innerType, wrapperName) {
6185
6185
  */
6186
6186
 
6187
6187
 
6188
- function getDisplayName(Component) {
6188
+ function getDisplayName$1(Component) {
6189
6189
  if (Component == null) {
6190
6190
  return undefined;
6191
6191
  }
@@ -7798,7 +7798,7 @@ function createStyled(input = {}) {
7798
7798
  }
7799
7799
 
7800
7800
  if (displayName === undefined) {
7801
- displayName = `Styled(${getDisplayName(tag)})`;
7801
+ displayName = `Styled(${getDisplayName$1(tag)})`;
7802
7802
  }
7803
7803
 
7804
7804
  Component.displayName = displayName;
@@ -12322,6 +12322,45 @@ var Popover$1 = Popover;
12322
12322
 
12323
12323
  var logo = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub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wPuZkfgC/GWFA2Bxn2tNRdKfl6ree3fzBzU5wX7/v0DQZ1tpqiB8bsqw3BprKI9dXCPL33U+GpHxLAFmrVr6wiEwP+Vas+1XWlR02fW9pKbGarH732DG3TQFf9UqJgwZAgdh9212lY7GddSi68UsaaixWkKBBwB+AkC+ntoJcIGYnw+b5OdOlG1X3viYJCm5244DVekwWTYRoYJBZUjhn+hixhEhqJr9A/vGRgL1IuXd4aaDr80NS7yRwCt58IuibI2SPQx+j5gOhyV+85OVW/X5xEeBKX1fbKqpMZyx+UsMzEuZsBhERWCaD3AWABtG90t6APQA1AfgS0BuIUaLDP5kYW/6ib3l5brFWOPxf6w6mf8F5a6JAAAAAElFTkSuQmCC";
12324
12324
 
12325
+ /**
12326
+ * Get ENS infomation resolved from the provided wallet address or ENS name
12327
+ * @param { string } - wallet address or ENS name
12328
+ * @returns { object } - { address, name, displayName, avatar }
12329
+ * @example getEnsInfo("0x8206a305Ad4dAb5117B5F1B7C200cD348d2b7a5D") returns { address: "0x...", displayName: "natt.eth" }
12330
+ * @example getEnsInfo("natt.eth") // returns { address: "0x...", displayName: "natt.eth" }
12331
+ * @example getEnsInfo("0x6CFd4180D5bFBFA467213e10e268B488F68e0460") // returns { address: "0x...", displayName: "0x..." } because not resolved to an ENS name
12332
+ */
12333
+ async function getDisplayName(param) {
12334
+ // Caching system
12335
+ // 1. Gets cached data and returns cached data if matched
12336
+ let sessionCache = sessionStorage.getItem("display_name_session_cache");
12337
+ let sessionCacheSerialize = {};
12338
+
12339
+ if (sessionCache !== null) {
12340
+ sessionCacheSerialize = JSON.parse(sessionCache);
12341
+ const cacheData = sessionCacheSerialize[param];
12342
+
12343
+ if (cacheData !== undefined) {
12344
+ console.log("cacheData", cacheData);
12345
+ return cacheData['displayName'];
12346
+ }
12347
+ } // Fetches data if not in cache
12348
+
12349
+
12350
+ const url = `https://api.ensideas.com/ens/resolve/${param}`;
12351
+ const response = await fetch(url);
12352
+ const data = await response.json(); // Caching system
12353
+ // 2. Set cache data
12354
+
12355
+ sessionCacheSerialize[param] = data;
12356
+ sessionStorage.setItem("display_name_session_cache", JSON.stringify(sessionCacheSerialize));
12357
+ console.log(data);
12358
+ return data['displayName'];
12359
+ }
12360
+ const shortenAddress = address => {
12361
+ return address.slice(0, 6) + "..." + address.slice(-4);
12362
+ };
12363
+
12325
12364
  function DmButton(props) {
12326
12365
  // Wamgi hooks
12327
12366
  const {
@@ -12339,10 +12378,14 @@ function DmButton(props) {
12339
12378
  } = useSignMessage(); // Custom states
12340
12379
 
12341
12380
  const [numberOfNotifications, setNumberOfNotifications] = useState(0);
12342
- const mainUrl = "https://nftychat-staging.herokuapp.com";
12381
+ const mainUrl = "https://nftychat-staging.herokuapp.com"; // const mainUrl = "http://localhost:8080";
12382
+
12343
12383
  const [accessToken, setAccessToken] = useState(null);
12344
12384
  const [messageText, setMessageText] = useState("");
12345
- const [popoverAnchor, setPopoverAnchor] = useState(null); // const displayName = "Poapdispenser.eth";
12385
+ const [popoverAnchor, setPopoverAnchor] = useState(null);
12386
+ const [displayName, setDisplayName] = useState(props.displayName);
12387
+ const [conversations, setConversations] = useState([]);
12388
+ const [authenticated, setAuthenticated] = useState(false); // const displayName = "Poapdispenser.eth";
12346
12389
  // const address = "0x11B002247efc78A149F4e6aDc9F143b47bE9123D"
12347
12390
  // Wallet modal
12348
12391
  // Connectors 0: metamask, 1:WalletConnect, 2: coinbase
@@ -12353,7 +12396,18 @@ function DmButton(props) {
12353
12396
  if (wagmiError) {
12354
12397
  _t.error("Wallet not detected.");
12355
12398
  }
12356
- }, [wagmiError]);
12399
+ }, [wagmiError]); //useEffect if displayName not defined
12400
+
12401
+ useEffect(() => {
12402
+ async function resolveDisplayName() {
12403
+ if (!displayName || displayName === "") {
12404
+ const tempDisplayName = await getDisplayName(props.address);
12405
+ setDisplayName(tempDisplayName);
12406
+ }
12407
+ }
12408
+
12409
+ resolveDisplayName();
12410
+ }, [displayName, props.address]);
12357
12411
  useEffect(() => {
12358
12412
  fetch(mainUrl + "/v1/unread_message_count?address=" + props.address, {
12359
12413
  method: "get"
@@ -12361,19 +12415,14 @@ function DmButton(props) {
12361
12415
  return payload.json();
12362
12416
  }).then(data => {
12363
12417
  setNumberOfNotifications(data);
12418
+ console.log(data);
12364
12419
  });
12365
- }, [props.address]); // useEffect to close popover if user is same as props.address
12366
-
12367
- useEffect(() => {
12368
- if (props.address === wagmiAddress) {
12369
- setPopoverAnchor(null);
12370
- }
12371
- }, [props.address, wagmiAddress]);
12420
+ }, [props.address]);
12372
12421
 
12373
- async function sendClick() {
12374
- let tempAccessToken = accessToken;
12422
+ async function getAccessToken() {
12423
+ let tempAccessToken = localStorage.getItem("token_" + wagmiAddress);
12375
12424
 
12376
- if (accessToken === null) {
12425
+ if (!tempAccessToken) {
12377
12426
  const message_response = await fetch(mainUrl + "/v1/siwe_message?address=" + wagmiAddress);
12378
12427
  const data = await message_response.json();
12379
12428
  const siwe_message = data.siwe_message;
@@ -12383,6 +12432,49 @@ function DmButton(props) {
12383
12432
  tempAccessToken = await checkSignature(wagmiAddress, signature);
12384
12433
  }
12385
12434
 
12435
+ localStorage.setItem("token_" + wagmiAddress, tempAccessToken);
12436
+ setAuthenticated(true);
12437
+ return tempAccessToken;
12438
+ }
12439
+
12440
+ async function getConversations() {
12441
+ const tempAccessToken = await getAccessToken();
12442
+ fetch(mainUrl + "/v1/conversations", {
12443
+ headers: {
12444
+ Accept: "application/json",
12445
+ "Content-Type": "application/json",
12446
+ Authorization: "Bearer " + tempAccessToken
12447
+ }
12448
+ }).then(response => {
12449
+ if (!response.ok) {
12450
+ response.json().then(data => {
12451
+ _t.error(data["detail"]);
12452
+ }); // TODO: Unsure what error is trying to throw
12453
+
12454
+ throw new Error("error");
12455
+ }
12456
+
12457
+ return response.json();
12458
+ }).then(payload => {
12459
+ setConversations(payload.slice(0, 3));
12460
+ });
12461
+ } // useEffect to get signature after click
12462
+
12463
+
12464
+ useEffect(() => {
12465
+ if (!!wagmiAddress && !!popoverAnchor) {
12466
+ getAccessToken();
12467
+ }
12468
+ }, [popoverAnchor, wagmiAddress]); // useEffect to fetch conversations if user is same as props.address
12469
+
12470
+ useEffect(() => {
12471
+ if (props.address === wagmiAddress && authenticated) {
12472
+ getConversations();
12473
+ }
12474
+ }, [props.address, wagmiAddress, authenticated]);
12475
+
12476
+ async function sendClick() {
12477
+ const tempAccessToken = await getAccessToken();
12386
12478
  const payload = {
12387
12479
  address: props.address,
12388
12480
  message_text: messageText
@@ -12442,15 +12534,8 @@ function DmButton(props) {
12442
12534
  className: "universal_button__button",
12443
12535
  type: "button",
12444
12536
  onClick: event => {
12445
- if (wagmiAddress === props.address) {
12446
- window.open("https://nftychat.xyz/dms", "_blank");
12447
- } else {
12448
- if (!wagmiAddress) {
12449
- setWalletPopoverOpen(true);
12450
- }
12451
-
12452
- setPopoverAnchor(event.currentTarget);
12453
- }
12537
+ setWalletPopoverOpen(true);
12538
+ setPopoverAnchor(event.currentTarget);
12454
12539
  },
12455
12540
  children: [/*#__PURE__*/jsxs("div", {
12456
12541
  className: "universal_button__icon_container",
@@ -12463,60 +12548,125 @@ function DmButton(props) {
12463
12548
  })]
12464
12549
  }), /*#__PURE__*/jsx("span", {
12465
12550
  className: "universal_button__text",
12466
- children: wagmiAddress === props.address ? "Check Messages" : `DM ${props.displayName}`
12551
+ children: popoverAnchor !== null && authenticated === false ? "Waiting for Signature" : wagmiAddress === props.address ? "Recent Messages" : `DM ${displayName ? displayName : shortenAddress(props.address)}`
12467
12552
  })]
12468
12553
  }), /*#__PURE__*/jsx(Popover$1, {
12469
12554
  anchorEl: popoverAnchor,
12470
12555
  anchorOrigin: {
12471
- vertical: "bottom",
12556
+ vertical: props.popoverDirection,
12472
12557
  horizontal: "center"
12473
12558
  },
12474
12559
  className: "universal_button_popover",
12560
+ style: props.popoverDirection === "bottom" ? {
12561
+ marginTop: 8
12562
+ } : {
12563
+ marginTop: -8
12564
+ },
12475
12565
  onClose: () => setPopoverAnchor(null),
12476
- open: popoverAnchor !== null && ![null, undefined].includes(wagmiAddress),
12566
+ open: popoverAnchor !== null && authenticated,
12477
12567
  transformOrigin: {
12478
- vertical: "top",
12568
+ vertical: props.popoverDirection === "bottom" ? "top" : "bottom",
12479
12569
  horizontal: "center"
12480
12570
  },
12481
- children: /*#__PURE__*/jsxs("div", {
12571
+ children: /*#__PURE__*/jsx("div", {
12482
12572
  className: props.theme === "dark" ? "universal_button_popover__container universal_button_popover__container___dark" : "universal_button_popover__container",
12483
- children: [/*#__PURE__*/jsx("textarea", {
12484
- className: "universal_button_popover__textarea",
12485
- spellCheck: false,
12486
- value: messageText,
12487
- onChange: e => setMessageText(e.target.value)
12488
- }), /*#__PURE__*/jsxs("div", {
12489
- className: "universal_button_popover__content",
12490
- children: [/*#__PURE__*/jsx("a", {
12491
- href: "https://nftychat.xyz",
12492
- rel: "noopener noreferrer",
12493
- target: "_blank",
12494
- styel: {
12495
- textDecoration: 'none'
12496
- },
12497
- children: /*#__PURE__*/jsxs("div", {
12498
- className: "universal_button_popover__content_left",
12499
- children: [/*#__PURE__*/jsx("img", {
12500
- src: logo,
12501
- alt: "Logo",
12502
- style: {
12503
- width: 24,
12504
- height: 24
12505
- }
12506
- }), /*#__PURE__*/jsx("span", {
12507
- className: "universal_button_popover__user_text",
12508
- children: "Sent via nftychat"
12573
+ children: wagmiAddress === props.address ? /*#__PURE__*/jsxs(Fragment$1, {
12574
+ children: [/*#__PURE__*/jsxs("div", {
12575
+ className: "universal_button_popover__content",
12576
+ children: [/*#__PURE__*/jsx("span", {
12577
+ className: "message_title",
12578
+ children: " Recent Messages "
12579
+ }), /*#__PURE__*/jsx("a", {
12580
+ href: "https://nftychat.xyz",
12581
+ rel: "noopener noreferrer",
12582
+ target: "_blank",
12583
+ styel: {
12584
+ textDecoration: 'none'
12585
+ },
12586
+ children: /*#__PURE__*/jsxs("div", {
12587
+ className: "universal_button_popover__subtitle",
12588
+ children: [/*#__PURE__*/jsx("span", {
12589
+ className: "universal_button_popover__link_text",
12590
+ children: "View All"
12591
+ }), /*#__PURE__*/jsx("img", {
12592
+ src: logo,
12593
+ alt: "Logo",
12594
+ style: {
12595
+ width: 24,
12596
+ height: 24
12597
+ }
12598
+ })]
12599
+ })
12600
+ })]
12601
+ }), /*#__PURE__*/jsx("div", {
12602
+ className: "message_separator"
12603
+ }), /*#__PURE__*/jsx("div", {
12604
+ className: "universal_button_popover__messages",
12605
+ children: conversations.map(conversation => /*#__PURE__*/jsxs("div", {
12606
+ className: "message__container",
12607
+ onClick: () => {
12608
+ window.open("https://nftychat.xyz/dms/" + conversation.conversation_id, "_blank");
12609
+ },
12610
+ children: [/*#__PURE__*/jsx("div", {
12611
+ className: "hover_text",
12612
+ children: " View on nftychat"
12613
+ }), /*#__PURE__*/jsxs("div", {
12614
+ className: "message_text__container",
12615
+ children: [/*#__PURE__*/jsxs("span", {
12616
+ className: "message_title",
12617
+ children: [" ", conversation.conversation_name]
12618
+ }), /*#__PURE__*/jsx("span", {
12619
+ className: "message_text",
12620
+ children: conversation.latest_message_text
12621
+ })]
12622
+ }), conversation.unread_message_count > 0 && /*#__PURE__*/jsx("div", {
12623
+ className: "message__badge",
12624
+ children: conversation.unread_message_count
12509
12625
  })]
12626
+ }, conversation.conversation_id))
12627
+ })]
12628
+ }) : /*#__PURE__*/jsxs(Fragment$1, {
12629
+ children: [/*#__PURE__*/jsx("div", {
12630
+ className: "universal_button_popover__content_top",
12631
+ children: /*#__PURE__*/jsx("textarea", {
12632
+ className: "universal_button_popover__textarea",
12633
+ spellCheck: false,
12634
+ value: messageText,
12635
+ onChange: e => setMessageText(e.target.value)
12510
12636
  })
12511
- }), /*#__PURE__*/jsx("button", {
12512
- className: "universal_button_popover__send",
12513
- onClick: sendClick,
12514
- children: /*#__PURE__*/jsx(Icon, {
12515
- className: "universal_button_popover__send_icon",
12516
- icon: "ant-design:send-outlined"
12517
- })
12637
+ }), /*#__PURE__*/jsxs("div", {
12638
+ className: "universal_button_popover__content_bottom",
12639
+ children: [/*#__PURE__*/jsx("a", {
12640
+ href: "https://nftychat.xyz",
12641
+ rel: "noopener noreferrer",
12642
+ target: "_blank",
12643
+ styel: {
12644
+ textDecoration: 'none'
12645
+ },
12646
+ children: /*#__PURE__*/jsxs("div", {
12647
+ className: "universal_button_popover__content_left",
12648
+ children: [/*#__PURE__*/jsx("img", {
12649
+ src: logo,
12650
+ alt: "Logo",
12651
+ style: {
12652
+ width: 24,
12653
+ height: 24
12654
+ }
12655
+ }), /*#__PURE__*/jsx("span", {
12656
+ className: "universal_button_popover__user_text",
12657
+ children: "Sent via nftychat"
12658
+ })]
12659
+ })
12660
+ }), /*#__PURE__*/jsx("button", {
12661
+ className: "universal_button_popover__send",
12662
+ onClick: sendClick,
12663
+ children: /*#__PURE__*/jsx(Icon, {
12664
+ className: "universal_button_popover__send_icon",
12665
+ icon: "ant-design:send-outlined"
12666
+ })
12667
+ })]
12518
12668
  })]
12519
- })]
12669
+ })
12520
12670
  })
12521
12671
  }), /*#__PURE__*/jsx(Modal$1, {
12522
12672
  "aria-labelledby": "wallet_popover",
@@ -12540,7 +12690,7 @@ function DmButton(props) {
12540
12690
 
12541
12691
  var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
12542
12692
 
12543
- var css = ".universal_button,\n.universal_button *,\n.universal_button_popover__container,\n.universal_button_popover__container *,\n.wallet_popover__modal,\n.wallet_popover__modal * {\n --gray1: hsl(0 0% 99%);\n --gray2: hsl(0 0% 97.3%);\n --gray3: hsl(0 0% 95.1%);\n --gray4: hsl(0 0% 93%);\n --gray5: hsl(0 0% 90.9%);\n --gray6: hsl(0 0% 88.7%);\n --gray7: hsl(0 0% 85.8%);\n --gray8: hsl(0 0% 78%);\n --gray9: hsl(0 0% 56.1%);\n --gray10: hsl(0 0% 52.3%);\n --gray11: hsl(0 0% 43.5%);\n --gray12: hsl(0 0% 9%);\n\n --button-text: #467ee5;\n\n font-family: \"Inter\", sans-serif;\n}\n\n.universal_button___dark,\n.universal_button___dark *,\n.universal_button_popover__container___dark,\n.universal_button_popover__container___dark *,\n.wallet_popover__modal___dark,\n.wallet_popover__modal___dark * {\n --gray1: hsl(0 0% 8.5%);\n --gray2: hsl(0 0% 11%);\n --gray3: hsl(0 0% 13.6%);\n --gray4: hsl(0 0% 15.8%);\n --gray5: hsl(0 0% 17.9%);\n --gray6: hsl(0 0% 20.5%);\n --gray7: hsl(0 0% 24.3%);\n --gray8: hsl(0 0% 31.2%);\n --gray9: hsl(0 0% 43.9%);\n --gray10: hsl(0 0% 49.4%);\n --gray11: hsl(0 0% 62.8%);\n --gray12: hsl(0 0% 93%);\n\n --button-text: #94eede;\n}\n\n.universal_button {\n position: relative;\n}\n\n.universal_button__button {\n align-items: center;\n background-color: var(--gray1);\n border-radius: 9999px;\n border: 1px solid var(--gray2);\n box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);\n color: var(--button-text);\n cursor: pointer;\n display: flex;\n font-family: Inter, sans-serif;\n gap: 8px;\n justify-content: center;\n padding: 8px 16px;\n transition: color 200ms, background-color 200ms;\n}\n\n.universal_button__button:hover {\n background-color: var(--gray3);\n}\n\n.universal_button__icon_container {\n align-items: center;\n display: flex;\n height: 24px;\n justify-content: center;\n position: relative;\n width: 24px;\n}\n\n.universal_button__badge {\n align-items: center;\n background-color: #fa2449;\n border-radius: 9999px;\n color: white;\n display: flex;\n font-size: 10px;\n height: 14px;\n justify-content: center;\n position: absolute;\n right: -4px;\n top: -4px;\n width: 14px;\n}\n\n.universal_button__icon {\n height: 100%;\n width: 100%;\n}\n\n.universal_button__text {\n font-size: 16px;\n font-weight: 400;\n}\n\n.universal_button_popover {\n border-radius: 6px;\n margin-top: 8px;\n}\n\n.universal_button_popover__container {\n background-color: var(--gray1);\n display: flex;\n flex-direction: column;\n padding: 16px 16px 8px 16px;\n width: 384px;\n}\n\n.universal_button_popover__textarea {\n background-color: var(--gray1);\n border-radius: 6px;\n border: 1px solid var(--gray6);\n color: var(--gray12);\n font-family: Inter, sans-serif;\n font-size: 1rem;\n margin-bottom: 6px;\n min-height: 66px;\n outline: none;\n padding: 8px;\n resize: none;\n transition: border-color 200ms;\n}\n\n.universal_button_popover__textarea:focus {\n border-color: var(--gray8);\n}\n\n.universal_button_popover__content {\n align-items: center;\n display: flex;\n justify-content: space-between;\n}\n\n.universal_button_popover__content_left {\n align-items: center;\n display: flex;\n gap: 8px;\n}\n\n.universal_button_popover__user_text {\n text-decoration: none;\n color: var(--gray11);\n font-family: Inter, sans-serif;\n font-size: 16px;\n}\n\n.universal_button_popover__content a:hover, \n.universal_button_popover__content a:visited, \n.universal_button_popover__content a:link, \n.universal_button_popover__content a:active\n{\n text-decoration: none;\n}\n\n.universal_button_popover__send {\n align-items: center;\n background-color: transparent;\n border-radius: 9999px;\n border: none;\n color: var(--button-text);\n cursor: pointer;\n display: flex;\n height: 32px;\n justify-content: center;\n padding: 6px;\n transition: color 200ms, background-color 200ms;\n width: 32px;\n}\n\n.universal_button_popover__send:hover {\n background-color: var(--gray3);\n}\n\n.universal_button_popover__send_icon {\n height: 100%;\n width: 100%;\n}\n\n/* Wallet popover */\n.wallet_popover {\n /* border: red dashed 1px; */\n align-items: center;\n cursor: pointer;\n display: flex;\n height: 100vh;\n justify-content: center;\n width: 100vw;\n}\n\n.wallet_popover__modal {\n align-items: center;\n background-color: var(--gray1);\n border-radius: 14px;\n border: 1px solid var(--gray6);\n box-shadow: 0px 2px 4px rgb(0 0 0 / 6%), 0px 4px 6px rgb(0 0 0 / 10%);\n cursor: default;\n display: flex;\n flex-direction: column;\n gap: 16px;\n margin: 0 24px;\n max-width: 360px;\n overflow: hidden;\n padding: 24px;\n pointer-events: auto;\n position: relative;\n width: 100%;\n z-index: 1;\n}\n\n.wallet_popover__button {\n align-items: center;\n background-color: #298574;\n border-radius: 9999px;\n border: none;\n color: white;\n cursor: pointer;\n cursor: pointer;\n display: flex;\n font-size: 15px;\n font-weight: 500;\n height: 48px;\n justify-content: center;\n transition: background-color 150ms;\n user-select: none;\n width: 164px;\n}\n\n.wallet_popover__button:enabled:hover {\n background-color: hsl(169, 53%, 40%);\n}\n\n.wallet_popover__button:enabled:active {\n background-color: hsl(169, 53%, 45%);\n}\n\n.wallet_popover__button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n";
12693
+ var css = "* {\n --message-height:44px\n}\n.universal_button,\n.universal_button *,\n.universal_button_popover__container,\n.universal_button_popover__container *,\n.wallet_popover__modal,\n.wallet_popover__modal * {\n --gray1: hsl(0 0% 99%);\n --gray2: hsl(0 0% 97.3%);\n --gray3: hsl(0 0% 95.1%);\n --gray4: hsl(0 0% 93%);\n --gray5: hsl(0 0% 90.9%);\n --gray6: hsl(0 0% 88.7%);\n --gray7: hsl(0 0% 85.8%);\n --gray8: hsl(0 0% 78%);\n --gray9: hsl(0 0% 56.1%);\n --gray10: hsl(0 0% 52.3%);\n --gray11: hsl(0 0% 43.5%);\n --gray12: hsl(0 0% 9%);\n\n --button-text: #467ee5;\n\n font-family: \"Inter\", sans-serif;\n}\n\n.universal_button___dark,\n.universal_button___dark *,\n.universal_button_popover__container___dark,\n.universal_button_popover__container___dark *,\n.wallet_popover__modal___dark,\n.wallet_popover__modal___dark * {\n --gray1: hsl(0 0% 8.5%);\n --gray2: hsl(0 0% 11%);\n --gray3: hsl(0 0% 13.6%);\n --gray4: hsl(0 0% 15.8%);\n --gray5: hsl(0 0% 17.9%);\n --gray6: hsl(0 0% 20.5%);\n --gray7: hsl(0 0% 24.3%);\n --gray8: hsl(0 0% 31.2%);\n --gray9: hsl(0 0% 43.9%);\n --gray10: hsl(0 0% 49.4%);\n --gray11: hsl(0 0% 62.8%);\n --gray12: hsl(0 0% 93%);\n\n --button-text: #94eede;\n}\n\n.universal_button {\n position: relative;\n}\n\n.universal_button__button {\n align-items: center;\n background-color: var(--gray1);\n border-radius: 9999px;\n border: 1px solid var(--gray2);\n box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);\n color: var(--button-text);\n cursor: pointer;\n display: flex;\n font-family: Inter, sans-serif;\n gap: 8px;\n justify-content: center;\n padding: 8px 16px;\n transition: color 200ms, background-color 200ms;\n}\n\n.universal_button__button:hover {\n background-color: var(--gray3);\n}\n\n.universal_button__icon_container {\n align-items: center;\n display: flex;\n height: 24px;\n justify-content: center;\n position: relative;\n width: 24px;\n}\n\n.universal_button__badge {\n align-items: center;\n background-color: #fa2449;\n border-radius: 9999px;\n color: white;\n display: flex;\n font-size: 10px;\n height: 14px;\n justify-content: center;\n position: absolute;\n right: -4px;\n top: -4px;\n width: 14px;\n}\n\n.universal_button__icon {\n height: 100%;\n width: 100%;\n}\n\n.universal_button__text {\n font-size: 16px;\n font-weight: 400;\n}\n\n.universal_button_popover {\n border-radius: 6px;\n}\n\n\n.universal_button_popover__container {\n background-color: var(--gray1);\n display: flex;\n flex-direction: column;\n width: 384px;\n}\n\n.universal_button_popover__textarea {\n background-color: var(--gray1);\n border-radius: 6px;\n border: 1px solid var(--gray6);\n color: var(--gray12);\n font-family: Inter, sans-serif;\n font-size: 1rem;\n margin-bottom: 6px;\n min-height: 66px;\n outline: none;\n padding: 8px;\n resize: none;\n transition: border-color 200ms;\n flex: auto;\n}\n\n.universal_button_popover__textarea:focus {\n border-color: var(--gray8);\n}\n\n\n/* recent messages */\n.universal_button_popover__messages {\n display: flex;\n justify-content: space-between;\n margin: 12px; \n flex-direction: column;\n}\n\n.message__container{\n margin-bottom: 8px; \n display: flex;\n justify-content: space-between;\n cursor: pointer;\n height: var(--message-height);\n}\n\n.message_title{\n font-family: Inter;\n font-size: 16px;\n font-weight: 600;\n line-height: 19px;\n letter-spacing: 0em;\n text-align: left;\n color: var(--gray12)\n}\n.message_text{\n font-family: Inter;\n font-size: 16px;\n font-weight: 400;\n line-height: 24px;\n letter-spacing: 0em;\n text-align: left;\n color: var(--gray10);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.message_separator {\n width: 100%;\n border: 1px solid var(--gray6);\n height: 0px;\n margin-bottom: 12px;\n}\n.message_text__container{\n display: flex;\n flex-direction: column;\n}\n\n.message__badge {\n align-items: center;\n background-color: #fa2449;\n border-radius: 9999px;\n color: white;\n display: flex;\n font-size: 10px;\n height: 14px;\n justify-content: center;\n width: 14px;\n}\n.hover_text {\n color: var(--button-text);\n opacity: 0;\n -webkit-transition: all 300ms ease-in-out;\n -o-transition: all 300ms ease-in-out;\n transition: all 300ms ease-in-out;\n text-align: center;\n position: absolute;\n display: flex;\n align-items: center; /** Y-axis align **/\n justify-content: center; /** X-axis align **/\n width: 98%;\n height: var(--message-height);\n}\n.message__container:hover .message_text__container,\n.message__container:hover .message__badge{\n -webkit-transition: all 300ms ease-in-out;\n -o-transition: all 300ms ease-in-out;\n transition: all 300ms ease-in-out;\n -webkit-filter: blur(2px);\n -moz-filter: blur(2px);\n -ms-filter: blur(2px);\n -o-filter: blur(2px);\n filter: blur(2px);\n}\n.message__container:hover .hover_text {\n -webkit-opacity: 1;\n opacity: 1;\n}\n\n\n.universal_button_popover__content {\n align-items: center;\n display: flex;\n justify-content: space-between;\n margin: 12px;\n}\n\n.universal_button_popover__content_top {\n align-items: center;\n display: flex;\n justify-content: space-between;\n margin: 12px 12px 8px 12px;\n}\n\n.universal_button_popover__content_bottom {\n align-items: center;\n display: flex;\n justify-content: space-between;\n margin: 0px 12px 12px 12px;\n}\n\n.universal_button_popover__content_left {\n align-items: center;\n display: flex;\n gap: 8px;\n}\n\n.universal_button_popover__subtitle{\n align-items: center;\n display: flex;\n gap: 8px;\n}\n\n.universal_button_popover__user_text {\n text-decoration: none;\n color: var(--gray11);\n font-family: Inter, sans-serif;\n font-size: 16px;\n}\n\n\n.universal_button_popover__link_text{\n color: var(--button-text);\n}\n\n.universal_button_popover__content a:hover, \n.universal_button_popover__content a:visited, \n.universal_button_popover__content a:link, \n.universal_button_popover__content a:active\n{\n text-decoration: none;\n}\n\n.universal_button_popover__send {\n align-items: center;\n background-color: transparent;\n border-radius: 9999px;\n border: none;\n color: var(--button-text);\n cursor: pointer;\n display: flex;\n height: 32px;\n justify-content: center;\n padding: 6px;\n transition: color 200ms, background-color 200ms;\n width: 32px;\n}\n\n.universal_button_popover__send:hover {\n background-color: var(--gray3);\n}\n\n.universal_button_popover__send_icon {\n height: 100%;\n width: 100%;\n}\n\n/* Wallet popover */\n.wallet_popover {\n /* border: red dashed 1px; */\n align-items: center;\n cursor: pointer;\n display: flex;\n height: 100vh;\n justify-content: center;\n width: 100vw;\n}\n\n.wallet_popover__modal {\n align-items: center;\n background-color: var(--gray1);\n border-radius: 14px;\n border: 1px solid var(--gray6);\n box-shadow: 0px 2px 4px rgb(0 0 0 / 6%), 0px 4px 6px rgb(0 0 0 / 10%);\n cursor: default;\n display: flex;\n flex-direction: column;\n gap: 16px;\n margin: 0 24px;\n max-width: 360px;\n overflow: hidden;\n padding: 24px;\n pointer-events: auto;\n position: relative;\n width: 100%;\n z-index: 1;\n}\n\n.wallet_popover__button {\n align-items: center;\n background-color: #298574;\n border-radius: 9999px;\n border: none;\n color: white;\n cursor: pointer;\n cursor: pointer;\n display: flex;\n font-size: 15px;\n font-weight: 500;\n height: 48px;\n justify-content: center;\n transition: background-color 150ms;\n user-select: none;\n width: 164px;\n}\n\n.wallet_popover__button:enabled:hover {\n background-color: hsl(169, 53%, 40%);\n}\n\n.wallet_popover__button:enabled:active {\n background-color: hsl(169, 53%, 45%);\n}\n\n.wallet_popover__button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n";
12544
12694
  n(css,{});
12545
12695
 
12546
12696
  const {
@@ -12570,7 +12720,8 @@ function UniversalDm(props) {
12570
12720
  children: [/*#__PURE__*/jsx(Ie, {}), /*#__PURE__*/jsx(DmButton, {
12571
12721
  address: props.address,
12572
12722
  displayName: props.displayName,
12573
- theme: props.theme || "light"
12723
+ theme: props.theme || "light",
12724
+ popoverDirection: props.popoverDirection || "top"
12574
12725
  })]
12575
12726
  });
12576
12727
  }
Binary file
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/nftychat/nftychat-universe"
6
6
  },
7
- "version": "1.2.0",
7
+ "version": "1.3.0",
8
8
  "license": "MIT",
9
9
  "description": "nftychat plugins for your website",
10
10
  "author": "nftychat",