Skip to content

Commit 376532f

Browse files
committed
remove trade section from darwin builds
1 parent 617ca9a commit 376532f

4 files changed

Lines changed: 28 additions & 3 deletions

File tree

appos/os.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package appos
55
type AppOS struct {
66
isAndroid bool
77
isIOS bool
8+
isDarwin bool
89
}
910

1011
// Default AppOS value. Updated in OS-specific files for each OS.
@@ -26,3 +27,7 @@ func (os *AppOS) IsIOS() bool {
2627
func (os *AppOS) IsMobile() bool {
2728
return os.isAndroid || os.isIOS
2829
}
30+
31+
func (os *AppOS) IsDarwin() bool {
32+
return os.isDarwin
33+
}

appos/os_darwin.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//go:build darwin
2+
// +build darwin
3+
4+
package appos
5+
6+
func init() {
7+
appCurrentOS.isDarwin = true
8+
}

ui/page/root/home_page.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,20 @@ func (hp *HomePage) initPageItems() {
123123
values.String(values.StrOverview),
124124
values.String(values.StrTransactions),
125125
values.String(values.StrWallets),
126-
values.String(values.StrTrade),
127126
values.String(values.StrGovernance),
128127
}
128+
129+
// Add trade tab only if not on macOS
130+
if !appos.Current().IsDarwin() {
131+
// Determine the insertion point, which is second to last position
132+
insertionPoint := len(navigationTabTitles) - 1
133+
if insertionPoint < 0 {
134+
insertionPoint = 0
135+
}
136+
// Append at the second to last position
137+
navigationTabTitles = append(navigationTabTitles[:insertionPoint], append([]string{values.String(values.StrTrade)}, navigationTabTitles[insertionPoint:]...)...)
138+
}
139+
129140
hp.navigationTab = hp.Theme.Tab(layout.Horizontal, false, navigationTabTitles)
130141

131142
hp.sendReceiveNavItems = []components.NavBarItem{
@@ -706,7 +717,7 @@ func (hp *HomePage) initBottomNavItems() {
706717
},
707718
}
708719

709-
// Add the trade tab only if not on mobile
720+
// Add the trade tab only if not on iOS
710721
if !appos.Current().IsIOS() {
711722
tradeTab := components.BottomNavigationBarHandler{
712723
Clickable: hp.Theme.NewClickable(true),

ui/page/root/overview_page.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,8 @@ func (pg *OverviewPage) layoutMobile(gtx C) D {
356356
pg.recentProposal,
357357
}
358358

359-
if !appos.Current().IsIOS() {
359+
// Do not show recent trades on iOS and macOS
360+
if !appos.Current().IsIOS() || !appos.Current().IsDarwin() {
360361
// Determine the insertion point, which is second to last position
361362
insertionPoint := len(pageContent) - 1
362363
if insertionPoint < 0 {

0 commit comments

Comments
 (0)