1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
use super::*;
#[derive(Props)]
#[derive(Clone)]
#[derive(PartialEq)]
pub struct PageItemProps {
pub background: Option<Element>,
pub top: Option<Element>,
pub bottom: Option<Element>,
pub class: Option<String>,
pub style: Option<String>,
pub children: Option<Element>
}
#[component]
pub fn PageItem(props: PageItemProps) -> Element {
rsx!(
Stack {
class: props.class,
style: format!(
r#"
flex: 1;
{}
{}
"#,
FILL_VIEW,
props.style.unwrap_or_default()
),
StackItem {
z: 0,
style: format!(
r#"
{}
{}
"#,
ABS_POS_RESET,
FILL_VIEW
),
{ props.background }
}
StackItem {
z: 1,
style: format!(
r#"
justify-content: space-between;
scroll-snap-align: start;
{}
{}
"#,
ABS_POS_RESET,
FILL_VIEW
),
{ props.top }
{ props.children }
{ props.bottom }
}
}
)
}