refine navigation and loading enteries
This commit is contained in:
parent
99548e67b7
commit
8414414f98
10 changed files with 148 additions and 41 deletions
12
main.go
12
main.go
|
|
@ -14,7 +14,7 @@ type Page string
|
|||
const (
|
||||
ActionList Page = "actionList"
|
||||
EntryList Page = "entryList"
|
||||
// Entry Page = "entry"
|
||||
Entry Page = "entry"
|
||||
)
|
||||
|
||||
type SwitchPages struct{ Page Page }
|
||||
|
|
@ -40,12 +40,10 @@ type model struct {
|
|||
func initialModel(config *gemlog.Config) model {
|
||||
return model{
|
||||
ui: uiState{
|
||||
page: ActionList,
|
||||
// entryListPage: entryListPageModel{
|
||||
// cursor: 0,
|
||||
// entries: []gemlog.GemlogListEntry{},
|
||||
// },
|
||||
page: ActionList,
|
||||
actionListPage: initialActionListPageModel(),
|
||||
entryListPage: initialEntryListPageModel(),
|
||||
// entryPage: initialEntryPageModel(),
|
||||
},
|
||||
context: &context{
|
||||
config: config,
|
||||
|
|
@ -80,7 +78,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||
m.ui.actionListPage = actionListM
|
||||
cmds = append(cmds, cmd)
|
||||
|
||||
entryListM, cmd := m.ui.entryListPage.Update(msg, m.context)
|
||||
entryListM, cmd := m.ui.entryListPage.Update(msg, m.ui.page == EntryList, m.context)
|
||||
m.ui.entryListPage = entryListM
|
||||
cmds = append(cmds, cmd)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue