Skip to content

Commit

Permalink
refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeBoy committed Jan 22, 2024
1 parent 0fb6a9a commit 3a54085
Show file tree
Hide file tree
Showing 26 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion ui/page/accounts/btc_account_details_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func NewBTCAcctDetailsPage(l *load.Load, wallet sharedW.Asset, account *sharedW.
isHiddenExtendedxPubkey: true,
}

pg.backButton = components.GetBackButtons(l)
pg.backButton = components.GetBackButton(l)

return pg
}
Expand Down
2 changes: 1 addition & 1 deletion ui/page/accounts/dcr_account_details_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func NewDCRAcctDetailsPage(l *load.Load, wallet sharedW.Asset, account *sharedW.
isHiddenExtendedxPubkey: true,
}

pg.backButton = components.GetBackButtons(l)
pg.backButton = components.GetBackButton(l)

return pg
}
Expand Down
2 changes: 1 addition & 1 deletion ui/page/accounts/ltc_account_details_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func NewLTCAcctDetailsPage(l *load.Load, wallet sharedW.Asset, account *sharedW.
isHiddenExtendedxPubkey: true,
}

pg.backButton = components.GetBackButtons(l)
pg.backButton = components.GetBackButton(l)

return pg
}
Expand Down
2 changes: 1 addition & 1 deletion ui/page/components/restore_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func NewRestorePage(l *load.Load, walletName string, walletType libutils.AssetTy
tabs: l.Theme.SegmentedControl(tabTitles, cryptomaterial.SegmentTypeGroup),
}

pg.backButton = GetBackButtons(l)
pg.backButton = GetBackButton(l)
pg.backButton.Icon = pg.Theme.Icons.ContentClear
textSize16 := values.TextSizeTransform(l.IsMobileView(), values.TextSize16)

Expand Down
2 changes: 1 addition & 1 deletion ui/page/components/sub_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func SubpageHeaderButtons(l *load.Load) (cryptomaterial.IconButton, cryptomateri
return backButton, infoButton
}

func GetBackButtons(l *load.Load) cryptomaterial.IconButton {
func GetBackButton(l *load.Load) cryptomaterial.IconButton {
backClickable := new(widget.Clickable)
backButton := l.Theme.NewIconButton(l.Theme.Icons.NavigationArrowBack, backClickable)
size := values.MarginPadding24
Expand Down
2 changes: 1 addition & 1 deletion ui/page/components/wallet_setup_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func NewCreateWallet(l *load.Load, walletCreationSuccessCallback func(), assetTy

pg.materialLoader = material.Loader(l.Theme.Base)

pg.backButton = GetBackButtons(l)
pg.backButton = GetBackButton(l)

return pg
}
Expand Down
2 changes: 1 addition & 1 deletion ui/page/exchange/order_details_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func NewOrderDetailsPage(l *load.Load, order *instantswap.Order) *OrderDetailsPa
}
pg.exchange = exchange

pg.backButton = components.GetBackButtons(l)
pg.backButton = components.GetBackButton(l)

pg.createOrderBtn = pg.Theme.Button(values.String(values.StrCreateNewOrder))
pg.refreshBtn = pg.Theme.Button(values.String(values.StrRefresh))
Expand Down
2 changes: 1 addition & 1 deletion ui/page/exchange/order_history_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func NewOrderHistoryPage(l *load.Load) *OrderHistoryPage {
refreshIcon: l.Theme.Icons.Restore,
}

pg.backButton = components.GetBackButtons(l)
pg.backButton = components.GetBackButton(l)
// pageSize defines the number of orders that can be fetched at ago.
pageSize := int32(10)
pg.scroll = components.NewScroll(l, pageSize, pg.fetchOrders)
Expand Down
2 changes: 1 addition & 1 deletion ui/page/governance/proposal_details_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func NewProposalDetailsPage(l *load.Load, proposal *libwallet.Proposal) *Proposa
voteBar: components.NewVoteBar(l),
}

pg.backButton = components.GetBackButtons(l)
pg.backButton = components.GetBackButton(l)

pg.vote = l.Theme.Button(values.String(values.StrVote))
pg.vote.TextSize = l.ConvertTextSize(values.TextSize14)
Expand Down
2 changes: 1 addition & 1 deletion ui/page/privacy/manual_mixer_setup_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func NewManualMixerSetupPage(l *load.Load, dcrWallet *dcr.Asset) *ManualMixerSet
pg.unmixedAccountSelector.SelectFirstValidAccount(dcrWallet)

_, pg.infoButton = components.SubpageHeaderButtons(l)
pg.backButton = components.GetBackButtons(l)
pg.backButton = components.GetBackButton(l)

return pg
}
Expand Down
2 changes: 1 addition & 1 deletion ui/page/privacy/setup_mixer_accounts_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func NewSetupMixerAccountsPage(l *load.Load, dcrWallet *dcr.Asset) *SetupMixerAc
pg.autoSetupClickable = pg.Theme.NewClickable(true)
pg.manualSetupClickable = pg.Theme.NewClickable(true)
_, pg.infoButton = components.SubpageHeaderButtons(l)
pg.backButton = components.GetBackButtons(l)
pg.backButton = components.GetBackButton(l)
return pg
}

Expand Down
2 changes: 1 addition & 1 deletion ui/page/privacy/setup_privacy_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func NewSetupPrivacyPage(l *load.Load, wallet *dcr.Asset) *SetupPrivacyPage {
toPrivacySetup: l.Theme.Button(values.String(values.StrSetUpStakeShuffleIntroButton)),
}
_, pg.infoButton = components.SubpageHeaderButtons(l)
pg.backButton = components.GetBackButtons(l)
pg.backButton = components.GetBackButton(l)

return pg

Expand Down
2 changes: 1 addition & 1 deletion ui/page/security/sign_message_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func NewSignMessagePage(l *load.Load, wallet sharedW.Asset) *SignMessagePage {

pg.signedMessageLabel.Color = l.Theme.Color.GrayText2
_, pg.infoButton = components.SubpageHeaderButtons(l)
pg.backButton = components.GetBackButtons(l)
pg.backButton = components.GetBackButton(l)

return pg
}
Expand Down
2 changes: 1 addition & 1 deletion ui/page/security/validate_address.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewValidateAddressPage(l *load.Load, wallet sharedW.Asset) *ValidateAddress
wallet: wallet,
}

pg.backButton = components.GetBackButtons(l)
pg.backButton = components.GetBackButton(l)

pg.addressEditor = l.Theme.Editor(new(widget.Editor), values.String(values.StrAddress))
pg.addressEditor.Editor.SingleLine = true
Expand Down
2 changes: 1 addition & 1 deletion ui/page/security/verify_message_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func NewVerifyMessagePage(l *load.Load, wallet sharedW.Asset) *VerifyMessagePage
pg.clearBtn.Font.Weight = font.Medium

_, pg.infoButton = components.SubpageHeaderButtons(l)
pg.backButton = components.GetBackButtons(l)
pg.backButton = components.GetBackButton(l)

return pg
}
Expand Down
2 changes: 1 addition & 1 deletion ui/page/seedbackup/backup_instructions.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func NewBackupInstructionsPage(l *load.Load, wallet sharedW.Asset, redirect Redi

bi.viewSeedBtn.Font.Weight = font.Medium

bi.backButton = components.GetBackButtons(l)
bi.backButton = components.GetBackButton(l)
bi.backButton.Icon = l.Theme.Icons.ContentClear

bi.checkBoxes = []cryptomaterial.CheckBoxStyle{
Expand Down
2 changes: 1 addition & 1 deletion ui/page/seedbackup/save_seed.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func NewSaveSeedPage(l *load.Load, wallet sharedW.Asset, redirect Redirectfunc)
pg.copy.Color = pg.Theme.Color.Primary
pg.copy.Inset = layout.UniformInset(values.MarginPadding16)

pg.backButton = components.GetBackButtons(l)
pg.backButton = components.GetBackButton(l)
pg.backButton.Icon = l.Theme.Icons.ContentClear

pg.actionButton.Font.Weight = font.Medium
Expand Down
2 changes: 1 addition & 1 deletion ui/page/seedbackup/verify_seed.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func NewVerifySeedPage(l *load.Load, wallet sharedW.Asset, seed string, redirect

pg.actionButton.Font.Weight = font.Medium

pg.backButton = components.GetBackButtons(l)
pg.backButton = components.GetBackButton(l)
pg.backButton.Icon = l.Theme.Icons.ContentClear

pg.seedInputEditor = l.Theme.Editor(new(widget.Editor), values.String(values.StrEnterWalletSeed))
Expand Down
2 changes: 1 addition & 1 deletion ui/page/settings/about_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func NewAboutPage(l *load.Load) *AboutPage {

pg.licenseRow.Radius = cryptomaterial.BottomRadius(14)

pg.backButton = components.GetBackButtons(l)
pg.backButton = components.GetBackButton(l)
col := pg.Theme.Color.GrayText2
pg.versionValue.Color = col
pg.buildDateValue.Color = col
Expand Down
2 changes: 1 addition & 1 deletion ui/page/settings/app_settings_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func NewAppSettingsPage(l *load.Load) *AppSettingsPage {

_, pg.networkInfoButton = components.SubpageHeaderButtons(l)
_, pg.infoButton = components.SubpageHeaderButtons(l)
pg.backButton = components.GetBackButtons(l)
pg.backButton = components.GetBackButton(l)
pg.isDarkModeOn = pg.AssetsManager.IsDarkModeOn()

return pg
Expand Down
2 changes: 1 addition & 1 deletion ui/page/settings/help_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func NewHelpPage(l *load.Load) *HelpPage {
pg.shadowBox.SetShadowRadius(14)

pg.documentation.Radius = cryptomaterial.Radius(14)
pg.backButton = components.GetBackButtons(l)
pg.backButton = components.GetBackButton(l)

axis := layout.Horizontal
if l.IsMobileView() {
Expand Down
2 changes: 1 addition & 1 deletion ui/page/settings/license_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewLicensePage(l *load.Load) *LicensePage {
List: layout.List{Axis: layout.Vertical},
},
}
pg.backButton = components.GetBackButtons(l)
pg.backButton = components.GetBackButton(l)

return pg
}
Expand Down
2 changes: 1 addition & 1 deletion ui/page/settings/log_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func NewLogPage(l *load.Load, logPath string, pageTitle string) *LogPage {
pg.logPath = logPath
pg.title = pageTitle

pg.backButton = components.GetBackButtons(l)
pg.backButton = components.GetBackButton(l)
pg.watchLogs()
return pg
}
Expand Down
2 changes: 1 addition & 1 deletion ui/page/settings/statistics_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func NewStatPage(l *load.Load, wallet sharedW.Asset) *StatPage {
},
}

pg.backButton = components.GetBackButtons(l)
pg.backButton = components.GetBackButton(l)

return pg
}
Expand Down
2 changes: 1 addition & 1 deletion ui/page/transaction/transaction_details_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func NewTransactionDetailsPage(l *load.Load, wallet sharedW.Asset, transaction *
rebroadcastIcon: l.Theme.Icons.Rebroadcast,
}

pg.backButton = components.GetBackButtons(pg.Load)
pg.backButton = components.GetBackButton(pg.Load)

pg.dot = cryptomaterial.NewIcon(l.Theme.Icons.DotIcon)
pg.dot.Color = l.Theme.Color.Gray1
Expand Down
2 changes: 1 addition & 1 deletion ui/page/wallet/wallet_settings_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func NewSettingsPage(l *load.Load, wallet sharedW.Asset, walletCallbackFunc func
}

_, pg.infoButton = components.SubpageHeaderButtons(l)
pg.backButton = components.GetBackButtons(l)
pg.backButton = components.GetBackButton(l)

return pg
}
Expand Down

0 comments on commit 3a54085

Please sign in to comment.