From d7f3f0d7a290075ae0ad533eb330112a46f07c2d Mon Sep 17 00:00:00 2001 From: Richard Ramsden Date: Mon, 28 Oct 2024 22:31:00 +0900 Subject: [PATCH] Add a usage section --- src/components/PaymentModal.tsx | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/components/PaymentModal.tsx b/src/components/PaymentModal.tsx index c73020b..591299d 100644 --- a/src/components/PaymentModal.tsx +++ b/src/components/PaymentModal.tsx @@ -8,6 +8,29 @@ * - modalVisible: boolean - Controls the visibility of the modal. * - setModalVisible: Dispatch> - Function to update the modal visibility state. * - onDismiss?: () => void - Optional callback function called when the modal is dismissed. + * + * Usage: + * ```jsx + * import React, { useState } from 'react'; + * import PaymentModal from './PaymentModal'; + * + * const App = () => { + * const [modalVisible, setModalVisible] = useState(false); + * + * return ( + *
+ * + * console.log('Modal dismissed')} + * /> + *
+ * ); + * }; + * + * export default App; + * ``` */ import { Dispatch, SetStateAction } from "react"; import { TouchableOpacity, Modal, View, Image, StyleSheet } from "react-native";