New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Icon paths #21
Merged
Merged
Icon paths #21
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
node_modules | ||
dist | ||
out | ||
node_modules | ||
dist | ||
out |
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,54 @@ | ||
/** | ||
* A quick utility file to create a constants file for importing each icon | ||
* This is designed to be re-ran when new icons are added | ||
*/ | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
const fp = require("lodash/fp"); | ||
const _ = require("lodash"); | ||
|
||
const imgPaths = path.join(__dirname, "..", "src", "imgs"); | ||
const constantsFile = path.join( | ||
__dirname, | ||
"..", | ||
"src", | ||
"constants", | ||
"imgPaths.ts" | ||
); | ||
const editorIcons = path.join(imgPaths, "editor-icons"); | ||
|
||
const dir: Array<string> = fs.readdirSync(editorIcons); | ||
const getFileVarName = fp.compose( | ||
_.camelCase, | ||
filename => | ||
filename | ||
.split(".") | ||
.slice(0, -1) | ||
.join(".") | ||
); | ||
|
||
const getFileRelPath = filename => `../imgs/editor-icons/${filename}`; | ||
const importStatements = dir | ||
.map( | ||
filename => | ||
`import ${getFileVarName(filename)} from "${getFileRelPath(filename)}";` | ||
) | ||
.join("\n"); | ||
const exportStatements = dir | ||
.map( | ||
filename => | ||
`export const ${getFileVarName(filename)}Path = ${getFileVarName( | ||
filename | ||
)}` | ||
) | ||
.join(";\n"); | ||
const fileOutput = `${importStatements} | ||
|
||
${exportStatements} | ||
|
||
`; | ||
|
||
if (fs.existsSync(constantsFile)) { | ||
fs.unlinkSync(constantsFile); | ||
} | ||
fs.writeFileSync(constantsFile, fileOutput, "UTF8"); |
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,30 @@ | ||
import React from "react"; | ||
import * as allIconImgs from "../constants/imgPaths"; | ||
|
||
function AllIconImgs() { | ||
const style = { | ||
height: 50, | ||
width: 50, | ||
padding: 10 | ||
}; | ||
const disabledStyle = { | ||
...style, | ||
opacity: 0.3 | ||
}; | ||
return ( | ||
<div> | ||
{Object.keys(allIconImgs).map(iconName => ( | ||
<div key={iconName}> | ||
<img style={style} src={allIconImgs[iconName]} alt={iconName} /> | ||
<img | ||
style={disabledStyle} | ||
src={allIconImgs[iconName]} | ||
alt={iconName} | ||
/> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
} | ||
|
||
export default AllIconImgs; |
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,121 @@ | ||
import androidStudio128 from "../imgs/editor-icons/android-studio-128.png"; | ||
import appcode128 from "../imgs/editor-icons/appcode-128.png"; | ||
import aptana128 from "../imgs/editor-icons/aptana-128.png"; | ||
import atom128 from "../imgs/editor-icons/atom-128.png"; | ||
import blender128 from "../imgs/editor-icons/blender-128.png"; | ||
import brackets128 from "../imgs/editor-icons/brackets-128.png"; | ||
import chrome128 from "../imgs/editor-icons/chrome-128.png"; | ||
import clion128 from "../imgs/editor-icons/clion-128.png"; | ||
import cloud9128 from "../imgs/editor-icons/cloud9-128.png"; | ||
import coda128 from "../imgs/editor-icons/coda-128.png"; | ||
import codeblocks128 from "../imgs/editor-icons/codeblocks-128.png"; | ||
import codetasty128 from "../imgs/editor-icons/codetasty-128.png"; | ||
import datagrip128 from "../imgs/editor-icons/datagrip-128.png"; | ||
import eclipse128 from "../imgs/editor-icons/eclipse-128.png"; | ||
import emacs128 from "../imgs/editor-icons/emacs-128.png"; | ||
import embarcaderoDelphi128 from "../imgs/editor-icons/embarcadero-delphi-128.png"; | ||
import emeditor128 from "../imgs/editor-icons/emeditor-128.png"; | ||
import eric128 from "../imgs/editor-icons/eric-128.png"; | ||
import firefox128 from "../imgs/editor-icons/firefox-128.png"; | ||
import flashBuilder128 from "../imgs/editor-icons/flash-builder-128.png"; | ||
import geany128 from "../imgs/editor-icons/geany-128.png"; | ||
import gedit128 from "../imgs/editor-icons/gedit-128.png"; | ||
import goland128 from "../imgs/editor-icons/goland-128.png"; | ||
import intellijIdea128 from "../imgs/editor-icons/intellij-idea-128.png"; | ||
import kakoune128 from "../imgs/editor-icons/kakoune-128.png"; | ||
import kate128 from "../imgs/editor-icons/kate-128.png"; | ||
import komodo128 from "../imgs/editor-icons/komodo-128.png"; | ||
import lightTable128 from "../imgs/editor-icons/light-table-128.png"; | ||
import macrabbitEspresso128 from "../imgs/editor-icons/macrabbit-espresso-128.png"; | ||
import monodevelop128 from "../imgs/editor-icons/monodevelop-128.png"; | ||
import netbeans128 from "../imgs/editor-icons/netbeans-128.png"; | ||
import notepad128 from "../imgs/editor-icons/notepad++-128.png"; | ||
import notepadPlus256 from "../imgs/editor-icons/notepad-plus-256.png"; | ||
import photoshop128 from "../imgs/editor-icons/photoshop-128.png"; | ||
import phpstorm128 from "../imgs/editor-icons/phpstorm-128.png"; | ||
import processing128 from "../imgs/editor-icons/processing-128.png"; | ||
import pycharm128 from "../imgs/editor-icons/pycharm-128.png"; | ||
import pymakr128 from "../imgs/editor-icons/pymakr-128.png"; | ||
import qtcreator128 from "../imgs/editor-icons/qtcreator-128.png"; | ||
import rider128Light from "../imgs/editor-icons/rider-128.light.png"; | ||
import rider128 from "../imgs/editor-icons/rider-128.png"; | ||
import rstudio128 from "../imgs/editor-icons/rstudio-128.png"; | ||
import rubymine128 from "../imgs/editor-icons/rubymine-128.png"; | ||
import sketch128 from "../imgs/editor-icons/sketch-128.png"; | ||
import sqlOperationsStudio128 from "../imgs/editor-icons/sql-operations-studio-128.png"; | ||
import sqlServerManagementStudio128 from "../imgs/editor-icons/sql-server-management-studio-128.png"; | ||
import sublimeText128 from "../imgs/editor-icons/sublime-text-128.png"; | ||
import terminal128 from "../imgs/editor-icons/terminal-128.png"; | ||
import texstudio128 from "../imgs/editor-icons/texstudio-128.png"; | ||
import textmate128 from "../imgs/editor-icons/textmate-128.png"; | ||
import unity128 from "../imgs/editor-icons/unity-128.png"; | ||
import vim128 from "../imgs/editor-icons/vim-128.png"; | ||
import visualStudio128 from "../imgs/editor-icons/visual-studio-128.png"; | ||
import visualStudio470 from "../imgs/editor-icons/visual-studio-470.png"; | ||
import visualStudioForMac128 from "../imgs/editor-icons/visual-studio-for-mac-128.png"; | ||
import vsCode128 from "../imgs/editor-icons/vs-code-128.png"; | ||
import webmatrix128 from "../imgs/editor-icons/webmatrix-128.png"; | ||
import webstorm128 from "../imgs/editor-icons/webstorm-128.png"; | ||
import xamarin128 from "../imgs/editor-icons/xamarin-128.png"; | ||
import xcode128 from "../imgs/editor-icons/xcode-128.png"; | ||
|
||
export const androidStudio128Path = androidStudio128; | ||
export const appcode128Path = appcode128; | ||
export const aptana128Path = aptana128; | ||
export const atom128Path = atom128; | ||
export const blender128Path = blender128; | ||
export const brackets128Path = brackets128; | ||
export const chrome128Path = chrome128; | ||
export const clion128Path = clion128; | ||
export const cloud9128Path = cloud9128; | ||
export const coda128Path = coda128; | ||
export const codeblocks128Path = codeblocks128; | ||
export const codetasty128Path = codetasty128; | ||
export const datagrip128Path = datagrip128; | ||
export const eclipse128Path = eclipse128; | ||
export const emacs128Path = emacs128; | ||
export const embarcaderoDelphi128Path = embarcaderoDelphi128; | ||
export const emeditor128Path = emeditor128; | ||
export const eric128Path = eric128; | ||
export const firefox128Path = firefox128; | ||
export const flashBuilder128Path = flashBuilder128; | ||
export const geany128Path = geany128; | ||
export const gedit128Path = gedit128; | ||
export const goland128Path = goland128; | ||
export const intellijIdea128Path = intellijIdea128; | ||
export const kakoune128Path = kakoune128; | ||
export const kate128Path = kate128; | ||
export const komodo128Path = komodo128; | ||
export const lightTable128Path = lightTable128; | ||
export const macrabbitEspresso128Path = macrabbitEspresso128; | ||
export const monodevelop128Path = monodevelop128; | ||
export const netbeans128Path = netbeans128; | ||
export const notepad128Path = notepad128; | ||
export const notepadPlus256Path = notepadPlus256; | ||
export const photoshop128Path = photoshop128; | ||
export const phpstorm128Path = phpstorm128; | ||
export const processing128Path = processing128; | ||
export const pycharm128Path = pycharm128; | ||
export const pymakr128Path = pymakr128; | ||
export const qtcreator128Path = qtcreator128; | ||
export const rider128LightPath = rider128Light; | ||
export const rider128Path = rider128; | ||
export const rstudio128Path = rstudio128; | ||
export const rubymine128Path = rubymine128; | ||
export const sketch128Path = sketch128; | ||
export const sqlOperationsStudio128Path = sqlOperationsStudio128; | ||
export const sqlServerManagementStudio128Path = sqlServerManagementStudio128; | ||
export const sublimeText128Path = sublimeText128; | ||
export const terminal128Path = terminal128; | ||
export const texstudio128Path = texstudio128; | ||
export const textmate128Path = textmate128; | ||
export const unity128Path = unity128; | ||
export const vim128Path = vim128; | ||
export const visualStudio128Path = visualStudio128; | ||
export const visualStudio470Path = visualStudio470; | ||
export const visualStudioForMac128Path = visualStudioForMac128; | ||
export const vsCode128Path = vsCode128; | ||
export const webmatrix128Path = webmatrix128; | ||
export const webstorm128Path = webstorm128; | ||
export const xamarin128Path = xamarin128; | ||
export const xcode128Path = xcode128; |
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 |
---|---|---|
@@ -1,13 +1,11 @@ | ||
import * as React from "react"; | ||
import { render } from "react-dom"; | ||
import imgPath from "../imgs/editor-icons/blender-128.png"; | ||
import AllIconImgs from "../components/AllIconImgs"; | ||
|
||
const div = document.getElementById("container"); | ||
|
||
render( | ||
<div> | ||
Hello World | ||
<img src={imgPath} alt="Test example of a png imported" /> | ||
<AllIconImgs /> | ||
</div>, | ||
div | ||
); |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"compilerOptions": { | ||
"esModuleInterop": true, | ||
"module": "commonjs", | ||
"target": "ES5", | ||
"outDir": "out", | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
{ | ||
"compilerOptions": { | ||
"esModuleInterop": true, | ||
"module": "commonjs", | ||
"target": "ES5", | ||
"outDir": "out", | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a comment top of this file indicating it's a generated file, with the yarn script command that generates it.