mirror of
https://github.com/danbulant/lucide
synced 2026-06-24 09:12:24 +00:00
64 lines
2.1 KiB
Rust
64 lines
2.1 KiB
Rust
use dioxus::prelude::*;
|
|
#[derive(Clone, PartialEq, Props)]
|
|
pub struct Gamepad2Props {
|
|
#[props(default = 24)]
|
|
pub size: usize,
|
|
#[props(default = "currentColor".to_owned())]
|
|
pub color: String,
|
|
#[props(default = "none".to_owned())]
|
|
pub fill: String,
|
|
#[props(default = 2)]
|
|
pub stroke_width: usize,
|
|
#[props(default = false)]
|
|
pub absolute_stroke_width: bool,
|
|
pub class: Option<String>,
|
|
pub style: Option<String>,
|
|
}
|
|
#[component]
|
|
pub fn Gamepad2(props: Gamepad2Props) -> Element {
|
|
let stroke_width = if props.absolute_stroke_width {
|
|
props.stroke_width * 24 / props.size
|
|
} else {
|
|
props.stroke_width
|
|
};
|
|
rsx! {
|
|
svg {
|
|
"xmlns": "http://www.w3.org/2000/svg",
|
|
"class": if let Some(class) = props.class { "{class}" },
|
|
"style": if let Some(style) = props.style { "{style}" },
|
|
"width": "{props.size}",
|
|
"height": "{props.size}",
|
|
"viewBox": "0 0 24 24",
|
|
"fill": "{props.fill}",
|
|
"stroke": "{props.color}",
|
|
"stroke-width": "{stroke_width}",
|
|
"stroke-linecap": "round",
|
|
"stroke-linejoin": "round",
|
|
line {
|
|
"x1": "6",
|
|
"x2": "10",
|
|
"y1": "11",
|
|
"y2": "11",
|
|
}
|
|
line {
|
|
"x1": "8",
|
|
"x2": "8",
|
|
"y1": "9",
|
|
"y2": "13",
|
|
}
|
|
line {
|
|
"x1": "15",
|
|
"x2": "15.01",
|
|
"y1": "12",
|
|
"y2": "12",
|
|
}
|
|
line {
|
|
"x1": "18",
|
|
"x2": "18.01",
|
|
"y1": "10",
|
|
"y2": "10",
|
|
}
|
|
path { "d": "M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z" }
|
|
}
|
|
}
|
|
}
|