v0.15-WORKINGV2
This commit is contained in:
@@ -167,6 +167,7 @@ pub fn Header<G: Html>(cx: Scope) -> View<G> {
|
||||
app_state.internalsearch.set(false);
|
||||
|
||||
info!("Fetching search {}\n", task.clone());
|
||||
app_state.books.set(Vec::new());
|
||||
value.set("".to_string());
|
||||
input_ref
|
||||
.get::<DomNode>()
|
||||
@@ -188,7 +189,7 @@ pub fn Header<G: Html>(cx: Scope) -> View<G> {
|
||||
app_state.search.set(task);
|
||||
app_state.openlibrary.set(false);
|
||||
app_state.internalsearch.set(true);
|
||||
|
||||
app_state.books.set(Vec::new());
|
||||
info!("Fetching search 2\n");
|
||||
}
|
||||
}
|
||||
@@ -310,7 +311,6 @@ async fn ListDB<G: Html>(cx: Scope<'_>) -> View<G> {
|
||||
app_state.openlibrary.track();
|
||||
app_state.internalsearch.track();
|
||||
app_state.refreshing.track();
|
||||
app_state.pagenum.track();
|
||||
|
||||
info!(
|
||||
"The state changed. New value: {}",
|
||||
@@ -391,6 +391,8 @@ pub fn BookDB<G: Html>(cx: Scope, bookitem: BookUIProp) -> View<G> {
|
||||
let loctitle = bookitem.bookitem.clone().title.clone();
|
||||
let locauthors = bookitem.bookitem.clone().author_name.clone().unwrap_or(vec!["".to_string()]).join(", ");
|
||||
let locdesc = bookitem.bookitem.clone().description.unwrap_or("".to_string());
|
||||
let locloc = bookitem.bookitem.clone().location.unwrap_or("".to_string());
|
||||
|
||||
|
||||
|
||||
let coverurl = bookdisplay.clone().cover.clone().unwrap_or("None".to_string());
|
||||
@@ -427,6 +429,7 @@ pub fn BookDB<G: Html>(cx: Scope, bookitem: BookUIProp) -> View<G> {
|
||||
button(class="info", on:click=handle_display){ "INFO+" }
|
||||
}
|
||||
div(class="card-main"){
|
||||
img(src=coverurl,width="100")
|
||||
|
||||
div(class="card-title"){
|
||||
(format!("{}",loctitle))
|
||||
@@ -435,11 +438,12 @@ pub fn BookDB<G: Html>(cx: Scope, bookitem: BookUIProp) -> View<G> {
|
||||
(format!("{}",locauthors))
|
||||
}
|
||||
//div(class="card-image"){
|
||||
img(src=coverurl,width="100")
|
||||
//}
|
||||
}
|
||||
|
||||
div(class="card-desc"){
|
||||
(format!("{}",locloc))
|
||||
br{}br{}
|
||||
(format!("{}",locdesc))
|
||||
}
|
||||
|
||||
@@ -453,6 +457,7 @@ pub fn BookDB<G: Html>(cx: Scope, bookitem: BookUIProp) -> View<G> {
|
||||
async fn ListOL<G: Html>(cx: Scope<'_>) -> View<G> {
|
||||
let app_state = use_context::<AppState>(cx);
|
||||
|
||||
/*
|
||||
create_effect(cx, || {
|
||||
app_state.search.track();
|
||||
|
||||
@@ -461,6 +466,7 @@ async fn ListOL<G: Html>(cx: Scope<'_>) -> View<G> {
|
||||
app_state.search.get(),
|
||||
);
|
||||
});
|
||||
*/
|
||||
|
||||
let docs = create_memo(cx, || app_state.books.get().iter().cloned().collect::<Vec<_>>());
|
||||
view! {cx,
|
||||
@@ -503,6 +509,7 @@ pub fn BookOL<G: Html>(cx: Scope, bookitem: BookUIProp) -> View<G> {
|
||||
div(class="card-openlibrary"){
|
||||
button(class="add", on:click=handle_add){ "ADD+" }
|
||||
div(class="card-main"){
|
||||
img(src=coverurl,width="100")
|
||||
|
||||
div(class="card-title"){
|
||||
(format!("{}",loctitle))
|
||||
@@ -511,7 +518,6 @@ pub fn BookOL<G: Html>(cx: Scope, bookitem: BookUIProp) -> View<G> {
|
||||
(format!("{}",locauthors))
|
||||
}
|
||||
//div(class="card-image"){
|
||||
img(src=coverurl,width="100")
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -619,9 +625,10 @@ info!("Adding book");
|
||||
println!("{}",temp.status());
|
||||
});
|
||||
}
|
||||
app_state.addingbook.set(BookUI::default());
|
||||
app_state.addingbook.set(BookUI::default());
|
||||
app_state.updating.set(false);
|
||||
app_state.adding.set(false);
|
||||
//app_state.books.set(vec![BookUI::default()]);
|
||||
app_state.refreshing.set(true);
|
||||
|
||||
|
||||
@@ -913,6 +920,7 @@ async fn PageBar<G: Html>(cx: Scope<'_>) -> View<G> {
|
||||
view!{ cx,
|
||||
label{"PAGE "}
|
||||
input(ref=input_ref,bind:value=currpg,on:keyup=handle_submit,class="page-input")
|
||||
label{(format!(" / {}",*app_state.maxpage.get()))}
|
||||
(if *app_state.pagenum.get()>1 {
|
||||
view!{cx, button(class="page", on:click=handle_sub){ "-" }}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user