How to use the @brainly/html-sketchapp/html2asketch/helpers/utils.SMART_LAYOUT.HORIZONTALLY_CENTER function in @brainly/html-sketchapp

To help you get started, we’ve selected a few @brainly/html-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 brainly / html-sketchapp-style-guide / src / styleguide2asketch.js View on Github external
// generate better layer name from node classes
            layer.setName(buildLayerNameFromBEM(node.classList));
            return layer;
          });
        })
        .reduce((prev, current) => prev.concat(current), [])
        .filter(layer => layer !== null)
        .forEach(layer => symbol.addLayer(layer));

      if (symbol._name.startsWith('ColorMask/')) {
        maskColors.push(symbol);
      }

      if (symbol._name.startsWith('Button/')) {
        symbol.setGroupLayout(SMART_LAYOUT.HORIZONTALLY_CENTER);
      }

      if (symbol._name.startsWith('Counter/')) {
        symbol.setGroupLayout(SMART_LAYOUT.HORIZONTALLY_CENTER);
      }

      if (symbol._name.startsWith('Icon/')) {
        /* eslint-disable no-unused-vars */
        const [, type, size] = symbol._name.split('/');
        /* eslint-enable no-unused-vars */
        const layerSize = parseInt(size, 10);

        const mask = maskColors[0];
        const maskSymbolInstance = mask.getSymbolInstance(
          {x: symbol._x, y: symbol._y, width: layerSize, height: layerSize}
        );