()
| 9 | import { useState } from "react"; |
| 10 | |
| 11 | export default function SnackbarsExample() { |
| 12 | const [show, setShow] = useState(false); |
| 13 | const { width, height } = useWindowDimensions(); |
| 14 | return ( |
| 15 | <> |
| 16 | <ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: 20 }}> |
| 17 | <Text style={styles.header}>Snackbars Example</Text> |
| 18 | <Button text="Show Snackbar" onClick={() => setShow(true)} /> |
| 19 | </ScrollView> |
| 20 | <Snackbar |
| 21 | style={{ |
| 22 | position: "absolute", |
| 23 | bottom: 0, |
| 24 | right: 0, |
| 25 | width, |
| 26 | height, |
| 27 | backgroundColor: "transparent", |
| 28 | }} |
| 29 | message="I'm a snackbar" |
| 30 | show={show} |
| 31 | onDismiss={() => setShow(false)} |
| 32 | onActionPerformed={() => setShow(false)} |
| 33 | /> |
| 34 | </> |
| 35 | ); |
| 36 | } |
| 37 | |
| 38 | const styles = StyleSheet.create({ |
| 39 | header: { |
nothing calls this directly
no outgoing calls
no test coverage detected