Skip to content

Commit

Permalink
adrienne/feat: added svg bundling for wallets (binary-com#9871)
Browse files Browse the repository at this point in the history
* feat: added svg bundling for wallets

* chore: removed assets folder in wallets
  • Loading branch information
adrienne-deriv committed Aug 30, 2023
1 parent acb0a69 commit 0fff88d
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 2 deletions.
21 changes: 19 additions & 2 deletions packages/appstore/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ module.exports = function (env) {
{
loader: 'css-loader',
options: {
url: false,
url: (_, resourcePath) => resourcePath.includes('packages/wallets'),
},
},
{
Expand Down Expand Up @@ -139,7 +139,24 @@ module.exports = function (env) {
},
{
test: /\.svg$/,
exclude: /node_modules|public\//,
issuer: /\/packages\/wallets\/.*(\/)?.*.scss/,
exclude: /node_modules/,
include: /public\//,
type: 'asset/resource',
generator: {
filename: 'appstore/wallets/public/[name].[contenthash][ext]',
},
},
{
test: /\.svg$/,
issuer: /\/packages\/wallets\/.*(\/)?.*.tsx/,
exclude: /node_modules/,
include: /public\//,
use: svg_loaders,
},
{
test: /\.svg$/,
exclude: [/node_modules|public\//],
use: svg_loaders,
},
],
Expand Down
4 changes: 4 additions & 0 deletions packages/wallets/src/AppContent.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import React from 'react';
import WalletList from './components/WalletList';
import WalletsCarousel from './components/WalletCarousel';
import IcBrandDerivGo from './public/ic-brand-derivgo.svg';
import './app-content.scss';

const AppContent: React.FC = () => {
return (
<div>
<div className='icon' />
<IcBrandDerivGo width={25} height={25} />
<WalletList />
<WalletsCarousel />
</div>
Expand Down
6 changes: 6 additions & 0 deletions packages/wallets/src/app-content.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.icon {
width: 100px;
height: 100px;
background-image: url('./public/ic-appstore-deriv-logo.svg');
background-size: cover;
}
1 change: 1 addition & 0 deletions packages/wallets/src/public/ic-appstore-deriv-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/wallets/src/public/ic-brand-derivgo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0fff88d

Please sign in to comment.