Skip to content

Commit

Permalink
refactor ad improve UI changes
Browse files Browse the repository at this point in the history
Signed-off-by: Philemon Ukane <[email protected]>
  • Loading branch information
ukane-philemon committed Oct 27, 2023
1 parent 67aff86 commit f89d9a9
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 242 deletions.
3 changes: 1 addition & 2 deletions ui/cryptomaterial/dropdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,8 @@ func (d *DropDown) closedLayout(gtx C, iLeft int, iRight int) D {
if len(d.items) == 0 {
if d.extraDisplay != nil {
return d.extraDisplay(gtx)
} else {
return D{}
}
return D{}
}
return d.layoutOption(gtx, d.selectedIndex)
}))
Expand Down
19 changes: 4 additions & 15 deletions ui/page/dcrdex/dex_onboarding_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"image"
"image/color"
"strconv"
"time"

"gioui.org/font"
"gioui.org/layout"
Expand Down Expand Up @@ -112,8 +111,6 @@ type DEXOnboarding struct {
materialLoader material.LoaderStyle
showLoader bool
isLoading bool

redirected bool // TODO: Remove
}

func NewDEXOnboarding(l *load.Load) *DEXOnboarding {
Expand Down Expand Up @@ -742,7 +739,7 @@ func (pg *DEXOnboarding) stepWaitForBondConfirmation(gtx C) D {
layout.Flexed(0.33, func(gtx C) D {
return layout.Flex{Axis: layout.Vertical}.Layout(gtx,
layout.Rigid(func(gtx C) D {
return layout.Inset{Bottom: 5}.Layout(gtx, func(gtx layout.Context) layout.Dimensions {
return layout.Inset{Bottom: 5}.Layout(gtx, func(gtx C) D {
return semiBoldLabelGrey3(pg.Theme, gtx, values.String(values.StrNewTier))
})
}),
Expand All @@ -754,7 +751,7 @@ func (pg *DEXOnboarding) stepWaitForBondConfirmation(gtx C) D {
layout.Flexed(0.33, func(gtx C) D {
return layout.Flex{Axis: layout.Vertical}.Layout(gtx,
layout.Rigid(func(gtx C) D {
return layout.Inset{Bottom: 5}.Layout(gtx, func(gtx layout.Context) layout.Dimensions {
return layout.Inset{Bottom: 5}.Layout(gtx, func(gtx C) D {
return semiBoldLabelGrey3(pg.Theme, gtx, values.String(values.StrBondStrength))
})
}),
Expand All @@ -766,7 +763,7 @@ func (pg *DEXOnboarding) stepWaitForBondConfirmation(gtx C) D {
layout.Flexed(0.33, func(gtx C) D {
return layout.Flex{Axis: layout.Vertical}.Layout(gtx,
layout.Rigid(func(gtx C) D {
return layout.Inset{Bottom: 5}.Layout(gtx, func(gtx layout.Context) layout.Dimensions {
return layout.Inset{Bottom: 5}.Layout(gtx, func(gtx C) D {
return semiBoldLabelGrey3(pg.Theme, gtx, values.String(values.StrTotalCost))
})
}),
Expand Down Expand Up @@ -935,19 +932,11 @@ func (pg *DEXOnboarding) HandleUserInteractions() {
hasEnough := pg.bondAccountHasEnough()
bondStrengthOk := pg.validateBondStrength()
if !hasEnough || !bondStrengthOk {
// return
return
}

// TODO: Post bond, wait for confirmations and redirect to market page.
pg.currentStep = onBoardingStepWaitForConfirmation
if !pg.redirected {
pg.redirected = true
log.Info("Redirecting to market page...")
time.AfterFunc(5*time.Second, func() {
pg.ParentNavigator().ClearStackAndDisplay(NewDEXMarketPage(pg.Load))
})
}

// Scroll to the top of the confirmation page after leaving the long
// post bond form.
pg.scrollContainer.Position.Offset = 0
Expand Down
Loading

0 comments on commit f89d9a9

Please sign in to comment.