Handle close modal button

This commit is contained in:
Adrian Wozniak 2020-04-03 14:40:21 +02:00
parent 900a539da2
commit 9980b75ab5
2 changed files with 4 additions and 1 deletions

View File

@ -95,6 +95,7 @@ pub fn view(_model: &Model, issue: &Issue, modal: &EditIssueModal) -> Node<Msg>
Msg::NoOp
});
let close_handler = mouse_ev(Ev::Click, |_| Msg::PopModal);
let copy_button = StyledButton::build()
.empty()
.icon(Icon::Link)
@ -106,7 +107,6 @@ pub fn view(_model: &Model, issue: &Issue, modal: &EditIssueModal) -> Node<Msg>
}]])
.build()
.into_node();
let delete_button = StyledButton::build()
.empty()
.icon(Icon::Trash.into_styled_builder().size(19).build())
@ -115,6 +115,7 @@ pub fn view(_model: &Model, issue: &Issue, modal: &EditIssueModal) -> Node<Msg>
let close_button = StyledButton::build()
.empty()
.icon(Icon::Close.into_styled_builder().size(24).build())
.on_click(close_handler)
.build()
.into_node();

View File

@ -16,6 +16,7 @@ pub fn update(msg: &Msg, model: &mut model::Model, orders: &mut impl Orders<Msg>
Msg::PopModal => match model.modals.pop() {
_ => (),
},
Msg::ChangePage(Page::EditIssue(issue_id)) => {
let value = find_issue(model, *issue_id)
.map(|issue| issue.issue_type.clone())
@ -87,6 +88,7 @@ pub fn update(msg: &Msg, model: &mut model::Model, orders: &mut impl Orders<Msg>
_ => {}
}
}
_ => (),
}
}