qorzen_oxide/ui/layout/
mod.rs1use dioxus::prelude::*;
4
5mod footer;
7mod header;
8mod main_layout;
9mod sidebar;
10
11pub use footer::Footer;
13pub use header::Header;
14pub use main_layout::Layout;
15pub use sidebar::Sidebar;
16
17#[derive(Props, Clone, PartialEq)]
19pub struct LayoutProps {
20 pub children: Element,
22 #[props(default = "".to_string())]
24 pub class: String,
25 #[props(default = true)]
27 pub show_header: bool,
28 #[props(default = true)]
30 pub show_sidebar: bool,
31 #[props(default = true)]
33 pub show_footer: bool,
34}
35
36pub struct Breakpoints;
38
39impl Breakpoints {
40 pub const SM: &'static str = "640px"; pub const MD: &'static str = "768px"; pub const LG: &'static str = "1024px"; pub const XL: &'static str = "1280px"; pub const XXL: &'static str = "1536px"; }
46
47pub mod utils {
49 pub fn is_mobile() -> bool {
51 false
54 }
55
56 pub fn is_tablet() -> bool {
58 false
60 }
61
62 pub fn is_desktop() -> bool {
64 true
66 }
67
68 pub fn responsive_classes(_mobile: &str, _tablet: &str, desktop: &str) -> String {
70 desktop.to_string()
73 }
74}
75
76#[cfg(test)]
77mod tests {
78 use super::*;
79
80 #[test]
81 fn test_breakpoints() {
82 assert_eq!(Breakpoints::SM, "640px");
83 assert_eq!(Breakpoints::MD, "768px");
84 assert_eq!(Breakpoints::LG, "1024px");
85 }
86
87 #[test]
88 fn test_responsive_utils() {
89 assert!(utils::is_desktop());
90 assert!(!utils::is_mobile());
91 assert!(!utils::is_tablet());
92 }
93}