Skip to content

Commit

Permalink
fix custom modal style; tag 0.0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Jun 27, 2022
1 parent f103cf1 commit 4a76f85
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion demo_respo/src/plugins.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::fmt::Debug;

use respo::{space, ui::ui_row_parted};
use respo::{space, ui::ui_row_parted, RespoStyle};
use serde::{Deserialize, Serialize};

use respo::{button, div, span, ui::ui_button, util, DispatchFn, RespoNode, StatesTree};
Expand Down Expand Up @@ -73,6 +73,7 @@ pub fn comp_plugins_demo(states: &StatesTree) -> Result<RespoNode<ActionOp>, Str
let prompt_plugin = PromptPlugin::new(
states.pick("prompt"),
PromptOptions {
text: Some(String::from("Demo text(length 3~8)")),
validator: Some(PromptValidator::new(|text| {
if text.len() <= 1 {
Err("too short".to_owned())
Expand Down Expand Up @@ -111,13 +112,15 @@ pub fn comp_plugins_demo(states: &StatesTree) -> Result<RespoNode<ActionOp>, Str
let modal_plugin = ModalPlugin::new(
states.pick("modal"),
ModalOptions {
title: Some(String::from("Modal demo")),
render: ModalRenderer::new(|close_modal: _| {
let handler = move |_e: _, dispatch: DispatchFn<ActionOp>| {
respo::util::log!("on modal handle");
close_modal(dispatch)
};
Ok(
div()
.style(RespoStyle::default().padding(8.0).to_owned())
.children([
div().children([span().inner_text("content in custom modal").to_owned()]).to_owned(),
div()
Expand Down
2 changes: 1 addition & 1 deletion respo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "respo"
version = "0.0.13"
version = "0.0.14"
edition = "2021"
description = "a tiny virtual DOM library migrated from ClojureScript"
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion respo/src/dialog/modal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ where
})
.children([div()
.class_list(&[ui_column(), ui_global(), css_card()])
.style(RespoStyle::default().line_height(CssLineHeight::Px(32.0)).to_owned())
.style(RespoStyle::default().padding(0.0).line_height(CssLineHeight::Px(32.0)).to_owned())
.style(options.card_style)
.on_click(move |e, _dispatch| -> Result<(), String> {
// nothing to do
Expand Down

0 comments on commit 4a76f85

Please sign in to comment.