Skip to content

Commit

Permalink
Only replace color if present, was causing bug with original style
Browse files Browse the repository at this point in the history
Removed use client directive, caused failure in github build
  • Loading branch information
Shane Williams committed Nov 3, 2024
1 parent 030f785 commit c140dcd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/DevIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use client";

import { type CSSProperties, useCallback, useEffect, useState } from "react";
import { Loader } from "./components/loader";
import { type Scale, dimensions } from "./lib/constants/size";
Expand Down Expand Up @@ -106,10 +104,12 @@ export function DevIcon(props: DevIconProps) {
style={style}
// Replace all color values to the provided color
dangerouslySetInnerHTML={{
__html: svgContent.replace(
/fill="[^"]*"/g,
`fill="${props.color || "currentColor"}"`,
),
__html: props?.color
? svgContent.replace(
/fill="[^"]*"/g,
`fill="${props.color || "currentColor"}"`,
)
: svgContent,
}}
/>
);
Expand Down

0 comments on commit c140dcd

Please sign in to comment.