amis-rpc-design/node_modules/react-native-screens/lib/commonjs/native-stack/utils/getDefaultHeaderHeight.js.map

1 line
2.4 KiB
Plaintext
Raw Normal View History

2023-10-07 19:42:30 +08:00
{"version":3,"names":["_reactNative","require","formSheetModalHeight","getDefaultHeaderHeight","layout","statusBarHeight","stackPresentation","isLargeHeader","arguments","length","undefined","headerHeight","Platform","OS","isLandscape","width","height","isFormSheetModal","isPad","isTV"],"sources":["getDefaultHeaderHeight.tsx"],"sourcesContent":["import { Platform } from 'react-native';\nimport { StackPresentationTypes } from 'react-native-screens';\ntype Layout = { width: number; height: number };\n\nconst formSheetModalHeight = 56;\n\nexport default function getDefaultHeaderHeight(\n layout: Layout,\n statusBarHeight: number,\n stackPresentation: StackPresentationTypes,\n isLargeHeader = false\n): number {\n // default header heights\n let headerHeight = Platform.OS === 'android' ? 56 : 64;\n\n if (Platform.OS === 'ios') {\n const isLandscape = layout.width > layout.height;\n const isFormSheetModal =\n stackPresentation === 'modal' || stackPresentation === 'formSheet';\n if (isFormSheetModal && !isLandscape) {\n // `modal` and `formSheet` presentations do not take whole screen, so should not take the inset.\n statusBarHeight = 0;\n }\n\n if (Platform.isPad || Platform.isTV) {\n headerHeight = isFormSheetModal ? formSheetModalHeight : 50;\n } else {\n if (isLandscape) {\n headerHeight = 32;\n } else {\n if (isFormSheetModal) {\n headerHeight = formSheetModalHeight;\n } else {\n headerHeight = isLargeHeader ? 96 : 44;\n }\n }\n }\n }\n\n return headerHeight + statusBarHeight;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAIA,MAAMC,oBAAoB,GAAG,EAAE;AAEhB,SAASC,sBAAsBA,CAC5CC,MAAc,EACdC,eAAuB,EACvBC,iBAAyC,EAEjC;EAAA,IADRC,aAAa,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EAErB;EACA,IAAIG,YAAY,GAAGC,qBAAQ,CAACC,EAAE,KAAK,SAAS,GAAG,EAAE,GAAG,EAAE;EAEtD,IAAID,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;IACzB,MAAMC,WAAW,GAAGV,MAAM,CAACW,KAAK,GAAGX,MAAM,CAACY,MAAM;IAChD,MAAMC,gBAAgB,GACpBX,iBAAiB,KAAK,OAAO,IAAIA,iBAAiB,KAAK,WAAW;IACpE,IAAIW,gBAAgB,IAAI,CAACH,WAAW,EAAE;MACpC;MACAT,eAAe,GAAG,CAAC;IACrB;IAEA,IAAIO,qBAAQ,CAACM,KAAK,IAAIN,qBAAQ,CAACO,IAAI,EAAE;MACnCR,YAAY,GAAGM,gBAAgB,GAAGf,oBAAoB,GAAG,EAAE;IAC7D,CAAC,MAAM;MACL,IAAIY,WAAW,EAAE;QACfH,YAAY,GAAG,EAAE;MACnB,CAAC,MAAM;QACL,IAAIM,gBAAgB,EAAE;UACpBN,YAAY,GAAGT,oBAAoB;QACrC,CAAC,MAAM;UACLS,YAAY,GAAGJ,aAAa,GAAG,EAAE,GAAG,EAAE;QACxC;MACF;IACF;EACF;EAEA,OAAOI,YAAY,GAAGN,eAAe;AACvC"}