UNPKG

@zohodesk/dot

Version:

In this Library, we Provide Some Basic Components to Build Your Application

29 lines (27 loc) 853 B
import { getAssetsImportPromises } from "../getAssetsImportPromises"; import { themeColorImports, themeColorMapping } from "../themeColorAssetsConfig"; import { validateAndLogError } from "../errorValidation"; import { LIBRARIES, THEME_COLORS } from "../constants"; export function getThemeColorAssetPromise(_ref) { let { themeAppearance, themeColor } = _ref; const isError = validateAndLogError({ options: THEME_COLORS, value: themeColor, type: 'themeColor' }); if (!isError) { const assetImportKeys = []; LIBRARIES.map(library => { const assetImportKey = themeColorMapping[library][themeColor][themeAppearance]; assetImportKeys.push(assetImportKey); }); return getAssetsImportPromises({ assetImportKeys: assetImportKeys, assetImports: themeColorImports }); } return []; }