From 125cfd8addb6515f73898634be2c41d131d8773b Mon Sep 17 00:00:00 2001 From: Ignacio Date: Fri, 8 Mar 2024 22:04:33 +0800 Subject: [PATCH] feat: improve table layout --- package-lock.json | 72 +++++++++---------- package.json | 2 +- src/constants.ts | 11 ++- src/features/core/components/table.tsx | 11 +++ .../staking/components/address-short.tsx | 2 +- .../staking/components/delegation-details.tsx | 18 ++--- .../staking/components/validators-table.tsx | 18 ++--- 7 files changed, 67 insertions(+), 67 deletions(-) diff --git a/package-lock.json b/package-lock.json index d37b45f..62ae8e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "abstraxion-staking-poc", "version": "0.1.0", "dependencies": { - "@burnt-labs/abstraxion": "^1.0.0-alpha.38", + "@burnt-labs/abstraxion": "^1.0.0-alpha.39", "@burnt-labs/constants": "^0.1.0-alpha.6", "@burnt-labs/ui": "^0.1.0-alpha.7", "@cosmjs/cosmwasm-stargate": "^0.32.2", @@ -72,9 +72,9 @@ } }, "node_modules/@apollo/client": { - "version": "3.9.5", - "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.9.5.tgz", - "integrity": "sha512-7y+c8MTPU+hhTwvcGVtMMGIgWduzrvG1mz5yJMRyqYbheBkkky3Lki6ADWVSBXG1lZoOtPYvB2zDgVfKb2HSsw==", + "version": "3.9.6", + "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.9.6.tgz", + "integrity": "sha512-+zpddcnZ4G2VZ0xIEnvIHFsLqeopNOnWuE2ZVbRuetLLpj/biLPNN719B/iofdd1/iHRclKfv0XaAmX6PBhYKA==", "dependencies": { "@graphql-typed-document-node/core": "^3.1.1", "@wry/caches": "^1.0.0", @@ -84,7 +84,7 @@ "hoist-non-react-statics": "^3.3.2", "optimism": "^0.18.0", "prop-types": "^15.7.2", - "rehackt": "0.0.5", + "rehackt": "0.0.6", "response-iterator": "^0.2.6", "symbol-observable": "^4.0.0", "ts-invariant": "^0.10.3", @@ -375,13 +375,13 @@ } }, "node_modules/@burnt-labs/abstraxion": { - "version": "1.0.0-alpha.38", - "resolved": "https://registry.npmjs.org/@burnt-labs/abstraxion/-/abstraxion-1.0.0-alpha.38.tgz", - "integrity": "sha512-K5+taltuWrsBrO+c/Ut1hv58UiwXMSqTCOURZkZ0a8kSkaL2ikjy7qSJce/EKK/65xhG/HovQN+IZsZNtob2jQ==", + "version": "1.0.0-alpha.39", + "resolved": "https://registry.npmjs.org/@burnt-labs/abstraxion/-/abstraxion-1.0.0-alpha.39.tgz", + "integrity": "sha512-3yxzzik1yY/W8HJbsB79kG8gC6UBiXg6wIgduR8yreLVDzsJFXMi3gx7APwVdlUBaOclbA6HaF2Lgw3/AH4g3g==", "dependencies": { - "@burnt-labs/abstraxion-core": "1.0.0-alpha.35", + "@burnt-labs/abstraxion-core": "1.0.0-alpha.36", "@burnt-labs/constants": "0.1.0-alpha.6", - "@burnt-labs/signers": "0.1.0-alpha.8", + "@burnt-labs/signers": "0.1.0-alpha.9", "@burnt-labs/ui": "0.1.0-alpha.7", "@cosmjs/amino": "^0.32.2", "@cosmjs/cosmwasm-stargate": "^0.32.2", @@ -404,12 +404,12 @@ } }, "node_modules/@burnt-labs/abstraxion-core": { - "version": "1.0.0-alpha.35", - "resolved": "https://registry.npmjs.org/@burnt-labs/abstraxion-core/-/abstraxion-core-1.0.0-alpha.35.tgz", - "integrity": "sha512-Sz95+WEdFYeZr3dRcXp3L/TzlLtNtIKsPpGao1cqj+U1+mLWLrnr1oq+WFgkMELlpJfZPZp9l/QeavyGcBjgZA==", + "version": "1.0.0-alpha.36", + "resolved": "https://registry.npmjs.org/@burnt-labs/abstraxion-core/-/abstraxion-core-1.0.0-alpha.36.tgz", + "integrity": "sha512-wef0+bfrbV2ojioomdZStMazlh/JtkOGOxjaDjqWTOcGCc+15HNjt7ouwvflxcSu+Ss5DWeWDBi16XoLE2yi8Q==", "dependencies": { "@burnt-labs/constants": "0.1.0-alpha.6", - "@burnt-labs/signers": "0.1.0-alpha.8", + "@burnt-labs/signers": "0.1.0-alpha.9", "@cosmjs/cosmwasm-stargate": "^0.32.2", "@cosmjs/proto-signing": "^0.32.2", "@cosmjs/stargate": "^0.32.2", @@ -425,9 +425,9 @@ "integrity": "sha512-k6DfdDFxxY4N72d6NoAPF7CXI4BNRnKvbsz+FdXQ+ws+4CzvrVuGBXhgpa1zs+PllXrouUnq+Dmds7Gz79vJOw==" }, "node_modules/@burnt-labs/signers": { - "version": "0.1.0-alpha.8", - "resolved": "https://registry.npmjs.org/@burnt-labs/signers/-/signers-0.1.0-alpha.8.tgz", - "integrity": "sha512-8t7Kmggkd1X5uI2Ie1xP1iSPBSkx7T4Ge9eRpB3i8CTaxYLRz2/tokQcV92W0dB4DKPQxmC7DwPf1p7Rp+kxyw==", + "version": "0.1.0-alpha.9", + "resolved": "https://registry.npmjs.org/@burnt-labs/signers/-/signers-0.1.0-alpha.9.tgz", + "integrity": "sha512-BBT7+OKxx6p+B78BVrF64+q6l6rRizThdUtbQiJFQMjttkkj+e0OvsmlHwFwSWGBZhVVD22sMB2QHNpzikaUFA==", "dependencies": { "@apollo/client": "^3.8.8", "@cosmjs/amino": "^0.32.2", @@ -4489,14 +4489,14 @@ } }, "node_modules/duplexify": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.2.tgz", - "integrity": "sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.3.tgz", + "integrity": "sha512-M3BmBhwJRZsSx38lZyhE53Csddgzl5R7xGJNk7CVddZD6CcmwMCH8J+7AprIrQKH7TonKxaCjcv27Qmf+sQ+oA==", "dependencies": { "end-of-stream": "^1.4.1", "inherits": "^2.0.3", "readable-stream": "^3.1.1", - "stream-shift": "^1.0.0" + "stream-shift": "^1.0.2" } }, "node_modules/duplexify/node_modules/readable-stream": { @@ -5523,9 +5523,9 @@ "dev": true }, "node_modules/fast-redact": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.3.0.tgz", - "integrity": "sha512-6T5V1QK1u4oF+ATxs1lWUmlEk6P2T9HqJG3e2DnHOdVgZy2rFJBoEnrIedcTXlkAHU/zKC+7KETJ+KGGKwxgMQ==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.4.0.tgz", + "integrity": "sha512-2gwPvyna0zwBdxKnng1suu/dTL5s8XEy2ZqH8mwDUwJdDkV8w5kp+JV26mupdK68HmPMbm6yjW9m7/Ys/BHEHg==", "engines": { "node": ">=6" } @@ -7075,9 +7075,9 @@ } }, "node_modules/jose": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/jose/-/jose-5.2.2.tgz", - "integrity": "sha512-/WByRr4jDcsKlvMd1dRJnPfS1GVO3WuKyaurJ/vvXcOaUQO8rnNObCQMlv/5uCceVQIq5Q4WLF44ohsdiTohdg==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/jose/-/jose-5.2.3.tgz", + "integrity": "sha512-KUXdbctm1uHVL8BYhnyHkgp3zDX5KW8ZhAKVFEfUbU2P8Alpzjb+48hHvjOdQIyPshoblhzsuqOwEEAbtHVirA==", "funding": { "url": "https://github.com/sponsors/panva" } @@ -7611,9 +7611,9 @@ } }, "node_modules/nan": { - "version": "2.18.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.18.0.tgz", - "integrity": "sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==" + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.19.0.tgz", + "integrity": "sha512-nO1xXxfh/RWNxfd/XPfbIfFk5vgLsAxUR9y5O0cHMJu/AW9U95JLXqthYHjEp+8gQ5p96K9jUp8nbVOxCdRbtw==" }, "node_modules/nanoid": { "version": "3.3.7", @@ -8920,9 +8920,9 @@ } }, "node_modules/rehackt": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/rehackt/-/rehackt-0.0.5.tgz", - "integrity": "sha512-BI1rV+miEkaHj8zd2n+gaMgzu/fKz7BGlb4zZ6HAiY9adDmJMkaDcmuXlJFv0eyKUob+oszs3/2gdnXUrzx2Tg==", + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/rehackt/-/rehackt-0.0.6.tgz", + "integrity": "sha512-l3WEzkt4ntlEc/IB3/mF6SRgNHA6zfQR7BlGOgBTOmx7IJJXojDASav+NsgXHFjHn+6RmwqsGPFgZpabWpeOdw==", "peerDependencies": { "@types/react": "*", "react": "*" @@ -9629,9 +9629,9 @@ } }, "node_modules/stytch/node_modules/jose": { - "version": "4.15.4", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.4.tgz", - "integrity": "sha512-W+oqK4H+r5sITxfxpSU+MMdr/YSWGvgZMQDIsNoBDGGy4i7GBPTtvFKibQzW06n3U3TqHjhvBJsirShsEJ6eeQ==", + "version": "4.15.5", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.5.tgz", + "integrity": "sha512-jc7BFxgKPKi94uOvEmzlSWFFe2+vASyXaKUpdQKatWAESU2MWjDfFf0fdfc83CDKcA5QecabZeNLyfhe3yKNkg==", "funding": { "url": "https://github.com/sponsors/panva" } diff --git a/package.json b/package.json index 3b526b6..f2c602a 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "type-check": "tsc --noEmit" }, "dependencies": { - "@burnt-labs/abstraxion": "^1.0.0-alpha.38", + "@burnt-labs/abstraxion": "^1.0.0-alpha.39", "@burnt-labs/constants": "^0.1.0-alpha.6", "@burnt-labs/ui": "^0.1.0-alpha.7", "@cosmjs/cosmwasm-stargate": "^0.32.2", diff --git a/src/constants.ts b/src/constants.ts index a80ac30..c2a0cb3 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,13 +1,10 @@ export const isTestnet = true; +// // For local testing // export const dashboardUrl = // process.env.NODE_ENV === "production" ? undefined : "http://localhost:3000"; -export const dashboardUrl = undefined; -// export const rpcEndpoint = -// typeof window === "undefined" -// ? "https://rpc.xion-testnet-1.burnt.com:443" -// : `${window.location.origin}/rpc`; +export const dashboardUrl = undefined; // export const rpcEndpoint = "https://rpc.xion-testnet-1.burnt.com:443"; export const rpcEndpoint = "https://rpc.xion-testnet.forbole.com"; @@ -19,8 +16,8 @@ export const xionToUSD = 10; export const defaultAvatar = `${basePath}/default-avatar.svg`; -// Even if this can be retrieved from the params, hardcode it to avoid an -// extra request. It can be retrieved with this: +// // Even if this can be retrieved from the params, hardcode it to avoid an +// // extra request. It can be retrieved with this: // const params = await queryClient.staking.params(); export const unbondingDays = isTestnet ? 3 : 21; diff --git a/src/features/core/components/table.tsx b/src/features/core/components/table.tsx index 41526b8..0437fbf 100644 --- a/src/features/core/components/table.tsx +++ b/src/features/core/components/table.tsx @@ -61,3 +61,14 @@ export const HeaderTitleBase = ({ ); }; + +export const ValidatorLogo = ({ logo }: { logo: string }) => ( +
+ Validator logo +
+); diff --git a/src/features/staking/components/address-short.tsx b/src/features/staking/components/address-short.tsx index 15edc99..3ea414f 100644 --- a/src/features/staking/components/address-short.tsx +++ b/src/features/staking/components/address-short.tsx @@ -7,7 +7,7 @@ type Props = { const AddressShort = ({ address }: Props) => { if (!address) return null; - const charsDisplayed = 5; + const charsDisplayed = 7; const formattedAddress = (() => { const left = address.slice(0, charsDisplayed); diff --git a/src/features/staking/components/delegation-details.tsx b/src/features/staking/components/delegation-details.tsx index 0352cd0..13b2219 100644 --- a/src/features/staking/components/delegation-details.tsx +++ b/src/features/staking/components/delegation-details.tsx @@ -7,7 +7,10 @@ import { ButtonPill, FloatingDropdown, } from "@/features/core/components/base"; -import { HeaderTitleBase } from "@/features/core/components/table"; +import { + HeaderTitleBase, + ValidatorLogo, +} from "@/features/core/components/table"; import { menu, pointer } from "@/features/core/lib/icons"; import { sortUtil } from "@/features/core/utils"; @@ -113,16 +116,9 @@ const DelegationRowBase = ({ return (
-
- Validator logo -
-
-
+ +
+
{validator?.description.moniker || ""}
diff --git a/src/features/staking/components/validators-table.tsx b/src/features/staking/components/validators-table.tsx index 7d92e2d..3935e01 100644 --- a/src/features/staking/components/validators-table.tsx +++ b/src/features/staking/components/validators-table.tsx @@ -12,7 +12,10 @@ import { TabButton, Title, } from "@/features/core/components/base"; -import { HeaderTitleBase } from "@/features/core/components/table"; +import { + HeaderTitleBase, + ValidatorLogo, +} from "@/features/core/components/table"; import { sortUtil } from "@/features/core/utils"; import { useStaking } from "../context/hooks"; @@ -71,16 +74,9 @@ const ValidatorRow = ({ style={gridStyle} >
-
- Validator logo -
-
-
+ +
+
{validator.description.moniker}