Skip to content

Commit

Permalink
feat: add fontSize prop to Polkicon, div -> span (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
rossbulat authored Nov 3, 2024
1 parent 68b440e commit aaf213e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion library/react-polkicon/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@w3ux/react-polkicon-source",
"license": "GPL-3.0-only",
"version": "2.0.0",
"version": "2.0.1-alpha.0",
"type": "module",
"scripts": {
"clear": "rm -rf node_modules dist tsconfig.tsbuildinfo",
Expand Down
9 changes: 6 additions & 3 deletions library/react-polkicon/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const Polkicon = ({
background,
inactive,
transform: propTransform,
fontSize,
}: PolkiconProps) => {
// The colors of the Polkicon and inner circles.
const [colors, setColors] = useState<string[]>([]);
Expand Down Expand Up @@ -55,13 +56,15 @@ export const Polkicon = ({

return (
coords && (
<div
<span
className="polkicon"
style={{
display: "inline-block",
verticalAlign: "-0.125em",
height: "1em",
width: "auto",
verticalAlign: "-0.125em",
transform,
fontSize,
}}
>
<svg
Expand All @@ -82,7 +85,7 @@ export const Polkicon = ({
)
.map(renderCircle)}
</svg>
</div>
</span>
)
);
};
1 change: 1 addition & 0 deletions library/react-polkicon/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface PolkiconProps {
background?: string;
inactive?: boolean;
transform?: TransformProp;
fontSize?: number | string;
}

export type TransformProp =
Expand Down

0 comments on commit aaf213e

Please sign in to comment.