-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(update): update modal added (#754)
Co-authored-by: Stuart Woodbury <stuartwoodbury@protonmail.ch> Co-authored-by: Phill Wisniewski <93608357+phillsatellite@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Luis Cardeña <35935591+luisecm@users.noreply.github.com> Co-authored-by: Matt Wisniewski <infamousvaguerat@gmail.com> Co-authored-by: Sara Tavares <29093946+stavares843@users.noreply.github.com>
- Loading branch information
1 parent
c22b62b
commit 3c4b056
Showing
8 changed files
with
259 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
use common::icons::outline::Shape; | ||
use dioxus::prelude::*; | ||
|
||
use crate::elements::button::Button; | ||
|
||
#[derive(Props)] | ||
pub struct Props<'a> { | ||
children: Element<'a>, | ||
on_dismiss: EventHandler<'a, ()>, | ||
} | ||
|
||
#[allow(non_snake_case)] | ||
pub fn Modal<'a>(cx: Scope<'a, Props<'a>>) -> Element<'a> { | ||
cx.render(rsx!( | ||
div { | ||
class: "modal-wrapper", | ||
onclick: move |_| cx.props.on_dismiss.call(()), | ||
div { | ||
class: "modal", | ||
onclick: move |evt| { | ||
evt.stop_propagation(); | ||
}, | ||
div { | ||
class: "modal-content", | ||
div { | ||
class: "modal-head", | ||
Button { | ||
onpress: move |_| { | ||
cx.props.on_dismiss.call(()); | ||
}, | ||
icon: Shape::XMark | ||
}, | ||
}, | ||
div { | ||
class: "model-body", | ||
rsx!(cx.props.children.as_ref()), | ||
}, | ||
|
||
|
||
}, | ||
|
||
|
||
|
||
} | ||
} | ||
)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
|
||
.modal-wrapper { | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
bottom: 0; | ||
left: 0; | ||
z-index: 10; | ||
min-height: 300px; | ||
display: flex; | ||
border: 1px solid black; | ||
justify-content: center; /* align item horizontally */ | ||
align-items: center; /* align item vertically */ | ||
// this was copied over from Popup from an old version of uplink. not sure how much is necessary | ||
backdrop-filter: blur(5px); | ||
-webkit-backdrop-filter: blur(5px); | ||
transition: blur 0.2s; | ||
background: var(--theme-semi-transparent); | ||
|
||
.modal { | ||
width: 70%; | ||
height: 70%; | ||
background: var(--background); | ||
border: 1px solid var(--border-color); | ||
border-radius: 10px; | ||
opacity:1; | ||
cursor: default; | ||
} | ||
} | ||
|
||
.modal-content { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.model-body { | ||
flex: auto; | ||
padding: 25px; | ||
} | ||
|
||
.modal-head { | ||
margin: 3px; | ||
margin-left: auto; | ||
} | ||
|
||
.modal-content .modal-head .btn-wrap { | ||
height: var(--titlebar-height); | ||
width: var(--titlebar-height); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters