Skip to content

Commit

Permalink
Merge pull request #105 from JunNishimura/#104
Browse files Browse the repository at this point in the history
fix error display bug
  • Loading branch information
JunNishimura authored Sep 2, 2023
2 parents 2fccbab + cb503a7 commit db542a7
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions ui/style/style.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,23 @@ func AsciiArt() lipgloss.Style {
Foreground(lipgloss.Color(HighlightColor))
}

const errorMessage = "unexpected error happens.\n\nplease report at\n\nhttps://github.com/JunNishimura/Chatify/issues"
const (
errorMessage = "unexpected error happens.\n\nplease report at\n\nhttps://github.com/JunNishimura/Chatify/issues"
errorDisplayWidth = 60
errorDisplayHeight = 10
)

func ErrorView(windowWidth, windowHeight int) string {
return lipgloss.Place(windowWidth, windowHeight, lipgloss.Center, lipgloss.Center,
lipgloss.NewStyle().
Width(60).
Height(10).
Width(errorDisplayWidth).
Height(errorDisplayHeight).
BorderStyle(lipgloss.ThickBorder()).
BorderForeground(lipgloss.Color(HighlightColor)).
Background(lipgloss.AdaptiveColor{Dark: BgColor, Light: BgColor}).
Render(lipgloss.Place(50, 10, lipgloss.Center, lipgloss.Center,
Render(lipgloss.Place(errorDisplayWidth, errorDisplayHeight, lipgloss.Center, lipgloss.Center,
lipgloss.NewStyle().
Width(50).
Width(errorDisplayWidth).
Align(lipgloss.Center).
Foreground(lipgloss.Color(Red)).
Background(lipgloss.Color(BgColor)).
Expand Down

0 comments on commit db542a7

Please sign in to comment.