summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2025-04-08 16:36:23 +0200
committerSanto Cariotti <santo@dcariotti.me>2025-04-08 16:36:23 +0200
commit03e9372923dfe12c253316e90b71b1ce9eaf6ba6 (patch)
treea7f3f9077734c29b40707c7f180a0ef0cf96c405 /pkg
parentd22c0c359ba33574fc517d1067b213f2e006549f (diff)
Show new/enter play only on landing page
Diffstat (limited to 'pkg')
-rw-r--r--pkg/ui/views/play.go29
1 files changed, 18 insertions, 11 deletions
diff --git a/pkg/ui/views/play.go b/pkg/ui/views/play.go
index f31c7c1..3b9448d 100644
--- a/pkg/ui/views/play.go
+++ b/pkg/ui/views/play.go
@@ -357,14 +357,6 @@ func (m PlayModel) buildWindowContent(content string, formWidth int) string {
}
func (m PlayModel) renderNavigationButtons() string {
- enterKey := fmt.Sprintf("%s %s",
- altCodeStyle.Render(m.keys.EnterNewGame.Help().Key),
- m.keys.EnterNewGame.Help().Desc)
-
- startKey := fmt.Sprintf("%s %s",
- altCodeStyle.Render(m.keys.StartNewGame.Help().Key),
- m.keys.StartNewGame.Help().Desc)
-
logoutKey := fmt.Sprintf("%s %s",
altCodeStyle.Render(m.keys.GoLogout.Help().Key),
m.keys.GoLogout.Help().Desc)
@@ -373,11 +365,26 @@ func (m PlayModel) renderNavigationButtons() string {
altCodeStyle.Render(m.keys.Quit.Help().Key),
m.keys.Quit.Help().Desc)
- // Vertically align the buttons
+ if m.page == LandingPage {
+ enterKey := fmt.Sprintf("%s %s",
+ altCodeStyle.Render(m.keys.EnterNewGame.Help().Key),
+ m.keys.EnterNewGame.Help().Desc)
+
+ startKey := fmt.Sprintf("%s %s",
+ altCodeStyle.Render(m.keys.StartNewGame.Help().Key),
+ m.keys.StartNewGame.Help().Desc)
+
+ return lipgloss.JoinVertical(
+ lipgloss.Left,
+ enterKey,
+ startKey,
+ logoutKey,
+ quitKey,
+ )
+ }
+
return lipgloss.JoinVertical(
lipgloss.Left,
- enterKey,
- startKey,
logoutKey,
quitKey,
)