File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed
Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 1515 COLOR_FOREGROUND = lipgloss.AdaptiveColor {Light : "#666666" , Dark : "#ffffff" }
1616 COLOR_GRAY = lipgloss.AdaptiveColor {Light : "#666666" , Dark : "#666666" }
1717 COLOR_WHITE = lipgloss.AdaptiveColor {Light : "#ffffff" , Dark : "#ffffff" }
18+ COLOR_LINK = lipgloss.AdaptiveColor {Light : "#6C9EF8" , Dark : "#6C9EF8" }
1819)
1920
2021const (
@@ -45,7 +46,7 @@ var ButtonStyle = lipgloss.NewStyle().
4546 Background (COLOR_GRAY ).
4647 Padding (0 , 2 )
4748
48- var ActiveButtonStyle = ButtonStyle .Copy ().
49+ var ActiveButtonStyle = ButtonStyle .
4950 Foreground (COLOR_FOREGROUND ).
5051 Background (COLOR_HIGHLIGHT ).
5152 Underline (true )
@@ -70,6 +71,11 @@ var FullscreenStyle = lipgloss.NewStyle().
7071 AlignVertical (lipgloss .Center ).
7172 Padding (1 )
7273
74+ var LinkStyle = lipgloss .NewStyle ().
75+ Bold (true ).
76+ Underline (true ).
77+ Foreground (COLOR_LINK )
78+
7379var Methods = map [string ]string {
7480 "GET" : MethodStyle .Background (lipgloss .Color (methodColors ["GET" ])).Render ("GET" ),
7581 "POST" : MethodStyle .Background (lipgloss .Color (methodColors ["POST" ])).Render ("POST" ),
Original file line number Diff line number Diff line change @@ -104,8 +104,9 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
104104}
105105
106106func (m Model ) View () string {
107- if m .call == nil || (m .call != nil && len (m .call .Headers ) == 0 ) {
108- return config .EmptyMessageStyle .Padding (2 , 2 ).Render ("No headers defined." )
107+ content := config .EmptyMessageStyle .Padding (2 , 2 ).Render ("No headers defined." )
108+ if m .call != nil && len (m .call .Headers ) > 0 {
109+ content = m .simpleTable .View ()
109110 }
110- return m . simpleTable . View ( )
111+ return content + " \n " + config . LinkStyle . Padding ( 0 , 1 ). Foreground ( config . COLOR_LINK ). Render ( "+ Add Header" )
111112}
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
8787
8888func (m Model ) View () string {
8989 if len (m .items ) == 0 {
90- return config .EmptyMessageStyle .Padding (2 , 2 ).Render ("No query params defined." )
90+ return config .EmptyMessageStyle .Padding (2 , 2 ).Render ("No query params defined. You can " + config . LinkStyle . Underline ( true ). Render ( "add param" ) )
9191 }
92- return m .simpleTable .View ()
92+ return m .simpleTable .View () + " \n " + config . LinkStyle . Padding ( 0 , 1 ). Render ( "+ Add Param" )
9393}
You can’t perform that action at this time.
0 commit comments