nftychat-universe 1.2.0 → 1.2.1
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 +68 -10
- package/dist/index.esm.js +68 -10
- package/nftychat-universe-v1.2.0.tgz +0 -0
- package/package.json +1 -1
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+Z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APQA1AfgS0BuIUaLDP5kYW/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,12 @@ 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);
|
12412
|
+
const [popoverAnchor, setPopoverAnchor] = React.useState(null);
|
12413
|
+
const [displayName, setDisplayName] = React.useState(props.displayName); // const displayName = "Poapdispenser.eth";
|
12373
12414
|
// const address = "0x11B002247efc78A149F4e6aDc9F143b47bE9123D"
|
12374
12415
|
// Wallet modal
|
12375
12416
|
// Connectors 0: metamask, 1:WalletConnect, 2: coinbase
|
@@ -12380,7 +12421,18 @@ function DmButton(props) {
|
|
12380
12421
|
if (wagmiError) {
|
12381
12422
|
_t.error("Wallet not detected.");
|
12382
12423
|
}
|
12383
|
-
}, [wagmiError]);
|
12424
|
+
}, [wagmiError]); //useEffect if displayName not defined
|
12425
|
+
|
12426
|
+
React.useEffect(() => {
|
12427
|
+
async function resolveDisplayName() {
|
12428
|
+
if (!displayName || displayName === "") {
|
12429
|
+
const tempDisplayName = await getDisplayName(props.address);
|
12430
|
+
setDisplayName(tempDisplayName);
|
12431
|
+
}
|
12432
|
+
}
|
12433
|
+
|
12434
|
+
resolveDisplayName();
|
12435
|
+
}, [displayName, props.address]);
|
12384
12436
|
React.useEffect(() => {
|
12385
12437
|
fetch(mainUrl + "/v1/unread_message_count?address=" + props.address, {
|
12386
12438
|
method: "get"
|
@@ -12490,19 +12542,24 @@ function DmButton(props) {
|
|
12490
12542
|
})]
|
12491
12543
|
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
12492
12544
|
className: "universal_button__text",
|
12493
|
-
children: wagmiAddress === props.address ? "Check Messages" : `DM ${props.
|
12545
|
+
children: wagmiAddress === props.address ? "Check Messages" : `DM ${displayName ? displayName : shortenAddress(props.address)}`
|
12494
12546
|
})]
|
12495
12547
|
}), /*#__PURE__*/jsxRuntime.jsx(Popover$1, {
|
12496
12548
|
anchorEl: popoverAnchor,
|
12497
12549
|
anchorOrigin: {
|
12498
|
-
vertical:
|
12550
|
+
vertical: props.popoverDirection,
|
12499
12551
|
horizontal: "center"
|
12500
12552
|
},
|
12501
12553
|
className: "universal_button_popover",
|
12554
|
+
style: props.popoverDirection === "bottom" ? {
|
12555
|
+
marginTop: 8
|
12556
|
+
} : {
|
12557
|
+
marginTop: -8
|
12558
|
+
},
|
12502
12559
|
onClose: () => setPopoverAnchor(null),
|
12503
12560
|
open: popoverAnchor !== null && ![null, undefined].includes(wagmiAddress),
|
12504
12561
|
transformOrigin: {
|
12505
|
-
vertical: "top",
|
12562
|
+
vertical: props.popoverDirection === "bottom" ? "top" : "bottom",
|
12506
12563
|
horizontal: "center"
|
12507
12564
|
},
|
12508
12565
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
@@ -12567,7 +12624,7 @@ function DmButton(props) {
|
|
12567
12624
|
|
12568
12625
|
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
12626
|
|
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
|
12627
|
+
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}\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";
|
12571
12628
|
n(css,{});
|
12572
12629
|
|
12573
12630
|
const {
|
@@ -12597,7 +12654,8 @@ function UniversalDm(props) {
|
|
12597
12654
|
children: [/*#__PURE__*/jsxRuntime.jsx(Ie, {}), /*#__PURE__*/jsxRuntime.jsx(DmButton, {
|
12598
12655
|
address: props.address,
|
12599
12656
|
displayName: props.displayName,
|
12600
|
-
theme: props.theme || "light"
|
12657
|
+
theme: props.theme || "light",
|
12658
|
+
popoverDirection: props.popoverDirection || "top"
|
12601
12659
|
})]
|
12602
12660
|
});
|
12603
12661
|
}
|
package/dist/index.esm.js
CHANGED
@@ -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,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAACo5JREFUeJzdnHtwVNUdx7+/s3cfSTbJbgiBBIggQuKgaNgwVusrIA+ZMhYpwWFMgNGKtjN2nLH1H6eWcTq1Tttx2qk1PrBsxKkBqS1KSSIErLVW2RQpahLAR0ISAwt57Wbf99c/8k727uPeuyHymYHk3nPO95z7u/fcc36/c24IU8idDQ2SJ9C6jIVYSoTFMstFBFoAIAOAfegnAHgBdAPwgvEFCWphRgvJ8kmrubDxaFlZeKraTKmuwFHvLARjE4AyEG4HI1OTIKEfjPcAPgKifa5Vla36tFSpuhSwtNaZIQkq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tG90t6APQA1AfgS0BuIUaLDP5kYW/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,12 @@ 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);
|
12385
|
+
const [popoverAnchor, setPopoverAnchor] = useState(null);
|
12386
|
+
const [displayName, setDisplayName] = useState(props.displayName); // const displayName = "Poapdispenser.eth";
|
12346
12387
|
// const address = "0x11B002247efc78A149F4e6aDc9F143b47bE9123D"
|
12347
12388
|
// Wallet modal
|
12348
12389
|
// Connectors 0: metamask, 1:WalletConnect, 2: coinbase
|
@@ -12353,7 +12394,18 @@ function DmButton(props) {
|
|
12353
12394
|
if (wagmiError) {
|
12354
12395
|
_t.error("Wallet not detected.");
|
12355
12396
|
}
|
12356
|
-
}, [wagmiError]);
|
12397
|
+
}, [wagmiError]); //useEffect if displayName not defined
|
12398
|
+
|
12399
|
+
useEffect(() => {
|
12400
|
+
async function resolveDisplayName() {
|
12401
|
+
if (!displayName || displayName === "") {
|
12402
|
+
const tempDisplayName = await getDisplayName(props.address);
|
12403
|
+
setDisplayName(tempDisplayName);
|
12404
|
+
}
|
12405
|
+
}
|
12406
|
+
|
12407
|
+
resolveDisplayName();
|
12408
|
+
}, [displayName, props.address]);
|
12357
12409
|
useEffect(() => {
|
12358
12410
|
fetch(mainUrl + "/v1/unread_message_count?address=" + props.address, {
|
12359
12411
|
method: "get"
|
@@ -12463,19 +12515,24 @@ function DmButton(props) {
|
|
12463
12515
|
})]
|
12464
12516
|
}), /*#__PURE__*/jsx("span", {
|
12465
12517
|
className: "universal_button__text",
|
12466
|
-
children: wagmiAddress === props.address ? "Check Messages" : `DM ${props.
|
12518
|
+
children: wagmiAddress === props.address ? "Check Messages" : `DM ${displayName ? displayName : shortenAddress(props.address)}`
|
12467
12519
|
})]
|
12468
12520
|
}), /*#__PURE__*/jsx(Popover$1, {
|
12469
12521
|
anchorEl: popoverAnchor,
|
12470
12522
|
anchorOrigin: {
|
12471
|
-
vertical:
|
12523
|
+
vertical: props.popoverDirection,
|
12472
12524
|
horizontal: "center"
|
12473
12525
|
},
|
12474
12526
|
className: "universal_button_popover",
|
12527
|
+
style: props.popoverDirection === "bottom" ? {
|
12528
|
+
marginTop: 8
|
12529
|
+
} : {
|
12530
|
+
marginTop: -8
|
12531
|
+
},
|
12475
12532
|
onClose: () => setPopoverAnchor(null),
|
12476
12533
|
open: popoverAnchor !== null && ![null, undefined].includes(wagmiAddress),
|
12477
12534
|
transformOrigin: {
|
12478
|
-
vertical: "top",
|
12535
|
+
vertical: props.popoverDirection === "bottom" ? "top" : "bottom",
|
12479
12536
|
horizontal: "center"
|
12480
12537
|
},
|
12481
12538
|
children: /*#__PURE__*/jsxs("div", {
|
@@ -12540,7 +12597,7 @@ function DmButton(props) {
|
|
12540
12597
|
|
12541
12598
|
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
12599
|
|
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
|
12600
|
+
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}\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";
|
12544
12601
|
n(css,{});
|
12545
12602
|
|
12546
12603
|
const {
|
@@ -12570,7 +12627,8 @@ function UniversalDm(props) {
|
|
12570
12627
|
children: [/*#__PURE__*/jsx(Ie, {}), /*#__PURE__*/jsx(DmButton, {
|
12571
12628
|
address: props.address,
|
12572
12629
|
displayName: props.displayName,
|
12573
|
-
theme: props.theme || "light"
|
12630
|
+
theme: props.theme || "light",
|
12631
|
+
popoverDirection: props.popoverDirection || "top"
|
12574
12632
|
})]
|
12575
12633
|
});
|
12576
12634
|
}
|
Binary file
|