UNPKG

@zohodesk/dot

Version:

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

28 lines (26 loc) 828 B
import { getAssetsImportPromises } from "../getAssetsImportPromises"; import { themeColorImports, themeColorMapping } from "../themeColorAssetsConfig"; import { validateAndLogError } from "../errorValidation"; import { LIBRARIES, THEME_COLORS } from "../constants"; export function getThemeColorAssetPromise({ themeAppearance, themeColor }) { 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 []; }