Skip to content

Commit

Permalink
Fix wc issue and name display (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tbaut authored Dec 17, 2024
1 parent 0a2fc03 commit 19b3240
Show file tree
Hide file tree
Showing 15 changed files with 418 additions and 451 deletions.
2 changes: 1 addition & 1 deletion .papi/descriptors/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.1.0-autogenerated.16610161129225071935",
"version": "0.1.0-autogenerated.9334411422428378426",
"name": "@polkadot-api/descriptors",
"files": [
"dist"
Expand Down
Binary file modified .papi/metadata/dot.scale
Binary file not shown.
Binary file modified .papi/metadata/dotPeople.scale
Binary file not shown.
Binary file modified .papi/metadata/ksm.scale
Binary file not shown.
Binary file modified .papi/metadata/ksmPeople.scale
Binary file not shown.
Binary file modified .papi/metadata/westend.scale
Binary file not shown.
Binary file modified .papi/metadata/westendPeople.scale
Binary file not shown.
46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"version": "0.0.1",
"type": "module",
"packageManager": "pnpm@9.8.0",
"packageManager": "pnpm@9.15.0",
"scripts": {
"preinstall": "npx only-allow pnpm",
"postinstall": "papi",
Expand All @@ -22,50 +22,50 @@
"@polkadot-labs/hdkd-helpers": "^0.0.10",
"@polkadot-ui/react": "0.0.1-alpha.35",
"@polkadot-ui/utils": "0.0.4",
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-menubar": "^1.1.2",
"@radix-ui/react-popover": "^1.1.2",
"@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-slider": "^1.2.1",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-toggle": "^1.1.0",
"@radix-ui/react-toggle-group": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.4",
"@radix-ui/react-dialog": "^1.1.3",
"@radix-ui/react-dropdown-menu": "^2.1.3",
"@radix-ui/react-label": "^2.1.1",
"@radix-ui/react-menubar": "^1.1.3",
"@radix-ui/react-popover": "^1.1.3",
"@radix-ui/react-select": "^2.1.3",
"@radix-ui/react-slider": "^1.2.2",
"@radix-ui/react-slot": "^1.1.1",
"@radix-ui/react-toggle": "^1.1.1",
"@radix-ui/react-toggle-group": "^1.1.1",
"@radix-ui/react-tooltip": "^1.1.5",
"@reactive-dot/core": "^0.27.1",
"@reactive-dot/react": "^0.27.1",
"@reactive-dot/wallet-walletconnect": "^0.16.20",
"@reactive-dot/react": "^0.28.0",
"@reactive-dot/wallet-walletconnect": "^0.17.0",
"@tanstack/react-table": "^8.20.5",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"copy-to-clipboard": "^3.3.3",
"dot-connect": "^0.13.2",
"lucide-react": "^0.465.0",
"next-themes": "^0.4.3",
"polkadot-api": "^1.7.7",
"lucide-react": "^0.468.0",
"next-themes": "^0.4.4",
"polkadot-api": "^1.7.8",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.4.0",
"react-markdown": "^9.0.1",
"react-router-dom": "^7.0.2",
"sonner": "^1.7.0",
"sonner": "^1.7.1",
"tailwind-merge": "^2.5.5",
"tailwindcss-animate": "^1.0.7",
"usehooks-ts": "^3.1.0"
},
"devDependencies": {
"@types/node": "^22.10.1",
"@types/node": "^22.10.2",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react-router-dom": "^5.3.3",
"@typescript-eslint/eslint-plugin": "^8.17.0",
"@typescript-eslint/parser": "^8.17.0",
"@typescript-eslint/eslint-plugin": "^8.18.0",
"@typescript-eslint/parser": "^8.18.0",
"@vitejs/plugin-react": "^4.3.4",
"autoprefixer": "^10.4.20",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.16",
"gh-pages": "^6.2.0",
"install": "0.13.0",
Expand All @@ -74,7 +74,7 @@
"prettier-plugin-tailwindcss": "^0.6.9",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
"vite": "^6.0.2",
"vite": "^6.0.3",
"vite-plugin-svgr": "^4.3.0"
}
}
803 changes: 384 additions & 419 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ export const Header = () => {
className="mr-2"
outerColor="transparent"
/>
{selectedAccount?.name}
{selectedAccount?.name ||
getShortAddress(selectedAccount?.address)}
<ChevronDown className="ml-2 h-4 w-4" />
</Button>
</DropdownMenuTrigger>
Expand Down
3 changes: 1 addition & 2 deletions src/hooks/useGetSigningCallback.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { DispatchError } from '@polkadot-api/descriptors'
import { TxEvent } from 'polkadot-api'
import { toast } from 'sonner'

Expand Down Expand Up @@ -32,7 +31,7 @@ export const useGetSigningCallback =
onFinalized && onFinalized()
}
},
error: (error: DispatchError) => {
error: (error: Error) => {
console.error(error)
toast.error(error.toString())
onError && onError()
Expand Down
4 changes: 2 additions & 2 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ export type AccountInfoIF = {

export const acceptedJudgement = ['Reasonable', 'FeePaid', 'KnownGood']

export const getShortAddress = (address: string) =>
address.slice(0, 6) + '...' + address.slice(-6)
export const getShortAddress = (address?: string) =>
!address ? undefined : address.slice(0, 6) + '...' + address.slice(-6)

export const getTruncatedGenesisHash = (genesisHash: HexString) =>
genesisHash.slice(2, 34)
2 changes: 1 addition & 1 deletion src/walletConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const config = {
],
},
},
chainIds: [
optionalChainIds: [
// https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-13.md
'polkadot:91b171bb158e2d3848fa23a9f1c25182', // Polkadot
'polkadot:b0a8d493285c2df73290dfb7e61f870f', // Kusama
Expand Down
5 changes: 3 additions & 2 deletions tailwind.config.js → tailwind.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @type {import('tailwindcss').Config} */
module.exports = {

export default {
darkMode: ['class'],
content: [
'./pages/**/*.{ts,tsx}',
Expand Down Expand Up @@ -80,4 +81,4 @@ module.exports = {
},
},
plugins: [require('tailwindcss-animate')],
}
}
1 change: 1 addition & 0 deletions tsconfig.tsbuildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"root":["./src/App.tsx","./src/Content.tsx","./src/header.tsx","./src/main.tsx","./src/navigation.tsx","./src/redot.d.ts","./src/vite-env.d.ts","./src/walletConfigs.ts","./src/components/Alert.tsx","./src/components/DelegateCard.tsx","./src/components/DelegationByAmountConviction.tsx","./src/components/DelegationCard.tsx","./src/components/ErrorBoundary.tsx","./src/components/IdentityIcon.tsx","./src/components/LocksCard.tsx","./src/components/MyDelegations.tsx","./src/components/RedirectByName.tsx","./src/components/TrackDisplay.tsx","./src/components/TrackSelection.tsx","./src/components/theme-provider.tsx","./src/components/ui/address-display.tsx","./src/components/ui/alert.tsx","./src/components/ui/anchorLink.tsx","./src/components/ui/badge.tsx","./src/components/ui/button.tsx","./src/components/ui/card.tsx","./src/components/ui/content-reveal.tsx","./src/components/ui/dialog.tsx","./src/components/ui/dropdown-menu.tsx","./src/components/ui/input.tsx","./src/components/ui/label.tsx","./src/components/ui/md.tsx","./src/components/ui/menubar.tsx","./src/components/ui/popover.tsx","./src/components/ui/select.tsx","./src/components/ui/sheet.tsx","./src/components/ui/skeleton.tsx","./src/components/ui/slider.tsx","./src/components/ui/sonner.tsx","./src/components/ui/table.tsx","./src/components/ui/textarea.tsx","./src/components/ui/title.tsx","./src/components/ui/toggle-group.tsx","./src/components/ui/toggle.tsx","./src/components/ui/tooltip.tsx","./src/contexts/AccountsContext.tsx","./src/contexts/DelegatesContext.tsx","./src/contexts/LocksContext.tsx","./src/contexts/NetworkContext.tsx","./src/hooks/useGetDelegateTx.tsx","./src/hooks/useGetSigningCallback.tsx","./src/hooks/useGetSubsquareRefUrl.tsx","./src/hooks/useGetUnlockTx.tsx","./src/hooks/useIdentity.tsx","./src/hooks/useTestTx.tsx","./src/lib/bnMin.ts","./src/lib/constants.tsx","./src/lib/convertMiliseconds.ts","./src/lib/types.ts","./src/lib/utils.ts","./src/pages/Delegate/MultiTransactionDialog.tsx","./src/pages/Delegate/TooLargeDialog.tsx","./src/pages/Delegate/index.tsx","./src/pages/Home/index.tsx"],"version":"5.7.2"}

0 comments on commit 19b3240

Please sign in to comment.