Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: utxo list #430

Merged
29 commits merged into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a1ed3e4
feat: add tabbed control to jar overlay
Jul 22, 2022
2c36351
feat: add utxo table
Jul 25, 2022
6a9c71d
refactor: clean up overlay container
Jul 27, 2022
15a7066
refactor: clean up table
Jul 27, 2022
a8c51d4
feat: add alert
Jul 27, 2022
4c86d8a
refactr: re-add utxo modal
Jul 27, 2022
f495c6f
refactor: add back old account details view
Jul 27, 2022
2ccc619
refactor: delete old files
Jul 27, 2022
22f944a
Merge branch 'master' into utxo-list
Jul 28, 2022
a88488d
fix: tests
Jul 28, 2022
5f13019
feat: add confirmations and refresh button
Jul 28, 2022
f07cb6e
fix: class name
Jul 28, 2022
c54035f
fix: paddings
Jul 28, 2022
b4e8cfa
fix: acccordion shadow
Jul 28, 2022
59c4883
fix: bs colors
Jul 28, 2022
c7b9396
fix: remove utxo conversion where not needed
Jul 28, 2022
001f124
feat: i18n
Jul 28, 2022
bd171fd
fix: button active color
Jul 28, 2022
d5a2507
Update src/components/jar_details/JarDetailsOverlay.tsx
Aug 2, 2022
40acbf1
fix: use lockgime from property instead of status
Aug 2, 2022
d28cd07
fix: disable freezing and unfreezing when service is running
Aug 2, 2022
43d6c52
fix: do not allow locked utxos to be unfrozen
Aug 2, 2022
1182259
fix: make sure tab and content are in sync
Aug 2, 2022
b271347
feat: add sorting by confirmations
Aug 2, 2022
9afa59d
feat: add reset position to sort toggle
Aug 2, 2022
5a0017b
Merge branch 'master' into utxo-list
Aug 2, 2022
4d470b3
fix: switch cancel button placement
Aug 2, 2022
587d688
fix: right-align value column
Aug 2, 2022
fbd083d
Update src/components/jar_details/UtxoList.tsx
Aug 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
381 changes: 367 additions & 14 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
},
"homepage": ".",
"devDependencies": {
"@emotion/react": "^11.9.3",
"@popperjs/core": "^2.11.5",
"@table-library/react-table-library": "^4.0.10",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^12.1.4",
"@testing-library/user-event": "^13.5.0",
Expand Down Expand Up @@ -97,6 +99,9 @@
"Math",
"localStorage"
],
"clearMocks": true
"clearMocks": true,
"transformIgnorePatterns": [
"node_modules/(?!@table-library)"
]
}
}
22 changes: 18 additions & 4 deletions src/components/CurrentWalletMagic.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { walletDisplayName } from '../utils'
import styles from './CurrentWalletMagic.module.css'
import { ExtendedLink } from './ExtendedLink'
import { routes } from '../constants/routes'
import { DisplayAccountsOverlay } from './DisplayAccountsOverlay'
import { JarDetailsOverlay } from './jar_details/JarDetailsOverlay'
import { Jars } from './Jars'

const WalletHeader = ({ name, balance, unit, showBalance, loading }) => {
Expand Down Expand Up @@ -59,6 +59,17 @@ export default function CurrentWalletMagic() {
() => currentWalletInfo && currentWalletInfo.data.display.walletinfo.accounts,
[currentWalletInfo]
)

const utxosByAccount = useMemo(() => {
const utxos = (currentWalletInfo && currentWalletInfo.data.utxos.utxos) || []
return utxos.reduce((res, utxo) => {
const { mixdepth } = utxo
res[mixdepth] = res[mixdepth] || []
res[mixdepth].push(utxo)
return res
}, {})
}, [currentWalletInfo])

const [selectedAccountIndex, setSelectedAccountIndex] = useState(0)
const [isAccountOverlayShown, setIsAccountOverlayShown] = useState(false)

Expand Down Expand Up @@ -103,10 +114,13 @@ export default function CurrentWalletMagic() {
)}

{accounts && (
<DisplayAccountsOverlay
<JarDetailsOverlay
accounts={accounts}
selectedAccountIndex={selectedAccountIndex}
show={isAccountOverlayShown}
initialAccountIndex={selectedAccountIndex}
utxosByAccount={utxosByAccount}
walletInfo={currentWalletInfo}
wallet={currentWallet}
isShown={isAccountOverlayShown}
onHide={() => setIsAccountOverlayShown(false)}
/>
)}
Expand Down
44 changes: 0 additions & 44 deletions src/components/DisplayAccountsOverlay.module.css

This file was deleted.

112 changes: 0 additions & 112 deletions src/components/DisplayAccountsOverlay.tsx

This file was deleted.

7 changes: 7 additions & 0 deletions src/components/SegmentedTabs.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
width: 100%;
}

.segmented-tab > label {
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
}

:root[data-theme='dark'] .segmented-tabs {
color: var(--bs-gray-100);
background-color: var(--bs-gray-800);
Expand Down
Loading