Created
November 27, 2020 14:56
-
-
Save KannarFr/713044e30e6cdef823d8a6a1e4eb03a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { | |
Button, | |
Div, | |
Text, | |
Icon, | |
Input, | |
Select, | |
Modal, | |
} from 'react-native-magnus'; | |
export const ProductAdder = () => { | |
const modalRef = React.useRef(); | |
console.log(modalRef); | |
return ( | |
<> | |
<Button | |
block | |
m={10} | |
onPress={() => { | |
console.log(modalRef); | |
if (modalRef.current) { | |
modalRef.current.open(); | |
} | |
}}> | |
Ajouter | |
</Button> | |
<Modal ref={modalRef}> | |
<Button | |
bg="gray400" | |
isVisible={true} | |
h={35} | |
w={35} | |
top={50} | |
right={15} | |
rounded="circle" | |
onPress={() => { | |
if (modalRef.current) { | |
modalRef.current.close(); | |
} | |
}}> | |
<Icon color="black900" name="close" /> | |
</Button> | |
</Modal> | |
</> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment