From da80909f28644b8e86fbac5eb7b47e787fc800dc Mon Sep 17 00:00:00 2001 From: Austin Andrews Date: Fri, 15 Sep 2023 00:23:57 -0500 Subject: [PATCH 1/3] example modal js package fix --- .../components/IconUsageExamples/ExampleHomeAssistant.tsx | 2 ++ client/components/IconUsageExamples/ExampleReact.tsx | 7 +++++-- client/components/IconUsageExamples/ExampleVue.tsx | 6 ++++-- client/components/IconUsageExamples/ExampleWebfont.tsx | 2 ++ client/components/IconUsageExamples/IconUsageExamples.tsx | 5 ++++- client/components/IconView/IconView.tsx | 1 + client/config.js | 3 +++ client/interfaces/icons.ts | 1 + 8 files changed, 22 insertions(+), 5 deletions(-) diff --git a/client/components/IconUsageExamples/ExampleHomeAssistant.tsx b/client/components/IconUsageExamples/ExampleHomeAssistant.tsx index 9a6d790..75c4d51 100644 --- a/client/components/IconUsageExamples/ExampleHomeAssistant.tsx +++ b/client/components/IconUsageExamples/ExampleHomeAssistant.tsx @@ -8,9 +8,11 @@ import Link from '@/components/Link/Link'; import Code from '@/components/CodeHighlighter/CodeHighlighter'; import classes from './IconUsageExamples.module.scss'; +import { IconLibrary } from '@/interfaces/icons'; interface ExampleHomeAssistantProps { library: string; + libraryInfo: IconLibrary; iconName: string; visible: boolean; } diff --git a/client/components/IconUsageExamples/ExampleReact.tsx b/client/components/IconUsageExamples/ExampleReact.tsx index f27a24f..1db03e9 100644 --- a/client/components/IconUsageExamples/ExampleReact.tsx +++ b/client/components/IconUsageExamples/ExampleReact.tsx @@ -11,13 +11,16 @@ import kebabToPascal from '@/utils/helpers/kebabToPascal'; import classes from './IconUsageExamples.module.scss'; +import { IconLibrary } from '@/interfaces/icons'; + interface ExampleReactProps { library: string; + libraryInfo: IconLibrary; iconName: string; visible: boolean; } -const ExampleReact: FunctionComponent = ({ iconName, library, visible }) => { +const ExampleReact: FunctionComponent = ({ iconName, library, libraryInfo, visible }) => { const jsName = `${library}${kebabToPascal(iconName)}`; return ( @@ -30,7 +33,7 @@ const ExampleReact: FunctionComponent = ({ iconName, library, > { `import Icon from '@mdi/react'; -import { ${jsName} } from '@${library}/js'; +import { ${jsName} } from '@${libraryInfo.jsPackage}'; ` } diff --git a/client/components/IconUsageExamples/ExampleVue.tsx b/client/components/IconUsageExamples/ExampleVue.tsx index 089909a..d65d86d 100644 --- a/client/components/IconUsageExamples/ExampleVue.tsx +++ b/client/components/IconUsageExamples/ExampleVue.tsx @@ -10,14 +10,16 @@ import Code from '@/components/CodeHighlighter/CodeHighlighter'; import kebabToPascal from '@/utils/helpers/kebabToPascal'; import classes from './IconUsageExamples.module.scss'; +import { IconLibrary } from '@/interfaces/icons'; interface ExampleVueProps { library: string; + libraryInfo: IconLibrary; iconName: string; visible: boolean; } -const ExampleVue: FunctionComponent = ({ iconName, library, visible }) => { +const ExampleVue: FunctionComponent = ({ iconName, library, libraryInfo, visible }) => { const jsName = `${library}${kebabToPascal(iconName)}`; return ( @@ -35,7 +37,7 @@ const ExampleVue: FunctionComponent = ({ iconName, library, vis