Skip to content

Commit

Permalink
Change modals Login, Set App password to page
Browse files Browse the repository at this point in the history
- Remove Confirm Register Modal
- Change Create Wallet modal to page
  • Loading branch information
song50119 committed Nov 22, 2021
1 parent 1dfc9fd commit 9c649cc
Show file tree
Hide file tree
Showing 13 changed files with 623 additions and 743 deletions.
12 changes: 12 additions & 0 deletions ui/modal/password_modal.go
Expand Up @@ -23,6 +23,7 @@ type PasswordModal struct {
password decredmaterial.Editor

dialogTitle string
description string

isLoading bool
isCancelable bool
Expand Down Expand Up @@ -87,6 +88,11 @@ func (pm *PasswordModal) Title(title string) *PasswordModal {
return pm
}

func (pm *PasswordModal) Description(description string) *PasswordModal {
pm.description = description
return pm
}

func (pm *PasswordModal) Hint(hint string) *PasswordModal {
pm.password.Hint = hint
return pm
Expand Down Expand Up @@ -167,6 +173,11 @@ func (pm *PasswordModal) Layout(gtx layout.Context) D {
return t.Layout(gtx)
}

description := func(gtx C) D {
t := pm.Theme.Body2(pm.description)
return t.Layout(gtx)
}

editor := func(gtx C) D {
return pm.password.Layout(gtx)
}
Expand Down Expand Up @@ -200,6 +211,7 @@ func (pm *PasswordModal) Layout(gtx layout.Context) D {
var w []layout.Widget

w = append(w, title)
w = append(w, description)
w = append(w, editor)
w = append(w, actionButtons)

Expand Down
25 changes: 25 additions & 0 deletions ui/page/components/dex.go
@@ -0,0 +1,25 @@
package components

import (
"strings"

"github.com/planetdecred/godcr/ui/decredmaterial"
"github.com/planetdecred/godcr/ui/load"
)

// CoinImageBySymbol returns image widget for supported asset coins.
func CoinImageBySymbol(icons *load.Icons, coinName string) *decredmaterial.Image {
m := map[string]*decredmaterial.Image{
"btc": icons.BTC,
"dcr": icons.DCR,
"bch": icons.BCH,
"ltc": icons.LTC,
}
coin, ok := m[strings.ToLower(coinName)]

if !ok {
return nil
}

return coin
}
172 changes: 0 additions & 172 deletions ui/page/dexclient/add_dex_modal.go

This file was deleted.

0 comments on commit 9c649cc

Please sign in to comment.