Something went wrong. Try again.
Bluesky app fork with some witchin' additions 💫 forked from jollywhoppers.com/witchsky.app
Something went wrong. Try again.
1.2 kB · 51 lines
Swift
at main
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152import ExpoModulesCore
public class BottomSheetModule: Module { public func definition() -> ModuleDefinition { Name("BottomSheet")
AsyncFunction("dismissAll") { SheetManager.shared.dismissAll() }
View(SheetView.self) { Events([ "onAttemptDismiss", "onSnapPointChange", "onStateChange" ])
AsyncFunction("dismiss") { (view: SheetView) in view.dismiss() }
AsyncFunction("updateLayout") { (view: SheetView) in view.updateLayout() }
Prop("cornerRadius") { (view: SheetView, prop: Float) in view.cornerRadius = CGFloat(prop) }
Prop("minHeight") { (view: SheetView, prop: Double) in view.minHeight = prop }
Prop("maxHeight") { (view: SheetView, prop: Double) in view.maxHeight = prop }
Prop("preventDismiss") { (view: SheetView, prop: Bool) in view.preventDismiss = prop }
Prop("preventExpansion") { (view: SheetView, prop: Bool) in view.preventExpansion = prop }
Prop("sourceViewTag") { (view: SheetView, prop: Int?) in view.sourceViewTag = prop } } }}