@zohodesk/dot
Version:
In this Library, we Provide Some Basic Components to Build Your Application
28 lines (26 loc) • 875 B
JavaScript
import { getAssetsImportPromises } from "../getAssetsImportPromises";
import { themeAppearanceImports, themeAppearanceMapping } from "../themeAppearanceAssetsConfig";
import { validateAndLogError } from "../errorValidation";
import { LIBRARIES, THEME_APPEARANCES } from "../constants";
export function getThemeAppearanceAssetPromise(_ref) {
let {
themeAppearance
} = _ref;
const isError = validateAndLogError({
options: THEME_APPEARANCES,
value: themeAppearance,
type: 'themeAppearance'
});
if (!isError) {
const assetImportKeys = [];
LIBRARIES.map(library => {
const assetImportKey = themeAppearanceMapping[library][themeAppearance];
assetImportKeys.push(assetImportKey);
});
return getAssetsImportPromises({
assetImportKeys: assetImportKeys,
assetImports: themeAppearanceImports
});
}
return [];
}