This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs-extra'); | |
const glob = require('glob'); | |
// Define the directory where your React component files are located | |
const componentsDir = './src/components/icons'; // Change this to your directory path | |
// Use glob to find all JavaScript/TypeScript files in the directory | |
const componentFiles = glob.sync(`${componentsDir}/**/*.ts?(x)`); | |
// Function to extract component name from a file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sharp = require('sharp'); | |
const fs = require('fs'); | |
const path = require('path'); | |
// Define the input and output directories | |
const inputDir = './input'; | |
const outputDir = './output'; | |
// Create the output directory if it doesn't exist | |
if (!fs.existsSync(outputDir)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sharp = require('sharp'); | |
const fs = require('fs'); | |
const path = require('path'); | |
// Define the input and output directories | |
const inputDir = './input'; | |
const outputDir = './output'; | |
// Create the output directory if it doesn't exist | |
if (!fs.existsSync(outputDir)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { FC, useRef, useState, useEffect } from 'react'; | |
import styled from 'styled-components'; | |
const placeHolder = | |
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkqAcAAIUAgUW0RjgAAAAASUVORK5CYII='; | |
const Image = styled.img` | |
display: block; | |
@keyframes loaded { | |
0% { |