Skip to content

Commit

Permalink
update layout for list wallets to fix can't scroll down
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeBoy committed Jul 11, 2024
1 parent 3061855 commit 72a9998
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
11 changes: 4 additions & 7 deletions ui/page/root/wallet_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,25 +112,22 @@ func (pg *WalletSelectorPage) syncStatusIconAndText(wallet sharedW.Asset) (*cryp
}

func (pg *WalletSelectorPage) walletListLayout(gtx C, assetType libutils.AssetType) D {
walletSections := []func(gtx C) D{}
flexChilds := make([]layout.FlexChild, 0)
if len(pg.walletsList[assetType]) > 0 {
walletSection := func(gtx C) D {
return pg.walletSection(gtx, pg.walletsList[assetType])
}
walletSections = append(walletSections, walletSection)
flexChilds = append(flexChilds, layout.Rigid(walletSection))
}

if len(pg.badWalletsList[assetType]) > 0 {
badWalletSection := func(gtx C) D {
return pg.badWalletSection(gtx, pg.badWalletsList[assetType])
}
walletSections = append(walletSections, badWalletSection)
flexChilds = append(flexChilds, layout.Rigid(badWalletSection))
}

list := &layout.List{Axis: layout.Vertical}
return list.Layout(gtx, len(walletSections), func(gtx C, i int) D {
return walletSections[i](gtx)
})
return layout.Flex{Axis: layout.Vertical}.Layout(gtx, flexChilds...)
}

func (pg *WalletSelectorPage) walletSection(gtx C, mainWalletList []*walletWithBalance) D {
Expand Down
8 changes: 2 additions & 6 deletions ui/page/root/wallet_selector_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,6 @@ func (pg *WalletSelectorPage) pageContentLayout(gtx C) D {
})
}

pageContent := []func(gtx C) D{
assetDropdown,
}

return cryptomaterial.LinearLayout{
Width: cryptomaterial.MatchParent,
Height: cryptomaterial.MatchParent,
Expand All @@ -272,8 +268,8 @@ func (pg *WalletSelectorPage) pageContentLayout(gtx C) D {
Height: cryptomaterial.MatchParent,
Padding: components.HorizontalInset(values.MarginPaddingTransform(pg.IsMobileView(), values.MarginPadding16)),
}.Layout2(gtx, func(gtx C) D {
return pg.Theme.List(pg.scrollContainer).Layout(gtx, len(pageContent), func(gtx C, i int) D {
return pageContent[i](gtx)
return pg.Theme.List(pg.scrollContainer).Layout(gtx, 1, func(gtx C, i int) D {

Check failure on line 271 in ui/page/root/wallet_selector_page.go

View workflow job for this annotation

GitHub Actions / Build

unused-parameter: parameter 'i' seems to be unused, consider removing or renaming it as _ (revive)

Check warning on line 271 in ui/page/root/wallet_selector_page.go

View workflow job for this annotation

GitHub Actions / Build

unused-parameter: parameter 'i' seems to be unused, consider removing or renaming it as _ (revive)
return assetDropdown(gtx)
})
})
})
Expand Down

0 comments on commit 72a9998

Please sign in to comment.