Skip to content

Instantly share code, notes, and snippets.

@KannarFr
Created November 27, 2020 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KannarFr/713044e30e6cdef823d8a6a1e4eb03a7 to your computer and use it in GitHub Desktop.
Save KannarFr/713044e30e6cdef823d8a6a1e4eb03a7 to your computer and use it in GitHub Desktop.
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