Skip to content

Commit

Permalink
Substitute hard coded strings
Browse files Browse the repository at this point in the history
  • Loading branch information
crux25 committed Oct 9, 2023
1 parent 5a378c5 commit bace5f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ui/page/root/overview_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -789,11 +789,11 @@ func (pg *OverviewPage) txStakingSection(gtx C) D {
layout.Flexed(.5, func(gtx C) D {
return layout.Inset{Right: values.MarginPadding10}.Layout(gtx, func(gtx C) D {

return pg.pageContentWrapper(gtx, "Recent Transactions", func(gtx C) D {
return pg.pageContentWrapper(gtx, values.String(values.StrRecentTransactions), func(gtx C) D {
if len(pg.transactions) == 0 {
return pg.centerLayout(gtx, values.MarginPadding10, values.MarginPadding10, func(gtx C) D {
gtx.Constraints.Min.X = gtx.Constraints.Max.X
return pg.Theme.Body1("No recent transaction").Layout(gtx)
return pg.Theme.Body1(values.String(values.StrNoTransactions)).Layout(gtx)
})
}

Expand Down Expand Up @@ -826,12 +826,12 @@ func (pg *OverviewPage) txStakingSection(gtx C) D {
})
}),
layout.Flexed(.5, func(gtx C) D {
return pg.pageContentWrapper(gtx, "Staking Activity", func(gtx C) D {
return pg.pageContentWrapper(gtx, values.String(values.StrStakingActivity), func(gtx C) D {
if len(pg.stakes) == 0 {
return pg.centerLayout(gtx, values.MarginPadding10, values.MarginPadding10, func(gtx C) D {
gtx.Constraints.Min.X = gtx.Constraints.Max.X

return pg.Theme.Body1("No recent Staking Activity").Layout(gtx)
return pg.Theme.Body1(values.String(values.StrNoStaking)).Layout(gtx)
})
}

Expand Down
1 change: 1 addition & 0 deletions ui/values/localizable/en.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ const EN = `
"noPoliciesYet" = "No policies yet"
"noProposal" = "No proposals %v"
"noReward" = "Stakey sees no rewards"
"noStaking" = "No recent Staking Activity"
"notAllowed" = "%s API not allowed by current network settings."
"notApplicable" = "N/A"
"notAvailable" = "Not available"
Expand Down
1 change: 1 addition & 0 deletions ui/values/strings.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ const (
StrNoPoliciesYet = "noPoliciesYet"
StrNoProposals = "noProposal"
StrNoReward = "noReward"
StrNoStaking = "noStaking"
StrNotAllowed = "notAllowed"
StrNotApplicable = "notApplicable"
StrNotAvailable = "notAvailable"
Expand Down

0 comments on commit bace5f8

Please sign in to comment.