Skip to content

Commit

Permalink
[mobile] added SvgIcon component
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkadushkin committed Dec 14, 2024
1 parent 6dcbbf0 commit 60e616b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
9 changes: 9 additions & 0 deletions apps/common/mobile/lib/component/SvgIcon.jsx
Original file line number Diff line number Diff line change
@@ -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>
);
}
5 changes: 5 additions & 0 deletions apps/common/mobile/resources/less/icons.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
@import "./ios/icons";
@import "./material/icons";

.icon-svg {
width: 24px;
height: 24px;
}

i.icon {
&.icon-paste {
width: 24px;
Expand Down
5 changes: 5 additions & 0 deletions apps/documenteditor/mobile/src/less/icons-common.less
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

.icon-svg {
fill: @brand-word;
}

// Formats

i.icon {
Expand Down
8 changes: 7 additions & 1 deletion vendor/framework7-react/build/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
},
Expand Down Expand Up @@ -176,7 +177,7 @@ const config = {
],
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
test: /\.(png|jpe?g|gif)(\?.*)?$/,
use: [
{
loader: 'url-loader',
Expand All @@ -189,6 +190,11 @@ const config = {
]
},
{
test: /\.svg$/,
use: {
loader: "svg-sprite-loader",
}
}, {
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
Expand Down

0 comments on commit 60e616b

Please sign in to comment.