UNPKG

1.71 kBSource Map (JSON)View Raw
1{"version":3,"file":"UserInterfaceStyle.js","sourceRoot":"","sources":["../../src/ios/UserInterfaceStyle.ts"],"names":[],"mappings":";;AAGA,SAAgB,qBAAqB,CAAC,MAAkB;;IACtD,IAAI,MAAM,eAAG,MAAM,CAAC,GAAG,0CAAE,kBAAkB,uCAAI,MAAM,CAAC,kBAAkB,EAAA,CAAC;IACzE,QAAO,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,IAAI,EAAC;AACxB,CAAC;AAHD,sDAGC;AAED,SAAgB,qBAAqB,CAAC,MAAkB,EAAE,SAAoB;IAC5E,IAAI,kBAAkB,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACvD,IAAI,oBAAoB,GAAG,kCAAkC,CAAC,kBAAkB,CAAC,CAAC;IAElF,IAAI,CAAC,oBAAoB,EAAE;QACzB,OAAO,SAAS,CAAC;KAClB;IAED,uCACK,SAAS,KACZ,oBAAoB,IACpB;AACJ,CAAC;AAZD,sDAYC;AAED,SAAS,kCAAkC,CAAC,kBAAiC;IAC3E,QAAQ,kBAAkB,EAAE;QAC1B,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;QACjB,KAAK,MAAM;YACT,OAAO,MAAM,CAAC;QAChB,KAAK,WAAW;YACd,OAAO,WAAW,CAAC;KACtB;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import { InfoPlist } from './IosConfig.types';\nimport { ExpoConfig } from '../Config.types';\n\nexport function getUserInterfaceStyle(config: ExpoConfig) {\n let result = config.ios?.userInterfaceStyle ?? config.userInterfaceStyle;\n return result ?? null;\n}\n\nexport function setUserInterfaceStyle(config: ExpoConfig, infoPlist: InfoPlist) {\n let userInterfaceStyle = getUserInterfaceStyle(config);\n let UIUserInterfaceStyle = _mapUserInterfaceStyleForInfoPlist(userInterfaceStyle);\n\n if (!UIUserInterfaceStyle) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n UIUserInterfaceStyle,\n };\n}\n\nfunction _mapUserInterfaceStyleForInfoPlist(userInterfaceStyle: string | null): string | null {\n switch (userInterfaceStyle) {\n case 'light':\n return 'Light';\n case 'dark':\n return 'Dark';\n case 'automatic':\n return 'Automatic';\n }\n\n return null;\n}\n"]}
\No newline at end of file