/
cex_splash_page.go
70 lines (66 loc) · 2.84 KB
/
cex_splash_page.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package exchange
import (
"gioui.org/font"
"gioui.org/layout"
"gioui.org/text"
"github.com/crypto-power/cryptopower/ui/cryptomaterial"
"github.com/crypto-power/cryptopower/ui/modal"
"github.com/crypto-power/cryptopower/ui/values"
)
func (pg *CreateOrderPage) splashPage(gtx C) D {
return cryptomaterial.LinearLayout{
Orientation: layout.Vertical,
Width: cryptomaterial.MatchParent,
Height: cryptomaterial.WrapContent,
Background: pg.Theme.Color.Surface,
Direction: layout.Center,
Alignment: layout.Middle,
Border: cryptomaterial.Border{Radius: cryptomaterial.Radius(14)},
Padding: layout.Inset{Top: values.MarginPadding30, Bottom: values.MarginPadding30, Right: values.MarginPadding24, Left: values.MarginPadding24},
}.Layout(gtx,
layout.Rigid(func(gtx C) D {
return layout.Inset{Bottom: values.MarginPadding30}.Layout(gtx, func(gtx C) D {
return layout.Stack{Alignment: layout.NE}.Layout(gtx,
layout.Expanded(func(gtx C) D {
textSize16 := values.TextSizeTransform(pg.IsMobileView(), values.TextSize16)
return layout.Flex{Axis: layout.Vertical, Alignment: layout.Middle}.Layout(gtx,
layout.Rigid(func(gtx C) D {
return layout.Inset{Top: values.MarginPadding20}.Layout(gtx, func(gtx C) D {
size := values.MarginPaddingTransform(pg.IsMobileView(), values.MarginPadding100)
return pg.Theme.Icons.TradeExchangeIcon.LayoutSize(gtx, size)
})
}),
layout.Rigid(func(gtx C) D {
pgTitle := pg.Theme.Label(values.TextSizeTransform(pg.IsMobileView(), values.TextSize24), values.String(values.StrWhatIsCex))
pgTitle.Font.Weight = font.SemiBold
return layout.Inset{Top: values.MarginPadding26, Bottom: values.MarginPadding12}.Layout(gtx, pgTitle.Layout)
}),
layout.Rigid(func(gtx C) D {
pgContent := pg.Theme.Label(textSize16, values.String(values.StrCexContent))
pgContent.Alignment = text.Middle
return layout.Inset{Top: values.MarginPadding10}.Layout(gtx, pgContent.Layout)
}),
layout.Rigid(func(gtx C) D {
pgQuestion := pg.Theme.Label(textSize16, values.String(values.StrWouldTradeCex))
return layout.Inset{Top: values.MarginPadding20}.Layout(gtx, pgQuestion.Layout)
}),
)
}),
layout.Stacked(pg.splashPageInfoButton.Layout),
)
})
}),
layout.Rigid(func(gtx C) D {
return layout.Inset{Right: values.MarginPadding15, Left: values.MarginPadding15}.Layout(gtx, func(gtx C) D {
return layout.Flex{}.Layout(gtx, layout.Flexed(1, pg.startTradingBtn.Layout))
})
}),
)
}
func (pg *CreateOrderPage) showInfoModal() {
info := modal.NewCustomModal(pg.Load).
Title(values.String(values.StrCentralizedExchangeCex)).
Body(values.String(values.StrTradeSettingsMsg)).
SetPositiveButtonText(values.String(values.StrGotIt))
pg.ParentWindow().ShowModal(info)
}