Enum patternfly_yew::ModalVariant
source · pub enum ModalVariant {
None,
Small,
Medium,
Large,
}Variants§
Implementations§
source§impl ModalVariant
impl ModalVariant
sourcepub fn as_classes(&self) -> Vec<&'static str> ⓘ
pub fn as_classes(&self) -> Vec<&'static str> ⓘ
Examples found in repository?
src/modal.rs (line 89)
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
fn view(&self, ctx: &Context<Self>) -> Html {
let mut classes = ctx.props().variant.as_classes();
classes.push("pf-c-modal-box");
html! {
<div class={classes}
role="dialog"
aria-modal="true"
aria-labelledby="modal-title"
aria-describedby="modal-description">
<button
class="pf-c-button pf-m-plain"
type="button"
aria-label="Close dialog"
onclick={ctx.link().callback(|_|Msg::Close)}
>
<i class="fas fa-times" aria-hidden="true"></i>
</button>
<header class="pf-c-modal-box__header">
<h1
class="pf-c-modal-box__title"
id="modal-title-modal-with-form"
>{ &ctx.props().title }</h1>
</header>
if !&ctx.props().description.is_empty() {
<div class="pf-c-modal-box__body">
<p>{ &ctx.props().description }</p>
</div>
}
{ for ctx.props().children.iter().map(|c|{
{html!{
<div class="pf-c-modal-box__body">{c}</div>
}}
}) }
if let Some(footer) = &ctx.props().footer {
<footer class="pf-c-modal-box__footer">
{ footer.clone() }
</footer>
}
</div>
}
}Trait Implementations§
source§impl Clone for ModalVariant
impl Clone for ModalVariant
source§fn clone(&self) -> ModalVariant
fn clone(&self) -> ModalVariant
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for ModalVariant
impl Debug for ModalVariant
source§impl Default for ModalVariant
impl Default for ModalVariant
source§impl PartialEq<ModalVariant> for ModalVariant
impl PartialEq<ModalVariant> for ModalVariant
source§fn eq(&self, other: &ModalVariant) -> bool
fn eq(&self, other: &ModalVariant) -> bool
impl Copy for ModalVariant
impl Eq for ModalVariant
impl StructuralEq for ModalVariant
impl StructuralPartialEq for ModalVariant
Auto Trait Implementations§
impl RefUnwindSafe for ModalVariant
impl Send for ModalVariant
impl Sync for ModalVariant
impl Unpin for ModalVariant
impl UnwindSafe for ModalVariant
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self to a value of a Properties struct.source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self to a value of a Properties struct.