Skip to content

Commit

Permalink
Svg icons
Browse files Browse the repository at this point in the history
  • Loading branch information
junkycoder committed Oct 27, 2019
1 parent ef270cb commit 0e3a0d8
Show file tree
Hide file tree
Showing 13 changed files with 84 additions and 65 deletions.
12 changes: 12 additions & 0 deletions config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,18 @@ module.exports = function(webpackEnv) {
'sass-loader'
),
},
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
issuer: {
test: /\.jsx?$/
},
use: ["@svgr/webpack"]
},
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
loader: "url-loader"
},

// "file" loader makes sure those assets get served by WebpackDevServer.
// When you `import` an asset, you get its (virtual) filename.
// In production, they would get copied to the `build` folder.
Expand Down
2 changes: 1 addition & 1 deletion src/assets/icon-dai.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/icon-eth.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/icon-puzzle-unbundle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/assets/icon-puzzle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/logo-ledger.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/logo-metamask.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/logo-trezor.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions src/components/PuzzleButton.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import cn from 'classnames';
import icon from '../assets/icon-puzzle.svg';
import unbundleIcon from '../assets/icon-puzzle-unbundle.svg';
import IconPuzzle from '../assets/icon-puzzle.svg';
import IconPuzzleUnbundle from '../assets/icon-puzzle-unbundle.svg';

export default function PuzzleButton({
onClick,
Expand All @@ -19,7 +19,11 @@ export default function PuzzleButton({
active && 'puzzle-button--active',
)}
>
<img src={unbundle ? unbundleIcon : icon} alt="puzzle" />
{unbundle ? (
<IconPuzzleUnbundle className="puzzle-button__icon" />
) : (
<IconPuzzle className="puzzle-button__icon" />
)}
</button>
);
}
Loading

0 comments on commit 0e3a0d8

Please sign in to comment.