Skip to content

Commit

Permalink
improve onboarding pages implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Philemon Ukane <[email protected]>
  • Loading branch information
ukane-philemon committed Dec 6, 2023
1 parent 99fb7fb commit 9d3dffc
Show file tree
Hide file tree
Showing 6 changed files with 164 additions and 199 deletions.
6 changes: 3 additions & 3 deletions ui/page/root/home_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func (hp *HomePage) HandleUserInteractions() {
}
}
if !isSendAvailable {
hp.showWarningNoWallet()
hp.showWarningNoSpendableWallet()
return
}
hp.ParentWindow().ShowModal(send.NewSendPage(hp.Load, nil))
Expand Down Expand Up @@ -288,12 +288,12 @@ func (hp *HomePage) HandleUserInteractions() {
}
}

func (hp *HomePage) showWarningNoWallet() {
func (hp *HomePage) showWarningNoSpendableWallet() {
go func() {
info := modal.NewCustomModal(hp.Load).
PositiveButtonStyle(hp.Theme.Color.Primary, hp.Theme.Color.Surface).
SetContentAlignment(layout.W, layout.W, layout.Center).
Body(values.String(values.StrNoWalletsAvailable))
Body(values.String(values.StrCannotSpendWatchOnlyWallet))
hp.ParentWindow().ShowModal(info)
}()
}
Expand Down
8 changes: 4 additions & 4 deletions ui/page/settings/settings_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ func (pg *SettingPage) subSectionLabel(title string) layout.Widget {
func (pg *SettingPage) HandleUserInteractions() {
for pg.language.Clicked() {
langSelectorModal := preference.NewListPreference(pg.Load,
sharedW.LanguagePreferenceKey, values.DefaultLangauge, preference.LangOptions).
sharedW.LanguagePreferenceKey, values.DefaultLanguage, preference.LangOptions).
Title(values.StrLanguage).
UpdateValues(func(_ string) {
values.SetUserLanguage(pg.AssetsManager.GetLanguagePreference())
Expand Down Expand Up @@ -641,9 +641,9 @@ func (pg *SettingPage) updatePrivacySettings() {
// Part of the load.Page interface.
func (pg *SettingPage) OnNavigatedFrom() {}

func (pg *SettingPage) setInitialSwitchStatus(switchComponent *cryptomaterial.Switch, ischecked bool) {
func (pg *SettingPage) setInitialSwitchStatus(switchComponent *cryptomaterial.Switch, isChecked bool) {
switchComponent.SetChecked(false)
if ischecked {
switchComponent.SetChecked(ischecked)
if isChecked {
switchComponent.SetChecked(isChecked)
}
}
Loading

0 comments on commit 9d3dffc

Please sign in to comment.