[mobile] added SvgIcon component

This commit is contained in:
maxkadushkin
2024-12-14 23:52:25 +03:00
parent 6dcbbf0b46
commit 60e616b3c1
4 changed files with 26 additions and 1 deletions

View File

@ -0,0 +1,9 @@
import React from 'react';
export default function SvgIcon({ symbolId, className = 'svg-icon', ...props }) {
return (
<svg className={className} {...props}>
<use href={`#${symbolId}`} />
</svg>
);
}

View File

@ -1,6 +1,11 @@
@import "./ios/icons";
@import "./material/icons";
.icon-svg {
width: 24px;
height: 24px;
}
i.icon {
&.icon-paste {
width: 24px;

View File

@ -1,3 +1,8 @@
.icon-svg {
fill: @brand-word;
}
// Formats
i.icon {

View File

@ -40,6 +40,7 @@ const config = {
extensions: ['.js', '.jsx', '.json'],
alias: {
'@': resolvePath(`../../apps/${editor}/mobile/src`),
'@common': resolvePath('../../apps/common/mobile'),
},
modules: [path.resolve(__dirname, '..', 'node_modules'), 'node_modules'],
},
@ -176,7 +177,7 @@ const config = {
],
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
test: /\.(png|jpe?g|gif)(\?.*)?$/,
use: [
{
loader: 'url-loader',
@ -189,6 +190,11 @@ const config = {
]
},
{
test: /\.svg$/,
use: {
loader: "svg-sprite-loader",
}
}, {
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {