@@ -6,8 +6,47 @@ import (
6
6
"github.com/charmbracelet/lipgloss"
7
7
8
8
"github.com/dlvhdr/gh-dash/v4/data"
9
+ "github.com/dlvhdr/gh-dash/v4/utils"
9
10
)
10
11
12
+ func (m * Model ) renderChangesOverview () string {
13
+ changes := lipgloss .NewStyle ().
14
+ Border (lipgloss .NormalBorder (), false , false , true , false ).
15
+ BorderForeground (m .ctx .Theme .FaintBorder ).
16
+ Width (m .getIndentedContentWidth ()).
17
+ Padding (1 )
18
+
19
+ commits := lipgloss .NewStyle ().
20
+ Width (m .getIndentedContentWidth ()).
21
+ Padding (1 )
22
+
23
+ box := lipgloss .NewStyle ().
24
+ Border (lipgloss .RoundedBorder (), true ).
25
+ BorderForeground (m .ctx .Theme .FaintBorder ).
26
+ Width (m .getIndentedContentWidth ())
27
+
28
+ time := lipgloss .NewStyle ().Render (utils .TimeElapsed (m .pr .Data .UpdatedAt ))
29
+ return box .Render (
30
+ lipgloss .JoinVertical (lipgloss .Left ,
31
+ changes .Render (
32
+ lipgloss .JoinHorizontal (lipgloss .Top ,
33
+ lipgloss .NewStyle ().Foreground (m .ctx .Theme .FaintText ).Render ("ï“’ " ),
34
+ fmt .Sprintf ("%d files changed" , m .pr .Data .Files .TotalCount ),
35
+ " " ,
36
+ m .pr .RenderLines (false )),
37
+ ),
38
+ commits .Render (
39
+ lipgloss .JoinHorizontal (lipgloss .Top ,
40
+ lipgloss .NewStyle ().Foreground (m .ctx .Theme .FaintText ).Render (" " ),
41
+ fmt .Sprintf ("%d commits" , m .pr .Data .Files .TotalCount ),
42
+ " " ,
43
+ lipgloss .NewStyle ().Foreground (m .ctx .Theme .FaintText ).Render (fmt .Sprintf ("%s ago" , time )),
44
+ ),
45
+ ),
46
+ ),
47
+ )
48
+ }
49
+
11
50
func (m * Model ) renderChangedFiles () string {
12
51
files := make ([]string , 0 )
13
52
for _ , file := range m .pr .Data .Files .Nodes {
0 commit comments