rn-inkpad
Version:
<img src="https://res.cloudinary.com/fercloudinary/image/upload/v1715452841/packages/inkpad-banner_acl0xl.png" />
62 lines (61 loc) • 1.9 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.useActionSheetTheme = void 0;
const react_native_1 = require("react-native");
const useActionSheetTheme = (actionSheetTheme) => {
let { appearance: userAppearance, backgroundColor, buttonColor, closeBackgroundColor, closeIconColor, separatorColor, textColor, theme, } = actionSheetTheme ?? {};
let appearance;
if (userAppearance) {
appearance = userAppearance;
}
else {
appearance = react_native_1.Appearance.getColorScheme();
}
const dark = appearance === 'dark';
let platform = react_native_1.Platform.OS;
if (!theme) {
if (platform === 'ios') {
theme = 'cupertino';
}
else {
theme = 'material';
}
}
const styles = {
backgroundColor: !!backgroundColor
? backgroundColor
: dark
? '#171717'
: theme === 'cupertino'
? '#F4F4F4'
: '#FFFFFF',
buttonColor: !!buttonColor
? buttonColor
: dark
? theme === 'cupertino'
? '#242625'
: '#171717'
: '#FFFFFF',
closeBackgroundColor: !!closeBackgroundColor
? closeBackgroundColor
: dark
? '#1C1E1D'
: '#ECECEC',
closeIconColor: !!closeIconColor
? closeIconColor
: dark
? '#959394'
: '#767779',
separatorColor: !!separatorColor
? separatorColor
: dark
? '#343434'
: '#E4E4E4',
textColor: !!textColor ? textColor : dark ? '#FFFFFF' : '#0A0A0A',
theme,
};
return {
styles,
};
};
exports.useActionSheetTheme = useActionSheetTheme;