(data: T)
| 609 | } |
| 610 | |
| 611 | pub fn create_context_menu<T>(data: T) -> Arc<Box<dyn Menu<T> + Send + Sync>> |
| 612 | where |
| 613 | T: ContextMenuData<T> + 'static + Send + Sync, |
| 614 | { |
| 615 | let ui_store = expect_context::<RwSignal<UiStore>>(); |
| 616 | let is_mobile = create_read_slice(ui_store, |u| u.get_is_mobile()).get(); |
| 617 | if is_mobile { |
| 618 | Arc::new(Box::new(BottomSheet::new(data))) |
| 619 | } else { |
| 620 | Arc::new(Box::new(ContextMenu::new(data))) |
| 621 | } |
| 622 | } |
no test coverage detected