File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -4,17 +4,17 @@ use leptos::prelude::*;
4
4
#[ component]
5
5
pub fn Avatar (
6
6
#[ prop( into) ] url : String ,
7
- #[ prop( into, optional) ] alt : Option < String > ,
8
- #[ prop( into, optional, default = Some ( 32 ) ) ] size : Option < i32 > ,
7
+ #[ prop( into, optional) ] alt : String ,
8
+ #[ prop( into, optional, default = 32 ) ] size : i32 ,
9
9
#[ prop( into, optional) ] class : String ,
10
10
) -> impl IntoView {
11
11
let class = crate :: tw!( concat!( BASE_CLASS , "-avatar" ) , class) ;
12
12
13
13
view ! {
14
14
<div
15
15
class={ class}
16
- style: width={ size . map ( |size| format!( "{size}px" ) ) }
17
- style: height={ size . map ( |size| format!( "{size}px" ) ) }
16
+ style: width={ format!( "{size}px" ) }
17
+ style: height={ format!( "{size}px" ) }
18
18
>
19
19
<img class="rustlanges-avatar__img" src={ url} alt={ alt} />
20
20
</div>
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ use leptos::prelude::*;
3
3
use leptos:: { IntoView , component, view} ;
4
4
use tailwind_fuse:: { AsTailwindClass , TwVariant } ;
5
5
6
+ use crate :: icons:: StarBold ;
7
+
6
8
#[ derive( TwVariant , PartialEq ) ]
7
9
pub enum Variant {
8
10
#[ tw( default , class = "text-primary-400" ) ]
@@ -41,7 +43,7 @@ pub fn Flap(
41
43
( variant == Variant :: Highlight ) . then_some( concat!( BASE_CLASS , "-flap__view--icon" ) ) ,
42
44
) }
43
45
>
44
- { ( variant == Variant :: Highlight ) . then_some( view! { <> < /> } ) }
46
+ { ( variant == Variant :: Highlight ) . then_some( view! { <StarBold /> } ) }
45
47
<span class={ concat!( "text-paragraph-2 " , BASE_CLASS , "-flap__view-text" ) } >
46
48
{ label. clone( ) }
47
49
</span>
You can’t perform that action at this time.
0 commit comments