nftychat-universe 1.2.1 → 1.3.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 +176 -81
- package/dist/index.esm.js +177 -82
- package/nftychat-universe-v1.2.1.tgz +0 -0
- package/package.json +1 -1
- package/nftychat-universe-v1.2.0.tgz +0 -0
package/dist/index.cjs.js
CHANGED
@@ -12407,10 +12407,11 @@ function DmButton(props) {
|
|
12407
12407
|
const [numberOfNotifications, setNumberOfNotifications] = React.useState(0);
|
12408
12408
|
const mainUrl = "https://nftychat-staging.herokuapp.com"; // const mainUrl = "http://localhost:8080";
|
12409
12409
|
|
12410
|
-
const [accessToken, setAccessToken] = React.useState(null);
|
12411
12410
|
const [messageText, setMessageText] = React.useState("");
|
12412
12411
|
const [popoverAnchor, setPopoverAnchor] = React.useState(null);
|
12413
|
-
const [displayName, setDisplayName] = React.useState(props.displayName);
|
12412
|
+
const [displayName, setDisplayName] = React.useState(props.displayName);
|
12413
|
+
const [conversations, setConversations] = React.useState([]);
|
12414
|
+
const [authenticated, setAuthenticated] = React.useState(false); // const displayName = "Poapdispenser.eth";
|
12414
12415
|
// const address = "0x11B002247efc78A149F4e6aDc9F143b47bE9123D"
|
12415
12416
|
// Wallet modal
|
12416
12417
|
// Connectors 0: metamask, 1:WalletConnect, 2: coinbase
|
@@ -12432,7 +12433,8 @@ function DmButton(props) {
|
|
12432
12433
|
}
|
12433
12434
|
|
12434
12435
|
resolveDisplayName();
|
12435
|
-
}, [displayName, props.address]);
|
12436
|
+
}, [displayName, props.address]); // badge of unread messages
|
12437
|
+
|
12436
12438
|
React.useEffect(() => {
|
12437
12439
|
fetch(mainUrl + "/v1/unread_message_count?address=" + props.address, {
|
12438
12440
|
method: "get"
|
@@ -12440,19 +12442,37 @@ function DmButton(props) {
|
|
12440
12442
|
return payload.json();
|
12441
12443
|
}).then(data => {
|
12442
12444
|
setNumberOfNotifications(data);
|
12445
|
+
console.log(data);
|
12443
12446
|
});
|
12444
|
-
}, [props.address]); //
|
12447
|
+
}, [props.address]); // Checks validity of signature
|
12445
12448
|
|
12446
|
-
|
12447
|
-
|
12448
|
-
|
12449
|
+
async function checkSignature(tempAddress = wagmiAddress, signature = "0x") {
|
12450
|
+
const signatureUrl = `${mainUrl}/v1/authenticate?address=${tempAddress}&signature=${signature}&source=${window.location.hostname}`;
|
12451
|
+
const loginResponse = await fetch(signatureUrl);
|
12452
|
+
|
12453
|
+
if (!loginResponse.ok) {
|
12454
|
+
loginResponse.json().then(data => {
|
12455
|
+
_t.error(data["detail"]);
|
12456
|
+
});
|
12457
|
+
throw new Error(loginResponse.status);
|
12458
|
+
} //Set local storage with login vars
|
12459
|
+
|
12460
|
+
|
12461
|
+
const loginData = await loginResponse.json(); // If multisig wallet
|
12462
|
+
|
12463
|
+
if (loginData["status"] === "pending") {
|
12464
|
+
_t.error("Multisig not enabled");
|
12465
|
+
return;
|
12449
12466
|
}
|
12450
|
-
}, [props.address, wagmiAddress]);
|
12451
12467
|
|
12452
|
-
|
12453
|
-
|
12468
|
+
return loginData["token"];
|
12469
|
+
} // calls check signature and saves access token
|
12470
|
+
|
12471
|
+
|
12472
|
+
async function getAccessToken() {
|
12473
|
+
let tempAccessToken = localStorage.getItem("token_" + wagmiAddress);
|
12454
12474
|
|
12455
|
-
if (
|
12475
|
+
if (!tempAccessToken) {
|
12456
12476
|
const message_response = await fetch(mainUrl + "/v1/siwe_message?address=" + wagmiAddress);
|
12457
12477
|
const data = await message_response.json();
|
12458
12478
|
const siwe_message = data.siwe_message;
|
@@ -12462,6 +12482,51 @@ function DmButton(props) {
|
|
12462
12482
|
tempAccessToken = await checkSignature(wagmiAddress, signature);
|
12463
12483
|
}
|
12464
12484
|
|
12485
|
+
localStorage.setItem("token_" + wagmiAddress, tempAccessToken);
|
12486
|
+
setAuthenticated(true);
|
12487
|
+
return tempAccessToken;
|
12488
|
+
}
|
12489
|
+
|
12490
|
+
async function getConversations() {
|
12491
|
+
const tempAccessToken = await getAccessToken();
|
12492
|
+
fetch(mainUrl + "/v1/conversations", {
|
12493
|
+
headers: {
|
12494
|
+
Accept: "application/json",
|
12495
|
+
"Content-Type": "application/json",
|
12496
|
+
Authorization: "Bearer " + tempAccessToken
|
12497
|
+
}
|
12498
|
+
}).then(response => {
|
12499
|
+
if (!response.ok) {
|
12500
|
+
response.json().then(data => {
|
12501
|
+
_t.error(data["detail"]);
|
12502
|
+
}); // TODO: Unsure what error is trying to throw
|
12503
|
+
|
12504
|
+
throw new Error("error");
|
12505
|
+
}
|
12506
|
+
|
12507
|
+
return response.json();
|
12508
|
+
}).then(payload => {
|
12509
|
+
setConversations(payload.slice(0, 3));
|
12510
|
+
});
|
12511
|
+
} // useEffect to get signature after click
|
12512
|
+
|
12513
|
+
|
12514
|
+
React.useEffect(() => {
|
12515
|
+
console.log(popoverAnchor, wagmiAddress);
|
12516
|
+
|
12517
|
+
if (!!wagmiAddress && !!popoverAnchor) {
|
12518
|
+
getAccessToken();
|
12519
|
+
}
|
12520
|
+
}, [popoverAnchor, wagmiAddress]); // useEffect to fetch conversations if user is same as props.address
|
12521
|
+
|
12522
|
+
React.useEffect(() => {
|
12523
|
+
if (props.address === wagmiAddress && authenticated) {
|
12524
|
+
getConversations();
|
12525
|
+
}
|
12526
|
+
}, [props.address, wagmiAddress, authenticated]);
|
12527
|
+
|
12528
|
+
async function sendClick() {
|
12529
|
+
const tempAccessToken = await getAccessToken();
|
12465
12530
|
const payload = {
|
12466
12531
|
address: props.address,
|
12467
12532
|
message_text: messageText
|
@@ -12492,44 +12557,14 @@ function DmButton(props) {
|
|
12492
12557
|
});
|
12493
12558
|
}
|
12494
12559
|
|
12495
|
-
async function checkSignature(tempAddress = wagmiAddress, signature = "0x") {
|
12496
|
-
const signatureUrl = `${mainUrl}/v1/authenticate?address=${tempAddress}&signature=${signature}&source=${window.location.hostname}`;
|
12497
|
-
const loginResponse = await fetch(signatureUrl);
|
12498
|
-
|
12499
|
-
if (!loginResponse.ok) {
|
12500
|
-
loginResponse.json().then(data => {
|
12501
|
-
_t.error(data["detail"]);
|
12502
|
-
});
|
12503
|
-
throw new Error(loginResponse.status);
|
12504
|
-
} //Set local storage with login vars
|
12505
|
-
|
12506
|
-
|
12507
|
-
const loginData = await loginResponse.json(); // If multisig wallet
|
12508
|
-
|
12509
|
-
if (loginData["status"] === "pending") {
|
12510
|
-
_t.error("Multisig not enabled");
|
12511
|
-
return;
|
12512
|
-
}
|
12513
|
-
|
12514
|
-
setAccessToken(loginData["token"]);
|
12515
|
-
return loginData["token"];
|
12516
|
-
}
|
12517
|
-
|
12518
12560
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
12519
12561
|
className: props.theme === "dark" ? "universal_button universal_button___dark" : "universal_button",
|
12520
12562
|
children: [/*#__PURE__*/jsxRuntime.jsxs("button", {
|
12521
12563
|
className: "universal_button__button",
|
12522
12564
|
type: "button",
|
12523
12565
|
onClick: event => {
|
12524
|
-
|
12525
|
-
|
12526
|
-
} else {
|
12527
|
-
if (!wagmiAddress) {
|
12528
|
-
setWalletPopoverOpen(true);
|
12529
|
-
}
|
12530
|
-
|
12531
|
-
setPopoverAnchor(event.currentTarget);
|
12532
|
-
}
|
12566
|
+
setWalletPopoverOpen(true);
|
12567
|
+
setPopoverAnchor(event.currentTarget);
|
12533
12568
|
},
|
12534
12569
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
12535
12570
|
className: "universal_button__icon_container",
|
@@ -12542,7 +12577,7 @@ function DmButton(props) {
|
|
12542
12577
|
})]
|
12543
12578
|
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
12544
12579
|
className: "universal_button__text",
|
12545
|
-
children: wagmiAddress === props.address ? "
|
12580
|
+
children: popoverAnchor !== null && authenticated === false ? "Waiting for Signature" : wagmiAddress === props.address ? "Recent Messages" : `DM ${displayName ? displayName : shortenAddress(props.address)}`
|
12546
12581
|
})]
|
12547
12582
|
}), /*#__PURE__*/jsxRuntime.jsx(Popover$1, {
|
12548
12583
|
anchorEl: popoverAnchor,
|
@@ -12557,50 +12592,110 @@ function DmButton(props) {
|
|
12557
12592
|
marginTop: -8
|
12558
12593
|
},
|
12559
12594
|
onClose: () => setPopoverAnchor(null),
|
12560
|
-
open: popoverAnchor !== null &&
|
12595
|
+
open: popoverAnchor !== null && authenticated,
|
12561
12596
|
transformOrigin: {
|
12562
12597
|
vertical: props.popoverDirection === "bottom" ? "top" : "bottom",
|
12563
12598
|
horizontal: "center"
|
12564
12599
|
},
|
12565
|
-
children: /*#__PURE__*/jsxRuntime.
|
12600
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
12566
12601
|
className: props.theme === "dark" ? "universal_button_popover__container universal_button_popover__container___dark" : "universal_button_popover__container",
|
12567
|
-
children:
|
12568
|
-
|
12569
|
-
|
12570
|
-
|
12571
|
-
|
12572
|
-
|
12573
|
-
|
12574
|
-
|
12575
|
-
|
12576
|
-
|
12577
|
-
|
12578
|
-
|
12579
|
-
|
12580
|
-
|
12581
|
-
|
12582
|
-
|
12583
|
-
|
12584
|
-
|
12585
|
-
|
12586
|
-
|
12587
|
-
|
12588
|
-
|
12589
|
-
|
12590
|
-
|
12591
|
-
|
12592
|
-
|
12602
|
+
children: wagmiAddress === props.address ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
12603
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
12604
|
+
className: "universal_button_popover__content",
|
12605
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
12606
|
+
className: "message_title",
|
12607
|
+
children: " Recent Messages "
|
12608
|
+
}), /*#__PURE__*/jsxRuntime.jsx("a", {
|
12609
|
+
href: "https://nftychat.xyz",
|
12610
|
+
rel: "noopener noreferrer",
|
12611
|
+
target: "_blank",
|
12612
|
+
styel: {
|
12613
|
+
textDecoration: 'none'
|
12614
|
+
},
|
12615
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
12616
|
+
className: "universal_button_popover__subtitle",
|
12617
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
12618
|
+
className: "universal_button_popover__link_text",
|
12619
|
+
children: "View All"
|
12620
|
+
}), /*#__PURE__*/jsxRuntime.jsx("img", {
|
12621
|
+
src: logo,
|
12622
|
+
alt: "Logo",
|
12623
|
+
style: {
|
12624
|
+
width: 24,
|
12625
|
+
height: 24
|
12626
|
+
}
|
12627
|
+
})]
|
12628
|
+
})
|
12629
|
+
})]
|
12630
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
12631
|
+
className: "message_separator"
|
12632
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
12633
|
+
className: "universal_button_popover__messages",
|
12634
|
+
children: conversations.map(conversation => /*#__PURE__*/jsxRuntime.jsxs("div", {
|
12635
|
+
className: "message__container",
|
12636
|
+
onClick: () => {
|
12637
|
+
window.open("https://nftychat.xyz/dms/" + conversation.conversation_id, "_blank");
|
12638
|
+
},
|
12639
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
12640
|
+
className: "hover_text",
|
12641
|
+
children: " View on nftychat"
|
12642
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
12643
|
+
className: "message_text__container",
|
12644
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
12645
|
+
className: "message_title",
|
12646
|
+
children: [" ", conversation.conversation_name]
|
12647
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
12648
|
+
className: "message_text",
|
12649
|
+
children: conversation.latest_message_text
|
12650
|
+
})]
|
12651
|
+
}), conversation.unread_message_count > 0 && /*#__PURE__*/jsxRuntime.jsx("div", {
|
12652
|
+
className: "message__badge",
|
12653
|
+
children: conversation.unread_message_count
|
12593
12654
|
})]
|
12655
|
+
}, conversation.conversation_id))
|
12656
|
+
})]
|
12657
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
12658
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
12659
|
+
className: "universal_button_popover__content_top",
|
12660
|
+
children: /*#__PURE__*/jsxRuntime.jsx("textarea", {
|
12661
|
+
className: "universal_button_popover__textarea",
|
12662
|
+
spellCheck: false,
|
12663
|
+
value: messageText,
|
12664
|
+
onChange: e => setMessageText(e.target.value)
|
12594
12665
|
})
|
12595
|
-
}), /*#__PURE__*/jsxRuntime.
|
12596
|
-
className: "
|
12597
|
-
|
12598
|
-
|
12599
|
-
|
12600
|
-
|
12601
|
-
|
12666
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
12667
|
+
className: "universal_button_popover__content_bottom",
|
12668
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("a", {
|
12669
|
+
href: "https://nftychat.xyz",
|
12670
|
+
rel: "noopener noreferrer",
|
12671
|
+
target: "_blank",
|
12672
|
+
styel: {
|
12673
|
+
textDecoration: 'none'
|
12674
|
+
},
|
12675
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
12676
|
+
className: "universal_button_popover__content_left",
|
12677
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("img", {
|
12678
|
+
src: logo,
|
12679
|
+
alt: "Logo",
|
12680
|
+
style: {
|
12681
|
+
width: 24,
|
12682
|
+
height: 24
|
12683
|
+
}
|
12684
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
12685
|
+
className: "universal_button_popover__user_text",
|
12686
|
+
children: "Sent via nftychat"
|
12687
|
+
})]
|
12688
|
+
})
|
12689
|
+
}), /*#__PURE__*/jsxRuntime.jsx("button", {
|
12690
|
+
className: "universal_button_popover__send",
|
12691
|
+
onClick: sendClick,
|
12692
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
12693
|
+
className: "universal_button_popover__send_icon",
|
12694
|
+
icon: "ant-design:send-outlined"
|
12695
|
+
})
|
12696
|
+
})]
|
12602
12697
|
})]
|
12603
|
-
})
|
12698
|
+
})
|
12604
12699
|
})
|
12605
12700
|
}), /*#__PURE__*/jsxRuntime.jsx(Modal$1, {
|
12606
12701
|
"aria-labelledby": "wallet_popover",
|
@@ -12624,7 +12719,7 @@ function DmButton(props) {
|
|
12624
12719
|
|
12625
12720
|
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}}
|
12626
12721
|
|
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
|
12722
|
+
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";
|
12628
12723
|
n(css,{});
|
12629
12724
|
|
12630
12725
|
const {
|
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
|
|
@@ -12380,10 +12380,11 @@ function DmButton(props) {
|
|
12380
12380
|
const [numberOfNotifications, setNumberOfNotifications] = useState(0);
|
12381
12381
|
const mainUrl = "https://nftychat-staging.herokuapp.com"; // const mainUrl = "http://localhost:8080";
|
12382
12382
|
|
12383
|
-
const [accessToken, setAccessToken] = useState(null);
|
12384
12383
|
const [messageText, setMessageText] = useState("");
|
12385
12384
|
const [popoverAnchor, setPopoverAnchor] = useState(null);
|
12386
|
-
const [displayName, setDisplayName] = useState(props.displayName);
|
12385
|
+
const [displayName, setDisplayName] = useState(props.displayName);
|
12386
|
+
const [conversations, setConversations] = useState([]);
|
12387
|
+
const [authenticated, setAuthenticated] = useState(false); // const displayName = "Poapdispenser.eth";
|
12387
12388
|
// const address = "0x11B002247efc78A149F4e6aDc9F143b47bE9123D"
|
12388
12389
|
// Wallet modal
|
12389
12390
|
// Connectors 0: metamask, 1:WalletConnect, 2: coinbase
|
@@ -12405,7 +12406,8 @@ function DmButton(props) {
|
|
12405
12406
|
}
|
12406
12407
|
|
12407
12408
|
resolveDisplayName();
|
12408
|
-
}, [displayName, props.address]);
|
12409
|
+
}, [displayName, props.address]); // badge of unread messages
|
12410
|
+
|
12409
12411
|
useEffect(() => {
|
12410
12412
|
fetch(mainUrl + "/v1/unread_message_count?address=" + props.address, {
|
12411
12413
|
method: "get"
|
@@ -12413,19 +12415,37 @@ function DmButton(props) {
|
|
12413
12415
|
return payload.json();
|
12414
12416
|
}).then(data => {
|
12415
12417
|
setNumberOfNotifications(data);
|
12418
|
+
console.log(data);
|
12416
12419
|
});
|
12417
|
-
}, [props.address]); //
|
12420
|
+
}, [props.address]); // Checks validity of signature
|
12418
12421
|
|
12419
|
-
|
12420
|
-
|
12421
|
-
|
12422
|
+
async function checkSignature(tempAddress = wagmiAddress, signature = "0x") {
|
12423
|
+
const signatureUrl = `${mainUrl}/v1/authenticate?address=${tempAddress}&signature=${signature}&source=${window.location.hostname}`;
|
12424
|
+
const loginResponse = await fetch(signatureUrl);
|
12425
|
+
|
12426
|
+
if (!loginResponse.ok) {
|
12427
|
+
loginResponse.json().then(data => {
|
12428
|
+
_t.error(data["detail"]);
|
12429
|
+
});
|
12430
|
+
throw new Error(loginResponse.status);
|
12431
|
+
} //Set local storage with login vars
|
12432
|
+
|
12433
|
+
|
12434
|
+
const loginData = await loginResponse.json(); // If multisig wallet
|
12435
|
+
|
12436
|
+
if (loginData["status"] === "pending") {
|
12437
|
+
_t.error("Multisig not enabled");
|
12438
|
+
return;
|
12422
12439
|
}
|
12423
|
-
}, [props.address, wagmiAddress]);
|
12424
12440
|
|
12425
|
-
|
12426
|
-
|
12441
|
+
return loginData["token"];
|
12442
|
+
} // calls check signature and saves access token
|
12443
|
+
|
12444
|
+
|
12445
|
+
async function getAccessToken() {
|
12446
|
+
let tempAccessToken = localStorage.getItem("token_" + wagmiAddress);
|
12427
12447
|
|
12428
|
-
if (
|
12448
|
+
if (!tempAccessToken) {
|
12429
12449
|
const message_response = await fetch(mainUrl + "/v1/siwe_message?address=" + wagmiAddress);
|
12430
12450
|
const data = await message_response.json();
|
12431
12451
|
const siwe_message = data.siwe_message;
|
@@ -12435,6 +12455,51 @@ function DmButton(props) {
|
|
12435
12455
|
tempAccessToken = await checkSignature(wagmiAddress, signature);
|
12436
12456
|
}
|
12437
12457
|
|
12458
|
+
localStorage.setItem("token_" + wagmiAddress, tempAccessToken);
|
12459
|
+
setAuthenticated(true);
|
12460
|
+
return tempAccessToken;
|
12461
|
+
}
|
12462
|
+
|
12463
|
+
async function getConversations() {
|
12464
|
+
const tempAccessToken = await getAccessToken();
|
12465
|
+
fetch(mainUrl + "/v1/conversations", {
|
12466
|
+
headers: {
|
12467
|
+
Accept: "application/json",
|
12468
|
+
"Content-Type": "application/json",
|
12469
|
+
Authorization: "Bearer " + tempAccessToken
|
12470
|
+
}
|
12471
|
+
}).then(response => {
|
12472
|
+
if (!response.ok) {
|
12473
|
+
response.json().then(data => {
|
12474
|
+
_t.error(data["detail"]);
|
12475
|
+
}); // TODO: Unsure what error is trying to throw
|
12476
|
+
|
12477
|
+
throw new Error("error");
|
12478
|
+
}
|
12479
|
+
|
12480
|
+
return response.json();
|
12481
|
+
}).then(payload => {
|
12482
|
+
setConversations(payload.slice(0, 3));
|
12483
|
+
});
|
12484
|
+
} // useEffect to get signature after click
|
12485
|
+
|
12486
|
+
|
12487
|
+
useEffect(() => {
|
12488
|
+
console.log(popoverAnchor, wagmiAddress);
|
12489
|
+
|
12490
|
+
if (!!wagmiAddress && !!popoverAnchor) {
|
12491
|
+
getAccessToken();
|
12492
|
+
}
|
12493
|
+
}, [popoverAnchor, wagmiAddress]); // useEffect to fetch conversations if user is same as props.address
|
12494
|
+
|
12495
|
+
useEffect(() => {
|
12496
|
+
if (props.address === wagmiAddress && authenticated) {
|
12497
|
+
getConversations();
|
12498
|
+
}
|
12499
|
+
}, [props.address, wagmiAddress, authenticated]);
|
12500
|
+
|
12501
|
+
async function sendClick() {
|
12502
|
+
const tempAccessToken = await getAccessToken();
|
12438
12503
|
const payload = {
|
12439
12504
|
address: props.address,
|
12440
12505
|
message_text: messageText
|
@@ -12465,44 +12530,14 @@ function DmButton(props) {
|
|
12465
12530
|
});
|
12466
12531
|
}
|
12467
12532
|
|
12468
|
-
async function checkSignature(tempAddress = wagmiAddress, signature = "0x") {
|
12469
|
-
const signatureUrl = `${mainUrl}/v1/authenticate?address=${tempAddress}&signature=${signature}&source=${window.location.hostname}`;
|
12470
|
-
const loginResponse = await fetch(signatureUrl);
|
12471
|
-
|
12472
|
-
if (!loginResponse.ok) {
|
12473
|
-
loginResponse.json().then(data => {
|
12474
|
-
_t.error(data["detail"]);
|
12475
|
-
});
|
12476
|
-
throw new Error(loginResponse.status);
|
12477
|
-
} //Set local storage with login vars
|
12478
|
-
|
12479
|
-
|
12480
|
-
const loginData = await loginResponse.json(); // If multisig wallet
|
12481
|
-
|
12482
|
-
if (loginData["status"] === "pending") {
|
12483
|
-
_t.error("Multisig not enabled");
|
12484
|
-
return;
|
12485
|
-
}
|
12486
|
-
|
12487
|
-
setAccessToken(loginData["token"]);
|
12488
|
-
return loginData["token"];
|
12489
|
-
}
|
12490
|
-
|
12491
12533
|
return /*#__PURE__*/jsxs("div", {
|
12492
12534
|
className: props.theme === "dark" ? "universal_button universal_button___dark" : "universal_button",
|
12493
12535
|
children: [/*#__PURE__*/jsxs("button", {
|
12494
12536
|
className: "universal_button__button",
|
12495
12537
|
type: "button",
|
12496
12538
|
onClick: event => {
|
12497
|
-
|
12498
|
-
|
12499
|
-
} else {
|
12500
|
-
if (!wagmiAddress) {
|
12501
|
-
setWalletPopoverOpen(true);
|
12502
|
-
}
|
12503
|
-
|
12504
|
-
setPopoverAnchor(event.currentTarget);
|
12505
|
-
}
|
12539
|
+
setWalletPopoverOpen(true);
|
12540
|
+
setPopoverAnchor(event.currentTarget);
|
12506
12541
|
},
|
12507
12542
|
children: [/*#__PURE__*/jsxs("div", {
|
12508
12543
|
className: "universal_button__icon_container",
|
@@ -12515,7 +12550,7 @@ function DmButton(props) {
|
|
12515
12550
|
})]
|
12516
12551
|
}), /*#__PURE__*/jsx("span", {
|
12517
12552
|
className: "universal_button__text",
|
12518
|
-
children: wagmiAddress === props.address ? "
|
12553
|
+
children: popoverAnchor !== null && authenticated === false ? "Waiting for Signature" : wagmiAddress === props.address ? "Recent Messages" : `DM ${displayName ? displayName : shortenAddress(props.address)}`
|
12519
12554
|
})]
|
12520
12555
|
}), /*#__PURE__*/jsx(Popover$1, {
|
12521
12556
|
anchorEl: popoverAnchor,
|
@@ -12530,50 +12565,110 @@ function DmButton(props) {
|
|
12530
12565
|
marginTop: -8
|
12531
12566
|
},
|
12532
12567
|
onClose: () => setPopoverAnchor(null),
|
12533
|
-
open: popoverAnchor !== null &&
|
12568
|
+
open: popoverAnchor !== null && authenticated,
|
12534
12569
|
transformOrigin: {
|
12535
12570
|
vertical: props.popoverDirection === "bottom" ? "top" : "bottom",
|
12536
12571
|
horizontal: "center"
|
12537
12572
|
},
|
12538
|
-
children: /*#__PURE__*/
|
12573
|
+
children: /*#__PURE__*/jsx("div", {
|
12539
12574
|
className: props.theme === "dark" ? "universal_button_popover__container universal_button_popover__container___dark" : "universal_button_popover__container",
|
12540
|
-
children:
|
12541
|
-
|
12542
|
-
|
12543
|
-
|
12544
|
-
|
12545
|
-
|
12546
|
-
|
12547
|
-
|
12548
|
-
|
12549
|
-
|
12550
|
-
|
12551
|
-
|
12552
|
-
|
12553
|
-
|
12554
|
-
|
12555
|
-
|
12556
|
-
|
12557
|
-
|
12558
|
-
|
12559
|
-
|
12560
|
-
|
12561
|
-
|
12562
|
-
|
12563
|
-
|
12564
|
-
|
12565
|
-
|
12575
|
+
children: wagmiAddress === props.address ? /*#__PURE__*/jsxs(Fragment$1, {
|
12576
|
+
children: [/*#__PURE__*/jsxs("div", {
|
12577
|
+
className: "universal_button_popover__content",
|
12578
|
+
children: [/*#__PURE__*/jsx("span", {
|
12579
|
+
className: "message_title",
|
12580
|
+
children: " Recent Messages "
|
12581
|
+
}), /*#__PURE__*/jsx("a", {
|
12582
|
+
href: "https://nftychat.xyz",
|
12583
|
+
rel: "noopener noreferrer",
|
12584
|
+
target: "_blank",
|
12585
|
+
styel: {
|
12586
|
+
textDecoration: 'none'
|
12587
|
+
},
|
12588
|
+
children: /*#__PURE__*/jsxs("div", {
|
12589
|
+
className: "universal_button_popover__subtitle",
|
12590
|
+
children: [/*#__PURE__*/jsx("span", {
|
12591
|
+
className: "universal_button_popover__link_text",
|
12592
|
+
children: "View All"
|
12593
|
+
}), /*#__PURE__*/jsx("img", {
|
12594
|
+
src: logo,
|
12595
|
+
alt: "Logo",
|
12596
|
+
style: {
|
12597
|
+
width: 24,
|
12598
|
+
height: 24
|
12599
|
+
}
|
12600
|
+
})]
|
12601
|
+
})
|
12602
|
+
})]
|
12603
|
+
}), /*#__PURE__*/jsx("div", {
|
12604
|
+
className: "message_separator"
|
12605
|
+
}), /*#__PURE__*/jsx("div", {
|
12606
|
+
className: "universal_button_popover__messages",
|
12607
|
+
children: conversations.map(conversation => /*#__PURE__*/jsxs("div", {
|
12608
|
+
className: "message__container",
|
12609
|
+
onClick: () => {
|
12610
|
+
window.open("https://nftychat.xyz/dms/" + conversation.conversation_id, "_blank");
|
12611
|
+
},
|
12612
|
+
children: [/*#__PURE__*/jsx("div", {
|
12613
|
+
className: "hover_text",
|
12614
|
+
children: " View on nftychat"
|
12615
|
+
}), /*#__PURE__*/jsxs("div", {
|
12616
|
+
className: "message_text__container",
|
12617
|
+
children: [/*#__PURE__*/jsxs("span", {
|
12618
|
+
className: "message_title",
|
12619
|
+
children: [" ", conversation.conversation_name]
|
12620
|
+
}), /*#__PURE__*/jsx("span", {
|
12621
|
+
className: "message_text",
|
12622
|
+
children: conversation.latest_message_text
|
12623
|
+
})]
|
12624
|
+
}), conversation.unread_message_count > 0 && /*#__PURE__*/jsx("div", {
|
12625
|
+
className: "message__badge",
|
12626
|
+
children: conversation.unread_message_count
|
12566
12627
|
})]
|
12628
|
+
}, conversation.conversation_id))
|
12629
|
+
})]
|
12630
|
+
}) : /*#__PURE__*/jsxs(Fragment$1, {
|
12631
|
+
children: [/*#__PURE__*/jsx("div", {
|
12632
|
+
className: "universal_button_popover__content_top",
|
12633
|
+
children: /*#__PURE__*/jsx("textarea", {
|
12634
|
+
className: "universal_button_popover__textarea",
|
12635
|
+
spellCheck: false,
|
12636
|
+
value: messageText,
|
12637
|
+
onChange: e => setMessageText(e.target.value)
|
12567
12638
|
})
|
12568
|
-
}), /*#__PURE__*/
|
12569
|
-
className: "
|
12570
|
-
|
12571
|
-
|
12572
|
-
|
12573
|
-
|
12574
|
-
|
12639
|
+
}), /*#__PURE__*/jsxs("div", {
|
12640
|
+
className: "universal_button_popover__content_bottom",
|
12641
|
+
children: [/*#__PURE__*/jsx("a", {
|
12642
|
+
href: "https://nftychat.xyz",
|
12643
|
+
rel: "noopener noreferrer",
|
12644
|
+
target: "_blank",
|
12645
|
+
styel: {
|
12646
|
+
textDecoration: 'none'
|
12647
|
+
},
|
12648
|
+
children: /*#__PURE__*/jsxs("div", {
|
12649
|
+
className: "universal_button_popover__content_left",
|
12650
|
+
children: [/*#__PURE__*/jsx("img", {
|
12651
|
+
src: logo,
|
12652
|
+
alt: "Logo",
|
12653
|
+
style: {
|
12654
|
+
width: 24,
|
12655
|
+
height: 24
|
12656
|
+
}
|
12657
|
+
}), /*#__PURE__*/jsx("span", {
|
12658
|
+
className: "universal_button_popover__user_text",
|
12659
|
+
children: "Sent via nftychat"
|
12660
|
+
})]
|
12661
|
+
})
|
12662
|
+
}), /*#__PURE__*/jsx("button", {
|
12663
|
+
className: "universal_button_popover__send",
|
12664
|
+
onClick: sendClick,
|
12665
|
+
children: /*#__PURE__*/jsx(Icon, {
|
12666
|
+
className: "universal_button_popover__send_icon",
|
12667
|
+
icon: "ant-design:send-outlined"
|
12668
|
+
})
|
12669
|
+
})]
|
12575
12670
|
})]
|
12576
|
-
})
|
12671
|
+
})
|
12577
12672
|
})
|
12578
12673
|
}), /*#__PURE__*/jsx(Modal$1, {
|
12579
12674
|
"aria-labelledby": "wallet_popover",
|
@@ -12597,7 +12692,7 @@ function DmButton(props) {
|
|
12597
12692
|
|
12598
12693
|
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}}
|
12599
12694
|
|
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
|
12695
|
+
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";
|
12601
12696
|
n(css,{});
|
12602
12697
|
|
12603
12698
|
const {
|
Binary file
|
package/package.json
CHANGED
Binary file
|