Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
feat(renderer): switch between renderers based on analyser type
Browse files Browse the repository at this point in the history
  • Loading branch information
Lasse Kuechler authored and lkuechler committed Mar 12, 2018
1 parent 08cd6f5 commit a4008df
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/component/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,20 @@ function hideHighlightArea(

window.onload = () => {
SmoothscrollPolyfill.polyfill();
renderReact(store, highlightElement);
const analyzer = store.getStyleguide().getAnalyzer();

if (!analyzer) {
return;
}

switch (analyzer.getPatternType()) {
case 'react':
renderReact(store, highlightElement);
break;

default:
console.log('No matching rederer found');
}
};

// Disable drag and drop from outside the application
Expand Down

0 comments on commit a4008df

Please sign in to comment.