Skip to content

Commit

Permalink
Add excludes & wrap in div
Browse files Browse the repository at this point in the history
  • Loading branch information
Zerthox committed Dec 4, 2023
1 parent e6405b4 commit 997706b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions src/SVGInspect/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import {createPlugin, Finder, React} from "dium";

const components = Finder.all.bySource(
[(source) => /\.(?:createElement|jsxs?)\)?\("svg",/.test(source)],
{entries: true}
);
const excludes = [".bodyWaveGradient", ".circleOverlay"];

const components = Finder.all.bySource([
(source) => /\.(?:createElement|jsxs?)\)?\("svg",/.test(source) && !excludes.some((fragment) => source.includes(fragment))
], {entries: true});

interface ErrorBoundaryProps {
children?: React.ReactNode;
Expand All @@ -30,9 +31,11 @@ export default createPlugin({
SettingsPanel: () => (
<>
{components.map((SVG, i) => (
<ErrorBoundary key={i}>
<SVG open/>
</ErrorBoundary>
<div key={i}>
<ErrorBoundary>
<SVG open/>
</ErrorBoundary>
</div>
))}
</>
)
Expand Down
2 changes: 1 addition & 1 deletion src/SVGInspect/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "SVGInspect",
"author": "Zerthox",
"version": "0.1.2",
"version": "0.1.3",
"description": "View all SVG components bundled in Discord",
"dependencies": {
"dium": "*"
Expand Down

0 comments on commit 997706b

Please sign in to comment.