From 2078e3fa27f8c1a0723fbd6e034cca419df6dc8e Mon Sep 17 00:00:00 2001 From: Brett <27568879+BrettCleary@users.noreply.github.com> Date: Thu, 3 Oct 2024 01:39:28 -0700 Subject: [PATCH 01/13] add overlay nav bar --- .../OverlayManager/Overlay/index.module.scss | 6 +- src/frontend/OverlayManager/Overlay/index.tsx | 37 ++++++- .../UI/QuestsViewer/index.module.scss | 1 + yarn.lock | 97 ++++++++++++------- 4 files changed, 100 insertions(+), 41 deletions(-) diff --git a/src/frontend/OverlayManager/Overlay/index.module.scss b/src/frontend/OverlayManager/Overlay/index.module.scss index f6e5ab873..9b2456d10 100644 --- a/src/frontend/OverlayManager/Overlay/index.module.scss +++ b/src/frontend/OverlayManager/Overlay/index.module.scss @@ -34,11 +34,10 @@ z-index: 3; position: relative; display: flex; - justify-content: center; - padding: var(--space-2lg); + justify-content: space-between; gap: var(--space-xl); - margin: auto; height: 100%; + width: 100%; } .buttonContainer { @@ -51,4 +50,5 @@ display: flex; flex-direction: column; gap: var(--space-2lg); + padding: var(--space-2lg-fixed) var(--space-xl-fixed); } diff --git a/src/frontend/OverlayManager/Overlay/index.tsx b/src/frontend/OverlayManager/Overlay/index.tsx index 36bd8deec..9b480abec 100644 --- a/src/frontend/OverlayManager/Overlay/index.tsx +++ b/src/frontend/OverlayManager/Overlay/index.tsx @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react' +import React, { useEffect, useState } from 'react' import BrowserGameStyles from './index.module.scss' import ToastManager from '../ToastManager' import { PROVIDERS } from 'common/types/proxy-types' @@ -9,7 +9,7 @@ import { t } from 'i18next' import ExtensionManager from 'frontend/ExtensionManager' import TransactionState from 'frontend/state/TransactionState' import { BrowserGameProps } from '../types' -import { Button } from '@hyperplay/ui' +import { Button, NavBarOverlay, NavItem, Images } from '@hyperplay/ui' import { QuestsViewer } from 'frontend/components/UI/QuestsViewer' import { useFlags } from 'launchdarkly-react-client-sdk' import libraryState from 'frontend/state/libraryState' @@ -18,6 +18,7 @@ export const Overlay = observer(function ({ appName, runner }: BrowserGameProps) { + const [collapsed, setCollapsed] = useState(false) const flags = useFlags() const txnToastContainerStyle = {} as React.CSSProperties if (OverlayState.title === 'HyperPlay Toasts') { @@ -118,10 +119,42 @@ export const Overlay = observer(function ({ questsViewer = } + const selectedRoute = '/quests' overlayItems = (
+ } + alertNumber={10} + key={'/quests'} + collapsed={collapsed} + currentRoute={selectedRoute} + />, + } + key={'/marketplace'} + collapsed={collapsed} + currentRoute={selectedRoute} + />, + } + key={'/achievements'} + collapsed={collapsed} + currentRoute={selectedRoute} + /> + ]} + setCollapsed={setCollapsed} + collapsed={collapsed} + /> {questsViewer}
{exitGameButton} diff --git a/src/frontend/components/UI/QuestsViewer/index.module.scss b/src/frontend/components/UI/QuestsViewer/index.module.scss index 359e4982c..84379beea 100644 --- a/src/frontend/components/UI/QuestsViewer/index.module.scss +++ b/src/frontend/components/UI/QuestsViewer/index.module.scss @@ -2,6 +2,7 @@ display: flex; flex-direction: column; gap: var(--space-lg-fixed); + padding: var(--space-2lg-fixed); } .questsViewerContainer { diff --git a/yarn.lock b/yarn.lock index a95e1359b..989d57c84 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1151,7 +1151,7 @@ resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.6.0.tgz#31ab07ca6a06358c5de4d295d4711b675006163f" integrity sha512-xyX0X9mc0kyz9plIyryrRbl7ngsA9jz77mCZJsUkLl+ZKs0KWObgaEBoSgQiYWAsSmjz/yjl0F++Got0Mdp4Rw== -"@fortawesome/fontawesome-svg-core@^6.1.1": +"@fortawesome/fontawesome-svg-core@^6.1.1", "@fortawesome/fontawesome-svg-core@^6.4.0": version "6.6.0" resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.6.0.tgz#2a24c32ef92136e98eae2ff334a27145188295ff" integrity sha512-KHwPkCk6oRT4HADE7smhfsKudt9N/9lm6EJ5BVg0tD1yPA5hht837fB87F8pn15D8JfTqQOjhKTktwmLMiD7Kg== @@ -1165,21 +1165,21 @@ dependencies: "@fortawesome/fontawesome-common-types" "6.6.0" -"@fortawesome/free-regular-svg-icons@^6.6.0": +"@fortawesome/free-regular-svg-icons@^6.4.0", "@fortawesome/free-regular-svg-icons@^6.6.0": version "6.6.0" resolved "https://registry.yarnpkg.com/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.6.0.tgz#fc49a947ac8dfd20403c9ea5f37f0919425bdf04" integrity sha512-Yv9hDzL4aI73BEwSEh20clrY8q/uLxawaQ98lekBx6t9dQKDHcDzzV1p2YtBGTtolYtNqcWdniOnhzB+JPnQEQ== dependencies: "@fortawesome/fontawesome-common-types" "6.6.0" -"@fortawesome/free-solid-svg-icons@^6.6.0": +"@fortawesome/free-solid-svg-icons@^6.4.0", "@fortawesome/free-solid-svg-icons@^6.6.0": version "6.6.0" resolved "https://registry.yarnpkg.com/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.6.0.tgz#061751ca43be4c4d814f0adbda8f006164ec9f3b" integrity sha512-IYv/2skhEDFc2WGUcqvFJkeK39Q+HyPf5GHUrT/l2pKbtgEIv1al1TKd6qStR5OIwQdN1GZP54ci3y4mroJWjA== dependencies: "@fortawesome/fontawesome-common-types" "6.6.0" -"@fortawesome/react-fontawesome@^0.2.2": +"@fortawesome/react-fontawesome@^0.2.0", "@fortawesome/react-fontawesome@^0.2.2": version "0.2.2" resolved "https://registry.yarnpkg.com/@fortawesome/react-fontawesome/-/react-fontawesome-0.2.2.tgz#68b058f9132b46c8599875f6a636dad231af78d4" integrity sha512-EnkrprPNqI6SXJl//m29hpaNzOp1bruISWaOiRtkMi/xSvHJlzc2j2JAYS7egxt/EbjSNV/k6Xy0AQI6vB2+1g== @@ -1233,6 +1233,13 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3" integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== +"@hyperplay/chains@^0.2.9": + version "0.2.10" + resolved "https://registry.yarnpkg.com/@hyperplay/chains/-/chains-0.2.10.tgz#6c9d4e175146d79e4556039db487c182d60c533d" + integrity sha512-TUe9vJo9jXx23pb5QlGuW6xo6JmXYjqXKJSma//aUPZ99HU8I/lATlyqdXwozPfQ2qGsAYn58FCTo2kbF+J+8w== + dependencies: + axios "^1.4.0" + "@hyperplay/chains@^0.3.0": version "0.3.0" resolved "https://registry.yarnpkg.com/@hyperplay/chains/-/chains-0.3.0.tgz#f0cc73e1fde33678328249e40bf0d02bccd14625" @@ -1317,9 +1324,9 @@ classnames "^2.5.1" "@hyperplay/ui@^1.7.18": - version "1.7.19" - resolved "https://registry.yarnpkg.com/@hyperplay/ui/-/ui-1.7.19.tgz#43bc58405a5cc4866d55b548203ce2bdeca6d3fa" - integrity sha512-uXqjABDqxvjXbF7o+GMriXyTgp62X39aPohr4W26G2uk+r+vNNy3t0JDGd0B4SyZnovcoCEocfWS6oirAOVnNg== + version "1.8.1" + resolved "https://registry.yarnpkg.com/@hyperplay/ui/-/ui-1.8.1.tgz#0e3d5b39092d91d3df535fa18e2e45a7075f42eb" + integrity sha512-EH8ZqbZLRqHcILZPEiai8XSt2BlSf42PWQntQwlkLDnCdhYv8yY1UrXNWPQL8zY1FZnws/MBrAV4NmtyN3TcFA== "@hyperplay/utils@^0.0.12": version "0.0.12" @@ -1349,6 +1356,13 @@ dependencies: bignumber.js "^9.1.2" +"@hyperplay/utils@^0.1.0": + version "0.1.4" + resolved "https://registry.yarnpkg.com/@hyperplay/utils/-/utils-0.1.4.tgz#e36cfd82febaae1c54cec1e65649169ede518dae" + integrity sha512-brHHvhSl5fOLIX2hCp2ZP0dfdMHb8uGME3o3NjK0imVdYlspUVe1YXp5x9P5O2iJn+7C3oPlbLARsC/KTDWSJw== + dependencies: + bignumber.js "^9.1.2" + "@ioredis/commands@^1.1.1": version "1.2.0" resolved "https://registry.yarnpkg.com/@ioredis/commands/-/commands-1.2.0.tgz#6d61b3097470af1fdbbe622795b8921d42018e11" @@ -3037,6 +3051,19 @@ dependencies: defer-to-connect "^2.0.0" +"@tabler/icons-react@^2.46.0": + version "2.47.0" + resolved "https://registry.yarnpkg.com/@tabler/icons-react/-/icons-react-2.47.0.tgz#b704e7ae98f95be8bd6e938b4b2e84cd20b0cf31" + integrity sha512-iqly2FvCF/qUbgmvS8E40rVeYY7laltc5GUjRxQj59DuX0x/6CpKHTXt86YlI2whg4czvd/c8Ce8YR08uEku0g== + dependencies: + "@tabler/icons" "2.47.0" + prop-types "^15.7.2" + +"@tabler/icons@2.47.0": + version "2.47.0" + resolved "https://registry.yarnpkg.com/@tabler/icons/-/icons-2.47.0.tgz#c41c680d1947e3ab2d60af3febc4132287c60596" + integrity sha512-4w5evLh+7FUUiA1GucvGj2ReX2TvOjEr4ejXdwL/bsjoSkof6r1gQmzqI+VHrE2CpJpB3al7bCTulOkFa/RcyA== + "@tanstack/query-core@5.52.2": version "5.52.2" resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.52.2.tgz#a023864a892fda9858b724d667eb19cd84ce054a" @@ -3801,6 +3828,17 @@ resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== +"@valist/sdk@^2.9.1": + version "2.10.5" + resolved "https://registry.yarnpkg.com/@valist/sdk/-/sdk-2.10.5.tgz#e43cafc101d42097c6191ae2ac0f426b62603520" + integrity sha512-2m95VJfljJQXaSUfqfVwfHsaVcgynY4yy6wKjIsACYgiKkzck2XqjyAOtLhRESyzvuNvBA/ypj0mP+JxdmCtOw== + dependencies: + "@ethersproject/contracts" "^5.7.0" + axios "^1.4.0" + axios-retry "^4.4.1" + ethers "^6.11.1" + node-fetch "^2.6.1" + "@valist/sdk@^2.9.17": version "2.9.17" resolved "https://registry.yarnpkg.com/@valist/sdk/-/sdk-2.9.17.tgz#05969eba1d6165be76cb89350b78cec1e99456e6" @@ -6944,6 +6982,13 @@ eth-rpc-errors@^4.0.2, eth-rpc-errors@^4.0.3: dependencies: fast-safe-stringify "^2.0.6" +ethereum-blockies-base64@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/ethereum-blockies-base64/-/ethereum-blockies-base64-1.0.2.tgz#4aebca52142bf4d16a3144e6e2b59303e39ed2b3" + integrity sha512-Vg2HTm7slcWNKaRhCUl/L3b4KrB8ohQXdd5Pu3OI897EcR6tVRvUqdTwAyx+dnmoDzj8e2bwBLDQ50ByFmcz6w== + dependencies: + pnglib "0.0.1" + ethereum-cryptography@^2.0.0: version "2.2.1" resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz#58f2810f8e020aecb97de8c8c76147600b0b8ccf" @@ -11115,6 +11160,11 @@ pngjs@^5.0.0: resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-5.0.0.tgz#e79dd2b215767fd9c04561c01236df960bce7fbb" integrity sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw== +pnglib@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/pnglib/-/pnglib-0.0.1.tgz#f9ab6f9c688f4a9d579ad8be28878a716e30c096" + integrity sha512-95ChzOoYLOPIyVmL+Y6X+abKGXUJlvOVLkB1QQkyXl7Uczc6FElUy/x01NS7r2GX6GRezloO/ecCX9h4U9KadA== + pony-cause@^2.1.10: version "2.1.11" resolved "https://registry.yarnpkg.com/pony-cause/-/pony-cause-2.1.11.tgz#d69a20aaccdb3bdb8f74dd59e5c68d8e6772e4bd" @@ -11269,7 +11319,7 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" -prop-types@^15.5.10, prop-types@^15.6.2, prop-types@^15.8.1: +prop-types@^15.5.10, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: version "15.8.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== @@ -12533,16 +12583,7 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -12643,14 +12684,7 @@ stringify-entities@^4.0.0: character-entities-html4 "^2.0.0" character-entities-legacy "^3.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -13917,7 +13951,7 @@ word-wrap@^1.2.5: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -13935,15 +13969,6 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From b81f81baa349a419d1fde350a74c7e5fe94bb517 Mon Sep 17 00:00:00 2001 From: Brett <27568879+BrettCleary@users.noreply.github.com> Date: Fri, 11 Oct 2024 17:06:01 -0700 Subject: [PATCH 02/13] run yarn --- yarn.lock | 53 +++++------------------------------------------------ 1 file changed, 5 insertions(+), 48 deletions(-) diff --git a/yarn.lock b/yarn.lock index c79b267ae..c64e4a371 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1151,7 +1151,7 @@ resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.6.0.tgz#31ab07ca6a06358c5de4d295d4711b675006163f" integrity sha512-xyX0X9mc0kyz9plIyryrRbl7ngsA9jz77mCZJsUkLl+ZKs0KWObgaEBoSgQiYWAsSmjz/yjl0F++Got0Mdp4Rw== -"@fortawesome/fontawesome-svg-core@^6.1.1", "@fortawesome/fontawesome-svg-core@^6.4.0": +"@fortawesome/fontawesome-svg-core@^6.1.1": version "6.6.0" resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.6.0.tgz#2a24c32ef92136e98eae2ff334a27145188295ff" integrity sha512-KHwPkCk6oRT4HADE7smhfsKudt9N/9lm6EJ5BVg0tD1yPA5hht837fB87F8pn15D8JfTqQOjhKTktwmLMiD7Kg== @@ -1165,21 +1165,21 @@ dependencies: "@fortawesome/fontawesome-common-types" "6.6.0" -"@fortawesome/free-regular-svg-icons@^6.4.0", "@fortawesome/free-regular-svg-icons@^6.6.0": +"@fortawesome/free-regular-svg-icons@^6.6.0": version "6.6.0" resolved "https://registry.yarnpkg.com/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.6.0.tgz#fc49a947ac8dfd20403c9ea5f37f0919425bdf04" integrity sha512-Yv9hDzL4aI73BEwSEh20clrY8q/uLxawaQ98lekBx6t9dQKDHcDzzV1p2YtBGTtolYtNqcWdniOnhzB+JPnQEQ== dependencies: "@fortawesome/fontawesome-common-types" "6.6.0" -"@fortawesome/free-solid-svg-icons@^6.4.0", "@fortawesome/free-solid-svg-icons@^6.6.0": +"@fortawesome/free-solid-svg-icons@^6.6.0": version "6.6.0" resolved "https://registry.yarnpkg.com/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.6.0.tgz#061751ca43be4c4d814f0adbda8f006164ec9f3b" integrity sha512-IYv/2skhEDFc2WGUcqvFJkeK39Q+HyPf5GHUrT/l2pKbtgEIv1al1TKd6qStR5OIwQdN1GZP54ci3y4mroJWjA== dependencies: "@fortawesome/fontawesome-common-types" "6.6.0" -"@fortawesome/react-fontawesome@^0.2.0", "@fortawesome/react-fontawesome@^0.2.2": +"@fortawesome/react-fontawesome@^0.2.2": version "0.2.2" resolved "https://registry.yarnpkg.com/@fortawesome/react-fontawesome/-/react-fontawesome-0.2.2.tgz#68b058f9132b46c8599875f6a636dad231af78d4" integrity sha512-EnkrprPNqI6SXJl//m29hpaNzOp1bruISWaOiRtkMi/xSvHJlzc2j2JAYS7egxt/EbjSNV/k6Xy0AQI6vB2+1g== @@ -1233,13 +1233,6 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3" integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== -"@hyperplay/chains@^0.2.9": - version "0.2.10" - resolved "https://registry.yarnpkg.com/@hyperplay/chains/-/chains-0.2.10.tgz#6c9d4e175146d79e4556039db487c182d60c533d" - integrity sha512-TUe9vJo9jXx23pb5QlGuW6xo6JmXYjqXKJSma//aUPZ99HU8I/lATlyqdXwozPfQ2qGsAYn58FCTo2kbF+J+8w== - dependencies: - axios "^1.4.0" - "@hyperplay/chains@^0.3.0": version "0.3.0" resolved "https://registry.yarnpkg.com/@hyperplay/chains/-/chains-0.3.0.tgz#f0cc73e1fde33678328249e40bf0d02bccd14625" @@ -2991,19 +2984,6 @@ dependencies: defer-to-connect "^2.0.0" -"@tabler/icons-react@^2.46.0": - version "2.47.0" - resolved "https://registry.yarnpkg.com/@tabler/icons-react/-/icons-react-2.47.0.tgz#b704e7ae98f95be8bd6e938b4b2e84cd20b0cf31" - integrity sha512-iqly2FvCF/qUbgmvS8E40rVeYY7laltc5GUjRxQj59DuX0x/6CpKHTXt86YlI2whg4czvd/c8Ce8YR08uEku0g== - dependencies: - "@tabler/icons" "2.47.0" - prop-types "^15.7.2" - -"@tabler/icons@2.47.0": - version "2.47.0" - resolved "https://registry.yarnpkg.com/@tabler/icons/-/icons-2.47.0.tgz#c41c680d1947e3ab2d60af3febc4132287c60596" - integrity sha512-4w5evLh+7FUUiA1GucvGj2ReX2TvOjEr4ejXdwL/bsjoSkof6r1gQmzqI+VHrE2CpJpB3al7bCTulOkFa/RcyA== - "@tanstack/query-core@5.52.2": version "5.52.2" resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.52.2.tgz#a023864a892fda9858b724d667eb19cd84ce054a" @@ -3775,17 +3755,6 @@ resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== -"@valist/sdk@^2.9.1": - version "2.10.5" - resolved "https://registry.yarnpkg.com/@valist/sdk/-/sdk-2.10.5.tgz#e43cafc101d42097c6191ae2ac0f426b62603520" - integrity sha512-2m95VJfljJQXaSUfqfVwfHsaVcgynY4yy6wKjIsACYgiKkzck2XqjyAOtLhRESyzvuNvBA/ypj0mP+JxdmCtOw== - dependencies: - "@ethersproject/contracts" "^5.7.0" - axios "^1.4.0" - axios-retry "^4.4.1" - ethers "^6.11.1" - node-fetch "^2.6.1" - "@valist/sdk@^2.9.17": version "2.9.17" resolved "https://registry.yarnpkg.com/@valist/sdk/-/sdk-2.9.17.tgz#05969eba1d6165be76cb89350b78cec1e99456e6" @@ -6952,13 +6921,6 @@ eth-rpc-errors@^4.0.2, eth-rpc-errors@^4.0.3: dependencies: fast-safe-stringify "^2.0.6" -ethereum-blockies-base64@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/ethereum-blockies-base64/-/ethereum-blockies-base64-1.0.2.tgz#4aebca52142bf4d16a3144e6e2b59303e39ed2b3" - integrity sha512-Vg2HTm7slcWNKaRhCUl/L3b4KrB8ohQXdd5Pu3OI897EcR6tVRvUqdTwAyx+dnmoDzj8e2bwBLDQ50ByFmcz6w== - dependencies: - pnglib "0.0.1" - ethereum-cryptography@^2.0.0: version "2.2.1" resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz#58f2810f8e020aecb97de8c8c76147600b0b8ccf" @@ -11160,11 +11122,6 @@ pngjs@^5.0.0: resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-5.0.0.tgz#e79dd2b215767fd9c04561c01236df960bce7fbb" integrity sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw== -pnglib@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/pnglib/-/pnglib-0.0.1.tgz#f9ab6f9c688f4a9d579ad8be28878a716e30c096" - integrity sha512-95ChzOoYLOPIyVmL+Y6X+abKGXUJlvOVLkB1QQkyXl7Uczc6FElUy/x01NS7r2GX6GRezloO/ecCX9h4U9KadA== - pony-cause@^2.1.10: version "2.1.11" resolved "https://registry.yarnpkg.com/pony-cause/-/pony-cause-2.1.11.tgz#d69a20aaccdb3bdb8f74dd59e5c68d8e6772e4bd" @@ -11314,7 +11271,7 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" -prop-types@^15.5.10, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: +prop-types@^15.5.10, prop-types@^15.6.2, prop-types@^15.8.1: version "15.8.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== From bd4bf80b6c81980e89528ce68340e730af354e75 Mon Sep 17 00:00:00 2001 From: Brett <27568879+BrettCleary@users.noreply.github.com> Date: Fri, 11 Oct 2024 17:06:07 -0700 Subject: [PATCH 03/13] disable unused navbar links --- src/frontend/OverlayManager/Overlay/index.module.scss | 4 ++++ src/frontend/OverlayManager/Overlay/index.tsx | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/frontend/OverlayManager/Overlay/index.module.scss b/src/frontend/OverlayManager/Overlay/index.module.scss index c4efe37c6..896de89b3 100644 --- a/src/frontend/OverlayManager/Overlay/index.module.scss +++ b/src/frontend/OverlayManager/Overlay/index.module.scss @@ -56,3 +56,7 @@ .hideOverlay { display: none; } + +.disabled { + cursor: not-allowed !important; +} diff --git a/src/frontend/OverlayManager/Overlay/index.tsx b/src/frontend/OverlayManager/Overlay/index.tsx index 00552e7b8..18d1d5d34 100644 --- a/src/frontend/OverlayManager/Overlay/index.tsx +++ b/src/frontend/OverlayManager/Overlay/index.tsx @@ -123,7 +123,7 @@ export const Overlay = observer(function ({ const selectedRoute = '/quests' const classNameMods: Record = {} classNameMods[BrowserGameStyles.hideOverlay] = !OverlayState.showOverlay - + overlayItems = (
@@ -146,6 +146,7 @@ export const Overlay = observer(function ({ key={'/marketplace'} collapsed={collapsed} currentRoute={selectedRoute} + classNames={{ link: BrowserGameStyles.disabled }} />, ]} setCollapsed={setCollapsed} From 2d9886ab0c9737e73f5114f0af58737388a580ea Mon Sep 17 00:00:00 2001 From: Brett <27568879+BrettCleary@users.noreply.github.com> Date: Wed, 16 Oct 2024 00:13:35 -0700 Subject: [PATCH 04/13] add coming soon text --- public/locales/en/translation.json | 1 + src/frontend/OverlayManager/Overlay/index.tsx | 4 ++ yarn.lock | 66 ++++++++++++++++--- 3 files changed, 63 insertions(+), 8 deletions(-) diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 69a95c763..b9b65b617 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -716,6 +716,7 @@ }, "Other": "Other", "overlay": { + "comingSoon": "Coming Soon", "EXTERNAL_WALLET_CONNECTED": "You are connected to HyperPlay with an external wallet.", "WALLET_DISCONNECTED": "You do not have a wallet connected to HyperPlay." }, diff --git a/src/frontend/OverlayManager/Overlay/index.tsx b/src/frontend/OverlayManager/Overlay/index.tsx index 18d1d5d34..64f8297f5 100644 --- a/src/frontend/OverlayManager/Overlay/index.tsx +++ b/src/frontend/OverlayManager/Overlay/index.tsx @@ -124,6 +124,8 @@ export const Overlay = observer(function ({ const classNameMods: Record = {} classNameMods[BrowserGameStyles.hideOverlay] = !OverlayState.showOverlay + const comingSoonText = t('overlay.comingSoon', 'Coming Soon') + overlayItems = (
@@ -147,6 +149,7 @@ export const Overlay = observer(function ({ collapsed={collapsed} currentRoute={selectedRoute} classNames={{ link: BrowserGameStyles.disabled }} + secondaryTag={comingSoonText} />, ]} setCollapsed={setCollapsed} diff --git a/yarn.lock b/yarn.lock index c64e4a371..a48aa0443 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1151,7 +1151,7 @@ resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.6.0.tgz#31ab07ca6a06358c5de4d295d4711b675006163f" integrity sha512-xyX0X9mc0kyz9plIyryrRbl7ngsA9jz77mCZJsUkLl+ZKs0KWObgaEBoSgQiYWAsSmjz/yjl0F++Got0Mdp4Rw== -"@fortawesome/fontawesome-svg-core@^6.1.1": +"@fortawesome/fontawesome-svg-core@^6.1.1", "@fortawesome/fontawesome-svg-core@^6.4.0": version "6.6.0" resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.6.0.tgz#2a24c32ef92136e98eae2ff334a27145188295ff" integrity sha512-KHwPkCk6oRT4HADE7smhfsKudt9N/9lm6EJ5BVg0tD1yPA5hht837fB87F8pn15D8JfTqQOjhKTktwmLMiD7Kg== @@ -1165,21 +1165,21 @@ dependencies: "@fortawesome/fontawesome-common-types" "6.6.0" -"@fortawesome/free-regular-svg-icons@^6.6.0": +"@fortawesome/free-regular-svg-icons@^6.4.0", "@fortawesome/free-regular-svg-icons@^6.6.0": version "6.6.0" resolved "https://registry.yarnpkg.com/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.6.0.tgz#fc49a947ac8dfd20403c9ea5f37f0919425bdf04" integrity sha512-Yv9hDzL4aI73BEwSEh20clrY8q/uLxawaQ98lekBx6t9dQKDHcDzzV1p2YtBGTtolYtNqcWdniOnhzB+JPnQEQ== dependencies: "@fortawesome/fontawesome-common-types" "6.6.0" -"@fortawesome/free-solid-svg-icons@^6.6.0": +"@fortawesome/free-solid-svg-icons@^6.4.0", "@fortawesome/free-solid-svg-icons@^6.6.0": version "6.6.0" resolved "https://registry.yarnpkg.com/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.6.0.tgz#061751ca43be4c4d814f0adbda8f006164ec9f3b" integrity sha512-IYv/2skhEDFc2WGUcqvFJkeK39Q+HyPf5GHUrT/l2pKbtgEIv1al1TKd6qStR5OIwQdN1GZP54ci3y4mroJWjA== dependencies: "@fortawesome/fontawesome-common-types" "6.6.0" -"@fortawesome/react-fontawesome@^0.2.2": +"@fortawesome/react-fontawesome@^0.2.0", "@fortawesome/react-fontawesome@^0.2.2": version "0.2.2" resolved "https://registry.yarnpkg.com/@fortawesome/react-fontawesome/-/react-fontawesome-0.2.2.tgz#68b058f9132b46c8599875f6a636dad231af78d4" integrity sha512-EnkrprPNqI6SXJl//m29hpaNzOp1bruISWaOiRtkMi/xSvHJlzc2j2JAYS7egxt/EbjSNV/k6Xy0AQI6vB2+1g== @@ -1233,6 +1233,13 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3" integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== +"@hyperplay/chains@^0.2.9": + version "0.2.10" + resolved "https://registry.yarnpkg.com/@hyperplay/chains/-/chains-0.2.10.tgz#6c9d4e175146d79e4556039db487c182d60c533d" + integrity sha512-TUe9vJo9jXx23pb5QlGuW6xo6JmXYjqXKJSma//aUPZ99HU8I/lATlyqdXwozPfQ2qGsAYn58FCTo2kbF+J+8w== + dependencies: + axios "^1.4.0" + "@hyperplay/chains@^0.3.0": version "0.3.0" resolved "https://registry.yarnpkg.com/@hyperplay/chains/-/chains-0.3.0.tgz#f0cc73e1fde33678328249e40bf0d02bccd14625" @@ -1317,9 +1324,9 @@ classnames "^2.5.1" "@hyperplay/ui@^1.7.18": - version "1.8.2" - resolved "https://registry.yarnpkg.com/@hyperplay/ui/-/ui-1.8.2.tgz#cbc0c38f431787a778162763dc342800523abe9d" - integrity sha512-UxV2/g5/bG3FYk3DcU45oqDX/gCh9vXu6cZClBrVq0lje+K+JRCKQSnvSNTMbq8ubG2BOtuTiW1j1b5AAeYJrw== + version "1.8.3" + resolved "https://registry.yarnpkg.com/@hyperplay/ui/-/ui-1.8.3.tgz#5ecfcacdb782ac16ea8411fd19ec5ad3077f642b" + integrity sha512-IObNBY9xsz2J0dLZ07OaFXBFIFKh7V/p9JedvUzQWpcDfBeuUJ+TixWTKBw5+4G/TmwSL6576YZFUVxSBD1BpQ== "@hyperplay/utils@^0.0.12": version "0.0.12" @@ -1342,6 +1349,13 @@ dependencies: bignumber.js "^9.1.2" +"@hyperplay/utils@^0.1.0": + version "0.1.4" + resolved "https://registry.yarnpkg.com/@hyperplay/utils/-/utils-0.1.4.tgz#e36cfd82febaae1c54cec1e65649169ede518dae" + integrity sha512-brHHvhSl5fOLIX2hCp2ZP0dfdMHb8uGME3o3NjK0imVdYlspUVe1YXp5x9P5O2iJn+7C3oPlbLARsC/KTDWSJw== + dependencies: + bignumber.js "^9.1.2" + "@hyperplay/utils@^0.2.4": version "0.2.4" resolved "https://registry.yarnpkg.com/@hyperplay/utils/-/utils-0.2.4.tgz#17621d43f0d92a3d22de87dc08d96b0f2db2291c" @@ -2984,6 +2998,19 @@ dependencies: defer-to-connect "^2.0.0" +"@tabler/icons-react@^2.46.0": + version "2.47.0" + resolved "https://registry.yarnpkg.com/@tabler/icons-react/-/icons-react-2.47.0.tgz#b704e7ae98f95be8bd6e938b4b2e84cd20b0cf31" + integrity sha512-iqly2FvCF/qUbgmvS8E40rVeYY7laltc5GUjRxQj59DuX0x/6CpKHTXt86YlI2whg4czvd/c8Ce8YR08uEku0g== + dependencies: + "@tabler/icons" "2.47.0" + prop-types "^15.7.2" + +"@tabler/icons@2.47.0": + version "2.47.0" + resolved "https://registry.yarnpkg.com/@tabler/icons/-/icons-2.47.0.tgz#c41c680d1947e3ab2d60af3febc4132287c60596" + integrity sha512-4w5evLh+7FUUiA1GucvGj2ReX2TvOjEr4ejXdwL/bsjoSkof6r1gQmzqI+VHrE2CpJpB3al7bCTulOkFa/RcyA== + "@tanstack/query-core@5.52.2": version "5.52.2" resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.52.2.tgz#a023864a892fda9858b724d667eb19cd84ce054a" @@ -3755,6 +3782,17 @@ resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== +"@valist/sdk@^2.9.1": + version "2.10.5" + resolved "https://registry.yarnpkg.com/@valist/sdk/-/sdk-2.10.5.tgz#e43cafc101d42097c6191ae2ac0f426b62603520" + integrity sha512-2m95VJfljJQXaSUfqfVwfHsaVcgynY4yy6wKjIsACYgiKkzck2XqjyAOtLhRESyzvuNvBA/ypj0mP+JxdmCtOw== + dependencies: + "@ethersproject/contracts" "^5.7.0" + axios "^1.4.0" + axios-retry "^4.4.1" + ethers "^6.11.1" + node-fetch "^2.6.1" + "@valist/sdk@^2.9.17": version "2.9.17" resolved "https://registry.yarnpkg.com/@valist/sdk/-/sdk-2.9.17.tgz#05969eba1d6165be76cb89350b78cec1e99456e6" @@ -6921,6 +6959,13 @@ eth-rpc-errors@^4.0.2, eth-rpc-errors@^4.0.3: dependencies: fast-safe-stringify "^2.0.6" +ethereum-blockies-base64@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/ethereum-blockies-base64/-/ethereum-blockies-base64-1.0.2.tgz#4aebca52142bf4d16a3144e6e2b59303e39ed2b3" + integrity sha512-Vg2HTm7slcWNKaRhCUl/L3b4KrB8ohQXdd5Pu3OI897EcR6tVRvUqdTwAyx+dnmoDzj8e2bwBLDQ50ByFmcz6w== + dependencies: + pnglib "0.0.1" + ethereum-cryptography@^2.0.0: version "2.2.1" resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz#58f2810f8e020aecb97de8c8c76147600b0b8ccf" @@ -11122,6 +11167,11 @@ pngjs@^5.0.0: resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-5.0.0.tgz#e79dd2b215767fd9c04561c01236df960bce7fbb" integrity sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw== +pnglib@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/pnglib/-/pnglib-0.0.1.tgz#f9ab6f9c688f4a9d579ad8be28878a716e30c096" + integrity sha512-95ChzOoYLOPIyVmL+Y6X+abKGXUJlvOVLkB1QQkyXl7Uczc6FElUy/x01NS7r2GX6GRezloO/ecCX9h4U9KadA== + pony-cause@^2.1.10: version "2.1.11" resolved "https://registry.yarnpkg.com/pony-cause/-/pony-cause-2.1.11.tgz#d69a20aaccdb3bdb8f74dd59e5c68d8e6772e4bd" @@ -11271,7 +11321,7 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" -prop-types@^15.5.10, prop-types@^15.6.2, prop-types@^15.8.1: +prop-types@^15.5.10, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: version "15.8.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== From ec7ade6ad6b34d379dec044cf8942aa3f2740ad6 Mon Sep 17 00:00:00 2001 From: Brett <27568879+BrettCleary@users.noreply.github.com> Date: Wed, 16 Oct 2024 00:25:51 -0700 Subject: [PATCH 05/13] add mm portfolio coming soon --- src/frontend/OverlayManager/Overlay/index.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/frontend/OverlayManager/Overlay/index.tsx b/src/frontend/OverlayManager/Overlay/index.tsx index 64f8297f5..7c2ae242b 100644 --- a/src/frontend/OverlayManager/Overlay/index.tsx +++ b/src/frontend/OverlayManager/Overlay/index.tsx @@ -160,6 +160,23 @@ export const Overlay = observer(function ({ currentRoute={selectedRoute} classNames={{ link: BrowserGameStyles.disabled }} secondaryTag={comingSoonText} + />, + + } + key={'/portfolio'} + collapsed={collapsed} + currentRoute={selectedRoute} + classNames={{ link: BrowserGameStyles.disabled }} + secondaryTag={comingSoonText} /> ]} setCollapsed={setCollapsed} From 6902c829253068acdc2148e5fbc700fb470d8e75 Mon Sep 17 00:00:00 2001 From: Brett <27568879+BrettCleary@users.noreply.github.com> Date: Wed, 16 Oct 2024 00:55:23 -0700 Subject: [PATCH 06/13] add mm portfolio --- .../NavBarOverlayWrapper/index.module.scss | 3 + .../Overlay/NavBarOverlayWrapper/index.tsx | 69 ++++++++++++++++++ .../OverlayManager/Overlay/index.module.scss | 4 -- src/frontend/OverlayManager/Overlay/index.tsx | 72 ++++--------------- .../MetaMaskPortfolio/index.module.css | 1 + 5 files changed, 86 insertions(+), 63 deletions(-) create mode 100644 src/frontend/OverlayManager/Overlay/NavBarOverlayWrapper/index.module.scss create mode 100644 src/frontend/OverlayManager/Overlay/NavBarOverlayWrapper/index.tsx diff --git a/src/frontend/OverlayManager/Overlay/NavBarOverlayWrapper/index.module.scss b/src/frontend/OverlayManager/Overlay/NavBarOverlayWrapper/index.module.scss new file mode 100644 index 000000000..a2154b032 --- /dev/null +++ b/src/frontend/OverlayManager/Overlay/NavBarOverlayWrapper/index.module.scss @@ -0,0 +1,3 @@ +.disabled { + cursor: not-allowed !important; +} diff --git a/src/frontend/OverlayManager/Overlay/NavBarOverlayWrapper/index.tsx b/src/frontend/OverlayManager/Overlay/NavBarOverlayWrapper/index.tsx new file mode 100644 index 000000000..626c318d1 --- /dev/null +++ b/src/frontend/OverlayManager/Overlay/NavBarOverlayWrapper/index.tsx @@ -0,0 +1,69 @@ +import React, { useState } from 'react' +import styles from './index.module.scss' +import { t } from 'i18next' +import { NavBarOverlay, NavItem, Images } from '@hyperplay/ui' +import { Link, useLocation } from 'react-router-dom' + +export function NavBarOverlayWrapper() { + const location = useLocation() + const { pathname } = location + const [collapsed, setCollapsed] = useState(false) + const comingSoonText = t('overlay.comingSoon', 'Coming Soon') + + return ( + } + alertNumber={10} + key={'/quests'} + collapsed={collapsed} + currentRoute={pathname} + component={Link} + to={'/quests'} + />, + + } + key={'/portfolio'} + collapsed={collapsed} + currentRoute={pathname} + component={Link} + to={'/portfolio'} + />, + } + key={'/marketplace'} + collapsed={collapsed} + currentRoute={pathname} + classNames={{ link: styles.disabled }} + secondaryTag={comingSoonText} + />, + } + key={'/achievements'} + collapsed={collapsed} + currentRoute={pathname} + classNames={{ link: styles.disabled }} + secondaryTag={comingSoonText} + /> + ]} + setCollapsed={setCollapsed} + collapsed={collapsed} + /> + ) +} diff --git a/src/frontend/OverlayManager/Overlay/index.module.scss b/src/frontend/OverlayManager/Overlay/index.module.scss index 896de89b3..c4efe37c6 100644 --- a/src/frontend/OverlayManager/Overlay/index.module.scss +++ b/src/frontend/OverlayManager/Overlay/index.module.scss @@ -56,7 +56,3 @@ .hideOverlay { display: none; } - -.disabled { - cursor: not-allowed !important; -} diff --git a/src/frontend/OverlayManager/Overlay/index.tsx b/src/frontend/OverlayManager/Overlay/index.tsx index 7c2ae242b..ba04d5354 100644 --- a/src/frontend/OverlayManager/Overlay/index.tsx +++ b/src/frontend/OverlayManager/Overlay/index.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react' +import React, { useEffect } from 'react' import BrowserGameStyles from './index.module.scss' import ToastManager from '../ToastManager' import { PROVIDERS } from 'common/types/proxy-types' @@ -9,17 +9,19 @@ import { t } from 'i18next' import ExtensionManager from 'frontend/ExtensionManager' import TransactionState from 'frontend/state/TransactionState' import { BrowserGameProps } from '../types' -import { Button, NavBarOverlay, NavItem, Images } from '@hyperplay/ui' +import { Button } from '@hyperplay/ui' import { QuestsViewer } from 'frontend/components/UI/QuestsViewer' import { useFlags } from 'launchdarkly-react-client-sdk' import libraryState from 'frontend/state/libraryState' import classNames from 'classnames' +import { HashRouter, Route, Routes } from 'react-router-dom' +import MetaMaskPortfolio from 'frontend/screens/MetaMaskPortfolio' +import { NavBarOverlayWrapper } from './NavBarOverlayWrapper' export const Overlay = observer(function ({ appName, runner }: BrowserGameProps) { - const [collapsed, setCollapsed] = useState(false) const flags = useFlags() const txnToastContainerStyle = {} as React.CSSProperties if (OverlayState.title === 'HyperPlay Toasts') { @@ -120,69 +122,21 @@ export const Overlay = observer(function ({ questsViewer = } - const selectedRoute = '/quests' const classNameMods: Record = {} classNameMods[BrowserGameStyles.hideOverlay] = !OverlayState.showOverlay - const comingSoonText = t('overlay.comingSoon', 'Coming Soon') - overlayItems = (
- } - alertNumber={10} - key={'/quests'} - collapsed={collapsed} - currentRoute={selectedRoute} - />, - } - key={'/marketplace'} - collapsed={collapsed} - currentRoute={selectedRoute} - classNames={{ link: BrowserGameStyles.disabled }} - secondaryTag={comingSoonText} - />, - } - key={'/achievements'} - collapsed={collapsed} - currentRoute={selectedRoute} - classNames={{ link: BrowserGameStyles.disabled }} - secondaryTag={comingSoonText} - />, - - } - key={'/portfolio'} - collapsed={collapsed} - currentRoute={selectedRoute} - classNames={{ link: BrowserGameStyles.disabled }} - secondaryTag={comingSoonText} - /> - ]} - setCollapsed={setCollapsed} - collapsed={collapsed} - /> - {questsViewer} + + + + + + } /> + +
{exitGameButton} {extensionManager} diff --git a/src/frontend/screens/MetaMaskPortfolio/index.module.css b/src/frontend/screens/MetaMaskPortfolio/index.module.css index d7c4ed6bd..02d705f1a 100644 --- a/src/frontend/screens/MetaMaskPortfolio/index.module.css +++ b/src/frontend/screens/MetaMaskPortfolio/index.module.css @@ -1,5 +1,6 @@ .homeDiv { height: 100%; + width: 100%; } .homeWebview { From 8b3a62b107db7792fe163c71b4c08530fcc051e0 Mon Sep 17 00:00:00 2001 From: Brett Cleary <27568879+BrettCleary@users.noreply.github.com> Date: Wed, 16 Oct 2024 13:27:42 -0700 Subject: [PATCH 07/13] fix lint and prettier --- src/frontend/OverlayManager/Overlay/index.tsx | 6 +- yarn.lock | 60 ++----------------- 2 files changed, 7 insertions(+), 59 deletions(-) diff --git a/src/frontend/OverlayManager/Overlay/index.tsx b/src/frontend/OverlayManager/Overlay/index.tsx index 9bc855ff1..ba04d5354 100644 --- a/src/frontend/OverlayManager/Overlay/index.tsx +++ b/src/frontend/OverlayManager/Overlay/index.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react' +import React, { useEffect } from 'react' import BrowserGameStyles from './index.module.scss' import ToastManager from '../ToastManager' import { PROVIDERS } from 'common/types/proxy-types' @@ -9,7 +9,7 @@ import { t } from 'i18next' import ExtensionManager from 'frontend/ExtensionManager' import TransactionState from 'frontend/state/TransactionState' import { BrowserGameProps } from '../types' -import { Button, NavBarOverlay, NavItem, Images } from '@hyperplay/ui' +import { Button } from '@hyperplay/ui' import { QuestsViewer } from 'frontend/components/UI/QuestsViewer' import { useFlags } from 'launchdarkly-react-client-sdk' import libraryState from 'frontend/state/libraryState' @@ -22,7 +22,6 @@ export const Overlay = observer(function ({ appName, runner }: BrowserGameProps) { - const [collapsed, setCollapsed] = useState(false) const flags = useFlags() const txnToastContainerStyle = {} as React.CSSProperties if (OverlayState.title === 'HyperPlay Toasts') { @@ -123,7 +122,6 @@ export const Overlay = observer(function ({ questsViewer = } - const selectedRoute = '/quests' const classNameMods: Record = {} classNameMods[BrowserGameStyles.hideOverlay] = !OverlayState.showOverlay diff --git a/yarn.lock b/yarn.lock index a48aa0443..3b3baa650 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1151,7 +1151,7 @@ resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.6.0.tgz#31ab07ca6a06358c5de4d295d4711b675006163f" integrity sha512-xyX0X9mc0kyz9plIyryrRbl7ngsA9jz77mCZJsUkLl+ZKs0KWObgaEBoSgQiYWAsSmjz/yjl0F++Got0Mdp4Rw== -"@fortawesome/fontawesome-svg-core@^6.1.1", "@fortawesome/fontawesome-svg-core@^6.4.0": +"@fortawesome/fontawesome-svg-core@^6.1.1": version "6.6.0" resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.6.0.tgz#2a24c32ef92136e98eae2ff334a27145188295ff" integrity sha512-KHwPkCk6oRT4HADE7smhfsKudt9N/9lm6EJ5BVg0tD1yPA5hht837fB87F8pn15D8JfTqQOjhKTktwmLMiD7Kg== @@ -1165,21 +1165,21 @@ dependencies: "@fortawesome/fontawesome-common-types" "6.6.0" -"@fortawesome/free-regular-svg-icons@^6.4.0", "@fortawesome/free-regular-svg-icons@^6.6.0": +"@fortawesome/free-regular-svg-icons@^6.6.0": version "6.6.0" resolved "https://registry.yarnpkg.com/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.6.0.tgz#fc49a947ac8dfd20403c9ea5f37f0919425bdf04" integrity sha512-Yv9hDzL4aI73BEwSEh20clrY8q/uLxawaQ98lekBx6t9dQKDHcDzzV1p2YtBGTtolYtNqcWdniOnhzB+JPnQEQ== dependencies: "@fortawesome/fontawesome-common-types" "6.6.0" -"@fortawesome/free-solid-svg-icons@^6.4.0", "@fortawesome/free-solid-svg-icons@^6.6.0": +"@fortawesome/free-solid-svg-icons@^6.6.0": version "6.6.0" resolved "https://registry.yarnpkg.com/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.6.0.tgz#061751ca43be4c4d814f0adbda8f006164ec9f3b" integrity sha512-IYv/2skhEDFc2WGUcqvFJkeK39Q+HyPf5GHUrT/l2pKbtgEIv1al1TKd6qStR5OIwQdN1GZP54ci3y4mroJWjA== dependencies: "@fortawesome/fontawesome-common-types" "6.6.0" -"@fortawesome/react-fontawesome@^0.2.0", "@fortawesome/react-fontawesome@^0.2.2": +"@fortawesome/react-fontawesome@^0.2.2": version "0.2.2" resolved "https://registry.yarnpkg.com/@fortawesome/react-fontawesome/-/react-fontawesome-0.2.2.tgz#68b058f9132b46c8599875f6a636dad231af78d4" integrity sha512-EnkrprPNqI6SXJl//m29hpaNzOp1bruISWaOiRtkMi/xSvHJlzc2j2JAYS7egxt/EbjSNV/k6Xy0AQI6vB2+1g== @@ -1233,13 +1233,6 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3" integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== -"@hyperplay/chains@^0.2.9": - version "0.2.10" - resolved "https://registry.yarnpkg.com/@hyperplay/chains/-/chains-0.2.10.tgz#6c9d4e175146d79e4556039db487c182d60c533d" - integrity sha512-TUe9vJo9jXx23pb5QlGuW6xo6JmXYjqXKJSma//aUPZ99HU8I/lATlyqdXwozPfQ2qGsAYn58FCTo2kbF+J+8w== - dependencies: - axios "^1.4.0" - "@hyperplay/chains@^0.3.0": version "0.3.0" resolved "https://registry.yarnpkg.com/@hyperplay/chains/-/chains-0.3.0.tgz#f0cc73e1fde33678328249e40bf0d02bccd14625" @@ -1349,13 +1342,6 @@ dependencies: bignumber.js "^9.1.2" -"@hyperplay/utils@^0.1.0": - version "0.1.4" - resolved "https://registry.yarnpkg.com/@hyperplay/utils/-/utils-0.1.4.tgz#e36cfd82febaae1c54cec1e65649169ede518dae" - integrity sha512-brHHvhSl5fOLIX2hCp2ZP0dfdMHb8uGME3o3NjK0imVdYlspUVe1YXp5x9P5O2iJn+7C3oPlbLARsC/KTDWSJw== - dependencies: - bignumber.js "^9.1.2" - "@hyperplay/utils@^0.2.4": version "0.2.4" resolved "https://registry.yarnpkg.com/@hyperplay/utils/-/utils-0.2.4.tgz#17621d43f0d92a3d22de87dc08d96b0f2db2291c" @@ -2998,19 +2984,6 @@ dependencies: defer-to-connect "^2.0.0" -"@tabler/icons-react@^2.46.0": - version "2.47.0" - resolved "https://registry.yarnpkg.com/@tabler/icons-react/-/icons-react-2.47.0.tgz#b704e7ae98f95be8bd6e938b4b2e84cd20b0cf31" - integrity sha512-iqly2FvCF/qUbgmvS8E40rVeYY7laltc5GUjRxQj59DuX0x/6CpKHTXt86YlI2whg4czvd/c8Ce8YR08uEku0g== - dependencies: - "@tabler/icons" "2.47.0" - prop-types "^15.7.2" - -"@tabler/icons@2.47.0": - version "2.47.0" - resolved "https://registry.yarnpkg.com/@tabler/icons/-/icons-2.47.0.tgz#c41c680d1947e3ab2d60af3febc4132287c60596" - integrity sha512-4w5evLh+7FUUiA1GucvGj2ReX2TvOjEr4ejXdwL/bsjoSkof6r1gQmzqI+VHrE2CpJpB3al7bCTulOkFa/RcyA== - "@tanstack/query-core@5.52.2": version "5.52.2" resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.52.2.tgz#a023864a892fda9858b724d667eb19cd84ce054a" @@ -3782,17 +3755,6 @@ resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== -"@valist/sdk@^2.9.1": - version "2.10.5" - resolved "https://registry.yarnpkg.com/@valist/sdk/-/sdk-2.10.5.tgz#e43cafc101d42097c6191ae2ac0f426b62603520" - integrity sha512-2m95VJfljJQXaSUfqfVwfHsaVcgynY4yy6wKjIsACYgiKkzck2XqjyAOtLhRESyzvuNvBA/ypj0mP+JxdmCtOw== - dependencies: - "@ethersproject/contracts" "^5.7.0" - axios "^1.4.0" - axios-retry "^4.4.1" - ethers "^6.11.1" - node-fetch "^2.6.1" - "@valist/sdk@^2.9.17": version "2.9.17" resolved "https://registry.yarnpkg.com/@valist/sdk/-/sdk-2.9.17.tgz#05969eba1d6165be76cb89350b78cec1e99456e6" @@ -6959,13 +6921,6 @@ eth-rpc-errors@^4.0.2, eth-rpc-errors@^4.0.3: dependencies: fast-safe-stringify "^2.0.6" -ethereum-blockies-base64@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/ethereum-blockies-base64/-/ethereum-blockies-base64-1.0.2.tgz#4aebca52142bf4d16a3144e6e2b59303e39ed2b3" - integrity sha512-Vg2HTm7slcWNKaRhCUl/L3b4KrB8ohQXdd5Pu3OI897EcR6tVRvUqdTwAyx+dnmoDzj8e2bwBLDQ50ByFmcz6w== - dependencies: - pnglib "0.0.1" - ethereum-cryptography@^2.0.0: version "2.2.1" resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz#58f2810f8e020aecb97de8c8c76147600b0b8ccf" @@ -11167,11 +11122,6 @@ pngjs@^5.0.0: resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-5.0.0.tgz#e79dd2b215767fd9c04561c01236df960bce7fbb" integrity sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw== -pnglib@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/pnglib/-/pnglib-0.0.1.tgz#f9ab6f9c688f4a9d579ad8be28878a716e30c096" - integrity sha512-95ChzOoYLOPIyVmL+Y6X+abKGXUJlvOVLkB1QQkyXl7Uczc6FElUy/x01NS7r2GX6GRezloO/ecCX9h4U9KadA== - pony-cause@^2.1.10: version "2.1.11" resolved "https://registry.yarnpkg.com/pony-cause/-/pony-cause-2.1.11.tgz#d69a20aaccdb3bdb8f74dd59e5c68d8e6772e4bd" @@ -11321,7 +11271,7 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" -prop-types@^15.5.10, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: +prop-types@^15.5.10, prop-types@^15.6.2, prop-types@^15.8.1: version "15.8.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== From a69295030d8c0a16b7a3454d6a110bc52fc9717d Mon Sep 17 00:00:00 2001 From: Brett <27568879+BrettCleary@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:15:45 -0700 Subject: [PATCH 08/13] add shiny loader while mm portfolio is loading --- .../MetaMaskPortfolio/index.module.css | 8 ------ .../MetaMaskPortfolio/index.module.scss | 20 +++++++++++++ .../screens/MetaMaskPortfolio/index.tsx | 28 +++++++++++++++++-- 3 files changed, 45 insertions(+), 11 deletions(-) delete mode 100644 src/frontend/screens/MetaMaskPortfolio/index.module.css create mode 100644 src/frontend/screens/MetaMaskPortfolio/index.module.scss diff --git a/src/frontend/screens/MetaMaskPortfolio/index.module.css b/src/frontend/screens/MetaMaskPortfolio/index.module.css deleted file mode 100644 index 02d705f1a..000000000 --- a/src/frontend/screens/MetaMaskPortfolio/index.module.css +++ /dev/null @@ -1,8 +0,0 @@ -.homeDiv { - height: 100%; - width: 100%; -} - -.homeWebview { - height: 100%; -} diff --git a/src/frontend/screens/MetaMaskPortfolio/index.module.scss b/src/frontend/screens/MetaMaskPortfolio/index.module.scss new file mode 100644 index 000000000..eb5905ef7 --- /dev/null +++ b/src/frontend/screens/MetaMaskPortfolio/index.module.scss @@ -0,0 +1,20 @@ +@import '@hyperplay/ui/utilities/_loading.scss'; + +.homeDiv { + height: 100%; + width: 100%; +} + +.homeWebview { + height: 100%; +} + +.hide { + display: none; +} + +.loader { + @include shinyLoader; + height: 100%; + width: 100%; +} diff --git a/src/frontend/screens/MetaMaskPortfolio/index.tsx b/src/frontend/screens/MetaMaskPortfolio/index.tsx index ba6183cd6..16cdcb69f 100644 --- a/src/frontend/screens/MetaMaskPortfolio/index.tsx +++ b/src/frontend/screens/MetaMaskPortfolio/index.tsx @@ -1,19 +1,41 @@ -import React from 'react' -import MetaMaskPortfolioStyles from './index.module.css' +import React, { useEffect, useRef, useState } from 'react' +import MetaMaskPortfolioStyles from './index.module.scss' import { useParams } from 'react-router-dom' +import classNames from 'classnames' const MetaMaskPortfolio = function () { const trueAsStr = 'true' as unknown as boolean | undefined const { page = '' } = useParams() as { page: string } + const [loaded, setLoaded] = useState(false) + const webviewRef = useRef(null) + + let content = null + if (!loaded) { + content =
+ } + + const webviewClassnames: Record = {} + webviewClassnames[MetaMaskPortfolioStyles.hide] = !loaded + + useEffect(() => { + webviewRef.current?.addEventListener('did-finish-load', () => { + setLoaded(true) + }) + }, []) return ( <>
+ {content}
From 8469a3b81135fe38a00b87774659d33a7dca9325 Mon Sep 17 00:00:00 2001 From: Brett <27568879+BrettCleary@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:16:35 -0700 Subject: [PATCH 09/13] fix target blank urls --- src/backend/storeManagers/storeManagerCommon/games.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backend/storeManagers/storeManagerCommon/games.ts b/src/backend/storeManagers/storeManagerCommon/games.ts index f611e9a57..162c1a61f 100644 --- a/src/backend/storeManagers/storeManagerCommon/games.ts +++ b/src/backend/storeManagers/storeManagerCommon/games.ts @@ -135,6 +135,9 @@ const openNewBrowserGameWindow = async ( /* this overrides the handler set in extension-importer but falls back to its behavior */ contents.setWindowOpenHandler(({ url }) => { + if (url === 'about:blank') { + return { action: 'allow' } + } const urlToOpen = new URL(url) const protocol = urlToOpen.protocol From 131120f5b7e5427e766e987589e4610725652437 Mon Sep 17 00:00:00 2001 From: Brett <27568879+BrettCleary@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:18:30 -0700 Subject: [PATCH 10/13] rm alert number --- .../OverlayManager/Overlay/NavBarOverlayWrapper/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/frontend/OverlayManager/Overlay/NavBarOverlayWrapper/index.tsx b/src/frontend/OverlayManager/Overlay/NavBarOverlayWrapper/index.tsx index 626c318d1..b5a4f1cb4 100644 --- a/src/frontend/OverlayManager/Overlay/NavBarOverlayWrapper/index.tsx +++ b/src/frontend/OverlayManager/Overlay/NavBarOverlayWrapper/index.tsx @@ -17,7 +17,6 @@ export function NavBarOverlayWrapper() { title={'Quests'} route={'/quests'} icon={} - alertNumber={10} key={'/quests'} collapsed={collapsed} currentRoute={pathname} From 93c94de61e5fb0390291deb213eddf1753c0129a Mon Sep 17 00:00:00 2001 From: Brett <27568879+BrettCleary@users.noreply.github.com> Date: Thu, 17 Oct 2024 01:40:00 -0700 Subject: [PATCH 11/13] fix redirects --- .../storeManagers/storeManagerCommon/games.ts | 79 +++++++++++++------ 1 file changed, 56 insertions(+), 23 deletions(-) diff --git a/src/backend/storeManagers/storeManagerCommon/games.ts b/src/backend/storeManagers/storeManagerCommon/games.ts index 162c1a61f..fde4d1705 100644 --- a/src/backend/storeManagers/storeManagerCommon/games.ts +++ b/src/backend/storeManagers/storeManagerCommon/games.ts @@ -26,7 +26,12 @@ import { access, chmod } from 'fs/promises' import shlex from 'shlex' import { showDialogBoxModalAuto } from '../../dialog/dialog' import { createAbortController } from '../../utils/aborthandler/aborthandler' -import { app, BrowserWindow } from 'electron' +import { + app, + BrowserWindow, + BrowserWindowConstructorOptions, + WindowOpenHandlerResponse +} from 'electron' import { gameManagerMap } from '../index' const buildDir = resolve(__dirname, '../../build') import { domainsAreEqual } from 'common/utils' @@ -47,6 +52,24 @@ export function logFileLocation(appName: string) { return join(gamesConfigPath, `${appName}-lastPlay.log`) } +const openBlankWindow = (options: BrowserWindowConstructorOptions) => { + options.show = false + const browserGame = new BrowserWindow(options) + + browserGame.webContents.on('will-navigate', async (...params) => { + import('@hyperplay/extension-importer').then((extensionImporter) => { + extensionImporter?.windowOpenHandlerForExtension( + params[0].url, + browserGame.webContents, + hpApi + ) + browserGame.close() + }) + }) + + return browserGame.webContents +} + const openNewBrowserGameWindow = async ( browserUrl: string, gameInfo: GameInfo @@ -62,6 +85,35 @@ const openNewBrowserGameWindow = async ( logError(`Error importing proxy server ${err}`, LogPrefix.HyperPlay) } const hpOverlay = await getHpOverlay() + const urlParent = new URL(browserUrl) + + function handleUrlOpen( + url: string, + contents: Electron.WebContents + ): WindowOpenHandlerResponse { + const urlToOpen = new URL(url) + const protocol = urlToOpen.protocol + + if (url === 'about:blank') { + return { action: 'allow', createWindow: openBlankWindow } + } + + if ( + ['https:', 'http:'].includes(protocol) && + domainsAreEqual(urlToOpen, urlParent) + ) { + openNewBrowserGameWindow(url, gameInfo) + return { action: 'deny' } + } + return ( + extensionImporter?.windowOpenHandlerForExtension( + url, + contents, + hpApi + ) ?? { action: 'deny' } + ) + } + return new Promise((res) => { const browserGame = new BrowserWindow({ icon: icon, @@ -120,7 +172,6 @@ const openNewBrowserGameWindow = async ( gameInfo.runner }` - const urlParent = new URL(browserUrl) const openNewBroswerGameWindowListener = ( ev: Electron.Event, contents: Electron.WebContents @@ -134,27 +185,9 @@ const openNewBrowserGameWindow = async ( ) /* this overrides the handler set in extension-importer but falls back to its behavior */ - contents.setWindowOpenHandler(({ url }) => { - if (url === 'about:blank') { - return { action: 'allow' } - } - const urlToOpen = new URL(url) - const protocol = urlToOpen.protocol - - if ( - ['https:', 'http:'].includes(protocol) && - domainsAreEqual(urlToOpen, urlParent) - ) { - openNewBrowserGameWindow(url, gameInfo) - return { action: 'deny' } - } - return ( - extensionImporter?.windowOpenHandlerForExtension( - url, - contents, - hpApi - ) ?? { action: 'deny' } - ) + contents.setWindowOpenHandler((handler) => { + const { url } = handler + return handleUrlOpen(url, contents) }) } } From 0ee62d83455c949b15c58635cc1b7eb0bc6723ab Mon Sep 17 00:00:00 2001 From: Brett <27568879+BrettCleary@users.noreply.github.com> Date: Thu, 17 Oct 2024 01:40:48 -0700 Subject: [PATCH 12/13] fix default selected route --- .../OverlayManager/Overlay/NavBarOverlayWrapper/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/OverlayManager/Overlay/NavBarOverlayWrapper/index.tsx b/src/frontend/OverlayManager/Overlay/NavBarOverlayWrapper/index.tsx index b5a4f1cb4..1a21e68b4 100644 --- a/src/frontend/OverlayManager/Overlay/NavBarOverlayWrapper/index.tsx +++ b/src/frontend/OverlayManager/Overlay/NavBarOverlayWrapper/index.tsx @@ -19,7 +19,7 @@ export function NavBarOverlayWrapper() { icon={} key={'/quests'} collapsed={collapsed} - currentRoute={pathname} + currentRoute={pathname === '/' ? '/quests' : pathname} component={Link} to={'/quests'} />, From 62cdd24c6a5646d469fee39e5f9639f65f1c9101 Mon Sep 17 00:00:00 2001 From: Brett <27568879+BrettCleary@users.noreply.github.com> Date: Thu, 17 Oct 2024 01:40:55 -0700 Subject: [PATCH 13/13] fix loader --- .../MetaMaskPortfolio/index.module.scss | 6 +++++ .../screens/MetaMaskPortfolio/index.tsx | 25 +++---------------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/src/frontend/screens/MetaMaskPortfolio/index.module.scss b/src/frontend/screens/MetaMaskPortfolio/index.module.scss index eb5905ef7..71b16a6b4 100644 --- a/src/frontend/screens/MetaMaskPortfolio/index.module.scss +++ b/src/frontend/screens/MetaMaskPortfolio/index.module.scss @@ -3,10 +3,14 @@ .homeDiv { height: 100%; width: 100%; + position: relative; } .homeWebview { height: 100%; + width: 100%; + position: absolute; + z-index: 1; } .hide { @@ -17,4 +21,6 @@ @include shinyLoader; height: 100%; width: 100%; + position: absolute; + z-index: 0; } diff --git a/src/frontend/screens/MetaMaskPortfolio/index.tsx b/src/frontend/screens/MetaMaskPortfolio/index.tsx index 16cdcb69f..04de2536e 100644 --- a/src/frontend/screens/MetaMaskPortfolio/index.tsx +++ b/src/frontend/screens/MetaMaskPortfolio/index.tsx @@ -1,37 +1,18 @@ -import React, { useEffect, useRef, useState } from 'react' +import React, { useRef } from 'react' import MetaMaskPortfolioStyles from './index.module.scss' import { useParams } from 'react-router-dom' -import classNames from 'classnames' const MetaMaskPortfolio = function () { const trueAsStr = 'true' as unknown as boolean | undefined const { page = '' } = useParams() as { page: string } - const [loaded, setLoaded] = useState(false) const webviewRef = useRef(null) - let content = null - if (!loaded) { - content =
- } - - const webviewClassnames: Record = {} - webviewClassnames[MetaMaskPortfolioStyles.hide] = !loaded - - useEffect(() => { - webviewRef.current?.addEventListener('did-finish-load', () => { - setLoaded(true) - }) - }, []) - return ( <>
- {content} +