From 03e9372923dfe12c253316e90b71b1ce9eaf6ba6 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Tue, 8 Apr 2025 16:36:23 +0200 Subject: Show new/enter play only on landing page --- pkg/ui/views/play.go | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'pkg') 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, ) -- cgit v1.2.3-18-g5258