create new page
This commit is contained in:
16
src/app.rs
16
src/app.rs
@@ -116,6 +116,18 @@ pub enum Panel {
|
||||
Pages,
|
||||
}
|
||||
|
||||
pub struct NewPageDialog {
|
||||
pub title: String,
|
||||
pub creating: bool,
|
||||
pub error: Option<String>,
|
||||
}
|
||||
|
||||
impl NewPageDialog {
|
||||
pub fn new() -> Self {
|
||||
Self { title: String::new(), creating: false, error: None }
|
||||
}
|
||||
}
|
||||
|
||||
pub struct MainView {
|
||||
pub spaces: Vec<Space>,
|
||||
pub pages: Vec<Page>,
|
||||
@@ -126,6 +138,7 @@ pub struct MainView {
|
||||
pub loading_pages: bool,
|
||||
pub loading_page_content: bool,
|
||||
pub error: Option<String>,
|
||||
pub new_page_dialog: Option<NewPageDialog>,
|
||||
}
|
||||
|
||||
impl MainView {
|
||||
@@ -140,6 +153,7 @@ impl MainView {
|
||||
loading_pages: false,
|
||||
loading_page_content: false,
|
||||
error: None,
|
||||
new_page_dialog: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -251,6 +265,8 @@ pub enum AppMsg {
|
||||
PageContentLoaded { page_id: String, title: String, content: String },
|
||||
PageSaved,
|
||||
SaveError(String),
|
||||
PageCreated { page_id: String, title: String },
|
||||
CreateError(String),
|
||||
SearchResults(Vec<SearchResult>),
|
||||
SearchError(String),
|
||||
ApiError(String),
|
||||
|
||||
Reference in New Issue
Block a user