Skip to content

Commit

Permalink
Merge pull request #185 from roman-gyver/feat-adds-pops-to-tsx-const-…
Browse files Browse the repository at this point in the history
…svg-components

feat: adds-pops-to-tsx-const-svg-components
  • Loading branch information
nivekcode authored Oct 13, 2022
2 parents a1f0baa + 3180fac commit df1b581
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/generators/code-snippet-generators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ export const generateSvgConstant = (variableName: string, filenameWithoutEnding:

export function generateTSXConstant(variableName: string, svg: string) {
const variableNameCapitalized = variableName.charAt(0).toUpperCase() + variableName.slice(1);
return `export const ${variableNameCapitalized} = () => (${svg});`;
const svgStringWithProps = svg.replace('>', ' {...props}>');
return `export const ${variableNameCapitalized} = (props) => (${svgStringWithProps});`;
}

export const generateExportStatement = (fileName: string, generatedIconsFolderName?: string): string => {
Expand Down

0 comments on commit df1b581

Please sign in to comment.