summaryrefslogtreecommitdiff
path: root/internal/client/ui/core
diff options
context:
space:
mode:
Diffstat (limited to 'internal/client/ui/core')
-rw-r--r--internal/client/ui/core/core.go11
-rw-r--r--internal/client/ui/core/helppopup.go6
-rw-r--r--internal/client/ui/core/usersettings/usersettings.go33
3 files changed, 42 insertions, 8 deletions
diff --git a/internal/client/ui/core/core.go b/internal/client/ui/core/core.go
index 34a75f5..37ce613 100644
--- a/internal/client/ui/core/core.go
+++ b/internal/client/ui/core/core.go
@@ -375,7 +375,8 @@ func (m *Model) updateConnected(message tea.Msg) tea.Cmd {
message = ui.EmptyMsg{}
}
case FocusLeftSidebar:
- if !m.HasPopup() && m.networkList.Index() != networklist.SignalsIndex {
+ IsFrequenciesSidebar := m.networkList.Index() != networklist.SignalsIndex
+ if !m.HasPopup() && IsFrequenciesSidebar {
networkId := state.NetworkId(m.networkList.Index())
if networkId == nil {
return nil
@@ -397,7 +398,8 @@ func (m *Model) updateConnected(message tea.Msg) tea.Cmd {
m.networkJoinPopup = &popup
message = ui.EmptyMsg{}
}
- if m.focus == FocusLeftSidebar && m.networkList.Index() == networklist.SignalsIndex {
+ IsSignalsSidebar := m.networkList.Index() == networklist.SignalsIndex
+ if m.focus == FocusLeftSidebar && IsSignalsSidebar {
popup := signaladd.New()
m.signalAddPopup = &popup
message = ui.EmptyMsg{}
@@ -406,8 +408,9 @@ func (m *Model) updateConnected(message tea.Msg) tea.Cmd {
case "i":
index := m.networkList.Index()
- networkFocus := m.focus == FocusNetworkList
- if !m.HasPopup() && networkFocus && index != networklist.SignalsIndex {
+ isNetworkListFocused := m.focus == FocusNetworkList
+ isFrequenciesSidebar := index != networklist.SignalsIndex
+ if !m.HasPopup() && isNetworkListFocused && isFrequenciesSidebar {
networkId := state.NetworkId(index)
if networkId != nil {
_ = clipboard.WriteAll(networkId.String())
diff --git a/internal/client/ui/core/helppopup.go b/internal/client/ui/core/helppopup.go
index ac411ee..2fbb830 100644
--- a/internal/client/ui/core/helppopup.go
+++ b/internal/client/ui/core/helppopup.go
@@ -173,9 +173,9 @@ func (m HelpPopup) Title() string {
func (m HelpPopup) HelpGlobal() [][]Keymap {
return [][]Keymap{{
{"ctrl+c", "Exit eko"},
- {"H", "Move focus to the right"},
- {"L", "Move focus to the left"},
- {"u", "Edit your user profile"},
+ {"H", "Move focus to the left"},
+ {"L", "Move focus to the right"},
+ {"s", "User profile settings"},
{"?", "Show a help popup"},
}, {
{"esc", "Close popup"},
diff --git a/internal/client/ui/core/usersettings/usersettings.go b/internal/client/ui/core/usersettings/usersettings.go
index 92e0a1c..9afafe3 100644
--- a/internal/client/ui/core/usersettings/usersettings.go
+++ b/internal/client/ui/core/usersettings/usersettings.go
@@ -6,6 +6,7 @@ import (
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
+ "github.com/kyren223/eko/internal/client/config"
"github.com/kyren223/eko/internal/client/gateway"
"github.com/kyren223/eko/internal/client/ui/colors"
"github.com/kyren223/eko/internal/client/ui/core/state"
@@ -28,6 +29,11 @@ var (
Background(colors.Blue).Foreground(colors.White).
Render("Update User Settings")
}
+
+ highlightedStyle = func() lipgloss.Style {
+ return lipgloss.NewStyle().Padding(0, 0).
+ Background(colors.BackgroundHighlight).Foreground(colors.White)
+ }
)
const (
@@ -136,7 +142,32 @@ func (m Model) View() string {
Align(lipgloss.Center).
Render(m.update)
- content := flex.NewVertical(name, description, private, update).WithGap(1).View()
+ configFile := "Config File: " + highlightedStyle().Render(config.ConfigFile)
+ configFile = lipgloss.NewStyle().
+ Width(m.nameWidth).
+ Render(configFile)
+
+ option := highlightedStyle().Render("\"anonymous_device_analytics\": false")
+ analyticsOptOut := "Anonymous device analytics can be disabled by setting " + option + " in your config file"
+ analyticsOptOut = lipgloss.NewStyle().
+ Width(m.nameWidth).
+ Render(analyticsOptOut)
+
+ legalNote := "Official instance Terms of Service & Privacy Policy: " + highlightedStyle().Render("https://kyren.codes/eko/legal")
+ legalNote = lipgloss.NewStyle().
+ Width(m.nameWidth).
+ Render(legalNote)
+
+ // content := flex.NewVertical(
+ // name, description, private,
+ // configFile, analyticsOptOut, legalNote,
+ // update,
+ // ).WithGap(1).View()
+
+ content := flex.NewVertical(
+ legalNote, analyticsOptOut,
+ configFile, name, description, private, update,
+ ).WithGap(1).View()
return lipgloss.NewStyle().
Border(lipgloss.ThickBorder()).