-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR: Creator: V2: Icons: Issues: move out from core (#6095)
* work for the surveyjs/private-tasks#395 * Small refactor with new api * Fix icons sync with theme * Fixed unit tests --------- Co-authored-by: Dmitry Kuzin <[email protected]> Co-authored-by: tsv2013 <[email protected]>
- Loading branch information
1 parent
98b559d
commit d4acba6
Showing
5 changed files
with
33 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
export var svgBundle: {V1?: string, V2?: string} = {}; | ||
|
||
if (typeof jest === "undefined") { | ||
svgBundle.V1 = (<any>require).context("./images-v1", true, /\.svg$/); | ||
svgBundle.V2 = (<any>require).context("./images-v2", true, /\.svg$/); | ||
function getIconsData(path) { | ||
const icons: { [index: string]: string } = {}; | ||
path.keys().forEach((key: string) => { | ||
icons[key.substring(2, key.length - 4).toLowerCase()] = path(key); | ||
}); | ||
return icons; | ||
} | ||
|
||
export const iconsV1 = getIconsData((<any>require).context("./images-v1", true, /\.svg$/)); | ||
export const iconsV2 = getIconsData((<any>require).context("./images-v2", true, /\.svg$/)); |