{"ast":null,"code":"import React from 'react';\nimport { Button, useToast, Stack } from \"/Users/rohitsingh/Documents/projects/new-nativebase-setup/NativeBase/src/index\";\nexport var Example = function Example() {\n  var toast = useToast();\n  var toastIdRef = React.useRef();\n\n  function close() {\n    if (toastIdRef.current) {\n      toast.close(toastIdRef.current);\n    }\n  }\n\n  function closeAll() {\n    toast.closeAll();\n  }\n\n  function addToast() {\n    toastIdRef.current = toast.show({\n      title: 'Hi, Nice to see you'\n    });\n  }\n\n  return React.createElement(Stack, {\n    direction: {\n      base: 'column',\n      md: 'row'\n    },\n    space: 2\n  }, React.createElement(Button, {\n    onPress: addToast\n  }, \"Toast\"), React.createElement(Button, {\n    onPress: close,\n    variant: \"outline\"\n  }, \"Close last toast\"), React.createElement(Button, {\n    onPress: closeAll,\n    variant: \"outline\"\n  }, \"Close all toasts\"));\n};","map":{"version":3,"sources":["/Users/rohitsingh/Documents/projects/new-nativebase-setup/NativeBase/example/storybook/stories/components/composites/Toast/CloseToast.tsx"],"names":["React","Button","useToast","Stack","Example","toast","toastIdRef","useRef","close","current","closeAll","addToast","show","title","base","md"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,MAAT,EAAiBC,QAAjB,EAA2BC,KAA3B;AAEA,OAAO,IAAMC,OAAO,GAAG,SAAVA,OAAU,GAAM;AAC3B,MAAMC,KAAK,GAAGH,QAAQ,EAAtB;AACA,MAAMI,UAAU,GAAGN,KAAK,CAACO,MAAN,EAAnB;;AAEA,WAASC,KAAT,GAAiB;AACf,QAAIF,UAAU,CAACG,OAAf,EAAwB;AACtBJ,MAAAA,KAAK,CAACG,KAAN,CAAYF,UAAU,CAACG,OAAvB;AACD;AACF;;AAED,WAASC,QAAT,GAAoB;AAClBL,IAAAA,KAAK,CAACK,QAAN;AACD;;AAED,WAASC,QAAT,GAAoB;AAClBL,IAAAA,UAAU,CAACG,OAAX,GAAqBJ,KAAK,CAACO,IAAN,CAAW;AAC9BC,MAAAA,KAAK,EAAE;AADuB,KAAX,CAArB;AAGD;;AAED,SACE,oBAAC,KAAD;AAAO,IAAA,SAAS,EAAE;AAAEC,MAAAA,IAAI,EAAE,QAAR;AAAkBC,MAAAA,EAAE,EAAE;AAAtB,KAAlB;AAAiD,IAAA,KAAK,EAAE;AAAxD,KACE,oBAAC,MAAD;AAAQ,IAAA,OAAO,EAAEJ;AAAjB,aADF,EAEE,oBAAC,MAAD;AAAQ,IAAA,OAAO,EAAEH,KAAjB;AAAwB,IAAA,OAAO,EAAC;AAAhC,wBAFF,EAKE,oBAAC,MAAD;AAAQ,IAAA,OAAO,EAAEE,QAAjB;AAA2B,IAAA,OAAO,EAAC;AAAnC,wBALF,CADF;AAWD,CA/BM","sourcesContent":["import React from 'react';\nimport { Button, useToast, Stack } from 'native-base';\n\nexport const Example = () => {\n  const toast = useToast();\n  const toastIdRef = React.useRef();\n\n  function close() {\n    if (toastIdRef.current) {\n      toast.close(toastIdRef.current);\n    }\n  }\n\n  function closeAll() {\n    toast.closeAll();\n  }\n\n  function addToast() {\n    toastIdRef.current = toast.show({\n      title: 'Hi, Nice to see you',\n    });\n  }\n\n  return (\n    <Stack direction={{ base: 'column', md: 'row' }} space={2}>\n      <Button onPress={addToast}>Toast</Button>\n      <Button onPress={close} variant=\"outline\">\n        Close last toast\n      </Button>\n      <Button onPress={closeAll} variant=\"outline\">\n        Close all toasts\n      </Button>\n    </Stack>\n  );\n};\n"]},"metadata":{},"sourceType":"module"}