-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update button group and icons * fix icon ref * remove redundent useButton Props * remove console.log * some lint fixes
- Loading branch information
1 parent
227d394
commit ff75b40
Showing
162 changed files
with
574 additions
and
495 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
var fs = require("fs"); | ||
|
||
const startReplaceOrigin = "({size, ...props}) => ("; | ||
const startReplaceReplaced = " React.forwardRef(({size, ...props}, ref) => ("; | ||
const replaceRefOrigin = "{...props}>"; | ||
const replaceRefReplaced = "{...props} ref={ref}>"; | ||
const endReplaceOrigin = ");"; | ||
const endReplaceReplaced = "));"; | ||
|
||
function readFiles(dirname, onFileContent, onError) { | ||
fs.readdir(dirname, function(err, filenames) { | ||
if (err) { | ||
onError(err); | ||
return; | ||
} | ||
filenames.forEach(function(filename) { | ||
fs.readFile(dirname + filename, "utf-8", function(err, content) { | ||
if (err) { | ||
onError(err); | ||
return; | ||
} | ||
onFileContent(filename, content); | ||
}); | ||
}); | ||
}); | ||
} | ||
const dirName = "src/components/Icon/Icons/components/"; | ||
readFiles( | ||
dirName, | ||
function(filename, content) { | ||
console.log("optimizing:: ", filename); | ||
const newContent = content | ||
.replace(replaceRefOrigin, replaceRefReplaced) | ||
.replace(startReplaceOrigin, startReplaceReplaced) | ||
.replace(endReplaceOrigin, endReplaceReplaced); | ||
|
||
fs.writeFile(`${dirName}/${filename}`, newContent, "utf8", function(err) { | ||
if (err) return console.log(err); | ||
}); | ||
}, | ||
function(err) { | ||
throw err; | ||
} | ||
); |
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
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.