GT2/Ejectable/node_modules/@react-navigation/bottom-tabs/lib/module/utils/useIsKeyboardShown.js.map

1 line
2.3 KiB
Plaintext

{"version":3,"sources":["useIsKeyboardShown.tsx"],"names":["React","Keyboard","Platform","useIsKeyboardShown","isKeyboardShown","setIsKeyboardShown","useState","useEffect","handleKeyboardShow","handleKeyboardHide","OS","addListener","removeListener"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,QAAT,EAAmBC,QAAnB,QAAmC,cAAnC;AAEA,eAAe,SAASC,kBAAT,GAA8B;AAC3C,QAAM,CAACC,eAAD,EAAkBC,kBAAlB,IAAwCL,KAAK,CAACM,QAAN,CAAe,KAAf,CAA9C;AAEAN,EAAAA,KAAK,CAACO,SAAN,CAAgB,MAAM;AACpB,UAAMC,kBAAkB,GAAG,MAAMH,kBAAkB,CAAC,IAAD,CAAnD;;AACA,UAAMI,kBAAkB,GAAG,MAAMJ,kBAAkB,CAAC,KAAD,CAAnD;;AAEA,QAAIH,QAAQ,CAACQ,EAAT,KAAgB,KAApB,EAA2B;AACzBT,MAAAA,QAAQ,CAACU,WAAT,CAAqB,kBAArB,EAAyCH,kBAAzC;AACAP,MAAAA,QAAQ,CAACU,WAAT,CAAqB,kBAArB,EAAyCF,kBAAzC;AACD,KAHD,MAGO;AACLR,MAAAA,QAAQ,CAACU,WAAT,CAAqB,iBAArB,EAAwCH,kBAAxC;AACAP,MAAAA,QAAQ,CAACU,WAAT,CAAqB,iBAArB,EAAwCF,kBAAxC;AACD;;AAED,WAAO,MAAM;AACX,UAAIP,QAAQ,CAACQ,EAAT,KAAgB,KAApB,EAA2B;AACzBT,QAAAA,QAAQ,CAACW,cAAT,CAAwB,kBAAxB,EAA4CJ,kBAA5C;AACAP,QAAAA,QAAQ,CAACW,cAAT,CAAwB,kBAAxB,EAA4CH,kBAA5C;AACD,OAHD,MAGO;AACLR,QAAAA,QAAQ,CAACW,cAAT,CAAwB,iBAAxB,EAA2CJ,kBAA3C;AACAP,QAAAA,QAAQ,CAACW,cAAT,CAAwB,iBAAxB,EAA2CH,kBAA3C;AACD;AACF,KARD;AASD,GArBD,EAqBG,EArBH;AAuBA,SAAOL,eAAP;AACD","sourcesContent":["import * as React from 'react';\nimport { Keyboard, Platform } from 'react-native';\n\nexport default function useIsKeyboardShown() {\n const [isKeyboardShown, setIsKeyboardShown] = React.useState(false);\n\n React.useEffect(() => {\n const handleKeyboardShow = () => setIsKeyboardShown(true);\n const handleKeyboardHide = () => setIsKeyboardShown(false);\n\n if (Platform.OS === 'ios') {\n Keyboard.addListener('keyboardWillShow', handleKeyboardShow);\n Keyboard.addListener('keyboardWillHide', handleKeyboardHide);\n } else {\n Keyboard.addListener('keyboardDidShow', handleKeyboardShow);\n Keyboard.addListener('keyboardDidHide', handleKeyboardHide);\n }\n\n return () => {\n if (Platform.OS === 'ios') {\n Keyboard.removeListener('keyboardWillShow', handleKeyboardShow);\n Keyboard.removeListener('keyboardWillHide', handleKeyboardHide);\n } else {\n Keyboard.removeListener('keyboardDidShow', handleKeyboardShow);\n Keyboard.removeListener('keyboardDidHide', handleKeyboardHide);\n }\n };\n }, []);\n\n return isKeyboardShown;\n}\n"]}