mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
1import ExpoModulesCore
2
3public class BottomSheetModule: Module {
4 public func definition() -> ModuleDefinition {
5 Name("BottomSheet")
6
7 AsyncFunction("dismissAll") {
8 SheetManager.shared.dismissAll()
9 }
10
11 View(SheetView.self) {
12 Events([
13 "onAttemptDismiss",
14 "onSnapPointChange",
15 "onStateChange"
16 ])
17
18 AsyncFunction("dismiss") { (view: SheetView) in
19 view.dismiss()
20 }
21
22 AsyncFunction("updateLayout") { (view: SheetView) in
23 view.updateLayout()
24 }
25
26 Prop("cornerRadius") { (view: SheetView, prop: Float) in
27 view.cornerRadius = CGFloat(prop)
28 }
29
30 Prop("minHeight") { (view: SheetView, prop: Double) in
31 view.minHeight = prop
32 }
33
34 Prop("maxHeight") { (view: SheetView, prop: Double) in
35 view.maxHeight = prop
36 }
37
38 Prop("preventDismiss") { (view: SheetView, prop: Bool) in
39 view.preventDismiss = prop
40 }
41
42 Prop("preventExpansion") { (view: SheetView, prop: Bool) in
43 view.preventExpansion = prop
44 }
45 }
46 }
47}