How to use the react-sketchapp.makeSymbol function in react-sketchapp

To help you get started, we’ve selected a few react-sketchapp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github imgly / ui-design-system-generator / src / util / index.js View on Github external
const pathSeparation = '/'

    // Add the theme name and theme ID at the start of the symbol name
    // e.g ProjectName/Dark/Color/Text/Primary
    let pathArray = [THEME_NAME, themeID, ...path]

    // UpperCase the first letter in each path string
    if (withCapitalize) pathArray = pathArray.map(e => e.replace(/\b\w/g, firstLetter => firstLetter.toUpperCase()))

    // Create the symbol name
    const pathString = pathArray.join().replace(/[,]/g, pathSeparation)

    // If the symbol equals the active theme, create a symbol and remove the theme specific path section
    if (themeID === ACTIVE_THEME) {
        makeSymbol(
            component,
            pathString
                .replace(
                    `${themeID.replace(/\b\w/g, firstLetter => firstLetter.toUpperCase())}${pathSeparation}`
                    , ''
                )
        )
    }

    return component
}
github airbnb / react-sketchapp / examples / symbols / src / my-command.js View on Github external
const RedSquare = () => (
  
);

const RedSquareSym = makeSymbol(RedSquare, 'squares/red');

const BlueSquare = () => (
  
);

const BlueSquareSym = makeSymbol(BlueSquare, 'squares/blue');

const Photo = () => (
  <img style="{{" name="Photo">
);

const PhotoSym = makeSymbol(Photo);

const Nested = () =&gt; (
github airbnb / react-sketchapp / examples / symbols / src / my-command.js View on Github external
name="Photo"
    source="https://pbs.twimg.com/profile_images/895665264464764930/7Mb3QtEB_400x400.jpg"
    style={{ width: 100, height: 100 }}
  /&gt;
);

const PhotoSym = makeSymbol(Photo);

const Nested = () =&gt; (
  
);

const NestedSym = makeSymbol(Nested);

export default () =&gt; {
  const Document = () =&gt; (
    
      
    
  );

  render(, context.document.currentPage());
github airbnb / react-sketchapp / examples / symbols / src / my-command.js View on Github external
);

const BlueSquareSym = makeSymbol(BlueSquare, 'squares/blue');

const Photo = () =&gt; (
  <img style="{{" name="Photo">
);

const PhotoSym = makeSymbol(Photo);

const Nested = () =&gt; (
  
);

const NestedSym = makeSymbol(Nested);

export default () =&gt; {
  const Document = () =&gt; (
    
github airbnb / react-sketchapp / examples / symbols / src / my-command.js View on Github external
import * as React from 'react';
import { render, Artboard, Text, View, Image, makeSymbol } from 'react-sketchapp';

const RedSquare = () =&gt; (
  
);

const RedSquareSym = makeSymbol(RedSquare, 'squares/red');

const BlueSquare = () =&gt; (
  
);

const BlueSquareSym = makeSymbol(BlueSquare, 'squares/blue');

const Photo = () =&gt; (
  <img style="{{" name="Photo">
);