UNPKG

@giphy/react-native-sdk

Version:
19 lines 1.11 kB
import { processColor } from 'react-native'; const THEME_COLOR_FIELDS = ['avatarPlaceholderColor', 'backgroundColor', 'backgroundColorForLoadingCells', 'confirmationBackButtonColor', 'confirmationSelectButtonColor', 'confirmationSelectButtonTextColor', 'confirmationViewOnGiphyColor', 'defaultTextColor', 'dialogOverlayBackgroundColor', 'emojiDrawerGradientBottomColor', 'emojiDrawerGradientTopColor', 'emojiDrawerSeparatorColor', 'handleBarColor', 'retryButtonBackgroundColor', 'retryButtonTextColor', 'searchBackButtonColor', 'searchBarBackgroundColor', 'searchPlaceholderTextColor', 'searchTextColor', 'stickerBackgroundColor', 'suggestionCellBackgroundColor', 'suggestionCellTextColor', 'tabBarSwitchDefaultColor', 'tabBarSwitchSelectedColor', 'usernameColor']; export function serializeTheme(theme) { if (typeof theme === 'string') { return { preset: theme }; } const rv = { ...theme }; THEME_COLOR_FIELDS.forEach(colorField => { if (colorField in rv) { rv[colorField] = processColor(theme[colorField]); } }); return rv; } //# sourceMappingURL=giphyTheme.js.map