patternfly_yew/components/
brand.rs1use yew::prelude::*;
3
4#[derive(PartialEq, Properties)]
6pub struct BrandProperties {
7 pub src: AttrValue,
8 pub alt: AttrValue,
9
10 #[prop_or_default]
12 pub style: AttrValue,
13
14 #[prop_or_default]
15 pub children: ChildrenWithProps<BrandSource>,
16}
17
18#[derive(Clone, PartialEq, Properties)]
19pub struct BrandSourceProperties {
20 #[prop_or_default]
21 pub media: Option<String>,
23 pub srcset: AttrValue,
25}
26
27#[function_component(BrandSource)]
28pub fn brand_source(props: &BrandSourceProperties) -> Html {
29 html!(<source media={props.media.clone()} srcset={&props.srcset} />)
30}
31
32#[function_component(Brand)]
48pub fn brand(props: &BrandProperties) -> Html {
49 if props.children.is_empty() {
50 html! (<img class="pf-v6-c-brand" style={&props.style} src={&props.src} alt={&props.alt} />)
51 } else {
52 html! (
53 <picture class="pf-v6-c-brand pf-m-picture" style={&props.style}>
54 { for props.children.iter() }
55 <img class="pf-v6-c-brand" src={&props.src} alt={&props.alt} />
56 </picture>
57 )
58 }
59}