Skip to content

Instantly share code, notes, and snippets.

View sbadulin's full-sized avatar

Sergei Badulin sbadulin

  • Somis Enterprises Oy
  • Espoo, Finland
View GitHub Profile
function iconTemplate({ template }, opts, { imports, componentName, props, jsx }) {
const typeScriptTpl = template.smart({ plugins: ['typescript'] });
return typeScriptTpl.ast`
${imports}
import styled, { css } from 'styled-components';
const SvgIcon = (${props}: React.SVGProps<SVGSVGElement>) => (props => ${jsx})({className: props.className});
const ${componentName} = styled(SvgIcon)([],
({ theme, fill, width }) => css\`
### Keybase proof
I hereby claim:
* I am sbadulin on github.
* I am sbadulin (https://keybase.io/sbadulin) on keybase.
* I have a public key ASDgLhgxHxzy9um-TjgiAQ3P7Evgo9tI1ZKn58dGBq7JOQo