Skip to content

Commit

Permalink
feat: update package icons (#21)
Browse files Browse the repository at this point in the history
* feat: update logic of the icons generation

* fix: code style and remove test release workflow

* feat: added statics icons and fix dynamics

* fix: cleanup

* fix: added zkSync and celo chains icons (without mono versions)
  • Loading branch information
Argeare5 authored Jul 30, 2024
1 parent e12e190 commit aecaf94
Show file tree
Hide file tree
Showing 2,200 changed files with 9,081 additions and 50,753 deletions.
39 changes: 0 additions & 39 deletions .github/workflows/release-node-alpha.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/test-release-alpha.yml

This file was deleted.

23 changes: 7 additions & 16 deletions apps/docs/src/components/AssetIconCard.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
"use client";

import {
AssetTag,
IconVariant,
Web3IconType,
} from "@bgd-labs/react-web3-icons/dist/utils";
import { AssetTag, IconVariant } from "@bgd-labs/react-web3-icons/dist/utils";
import { useState } from "react";

import { IconCard } from "@/components/IconCard";
import { Web3Icon } from "@/components/Web3Icon";
import { AssetIcon } from "@/components/Web3Icons/AssetIcon";
import { githubIconsPath } from "@/utils/constants";

import { IconInfoIcons } from "../../../../src/scripts/types";
Expand Down Expand Up @@ -41,15 +37,6 @@ export const AssetIconCard = ({
][variant]
: icons[variant];

const Icon = () => (
<Web3Icon
iconInfo={{
type: Web3IconType.asset,
info: { symbol, variant, tokenTag: assetTag },
}}
/>
);

return (
<IconCard
svgPath={`${githubIconsPath}${iconPath}`}
Expand All @@ -65,7 +52,11 @@ export const AssetIconCard = ({
setActiveType={setVariant}
activeType={variant}
>
<Icon />
<AssetIcon
symbol={symbol}
assetTag={assetTag}
mono={variant === IconVariant.Mono}
/>
</IconCard>
);
};
10 changes: 2 additions & 8 deletions apps/docs/src/components/ChainIconCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
import {
IconInfoIcons,
IconVariant,
Web3IconType,
} from "@bgd-labs/react-web3-icons/dist/utils";
import { useState } from "react";

import { IconCard } from "@/components/IconCard";
import { Web3Icon } from "@/components/Web3Icon";
import { ChainIcon } from "@/components/Web3Icons/ChainIcon";
import { githubIconsPath } from "@/utils/constants";

export const ChainIconCard = ({
Expand All @@ -21,11 +20,6 @@ export const ChainIconCard = ({
icons: IconInfoIcons;
}) => {
const [variant, setVariant] = useState(IconVariant.Full);
const Icon = () => (
<Web3Icon
iconInfo={{ type: Web3IconType.chain, info: { chainId, variant } }}
/>
);
return (
<IconCard
svgPath={`${githubIconsPath}${icons[variant]}`}
Expand All @@ -35,7 +29,7 @@ export const ChainIconCard = ({
setActiveType={setVariant}
activeType={variant}
>
<Icon />
<ChainIcon chainId={chainId} mono={variant === IconVariant.Mono} />
</IconCard>
);
};
15 changes: 3 additions & 12 deletions apps/docs/src/components/InstalledWalletIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
"use client";

import {
getWeb3WalletName,
IconVariant,
Web3IconType,
} from "@bgd-labs/react-web3-icons/dist/utils";
import { getWeb3WalletName } from "@bgd-labs/react-web3-icons/dist/utils";
import dynamic from "next/dynamic";

import { Web3Icon } from "@/components/Web3Icon";
import { WalletIcon } from "@/components/Web3Icons/WalletIcon";

const InstalledBrowserWalletWallet = () => {
const walletName = getWeb3WalletName();
return (
<div>
{walletName}
<Web3Icon
iconInfo={{
type: Web3IconType.wallet,
info: { walletName, variant: IconVariant.Full },
}}
/>
<WalletIcon walletName={walletName} />
</div>
);
};
Expand Down
14 changes: 2 additions & 12 deletions apps/docs/src/components/WalletIconCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
import {
IconInfoIcons,
IconVariant,
Web3IconType,
} from "@bgd-labs/react-web3-icons/dist/utils";
import { useState } from "react";

import { IconCard } from "@/components/IconCard";
import { Web3Icon } from "@/components/Web3Icon";
import { WalletIcon } from "@/components/Web3Icons/WalletIcon";
import { githubIconsPath } from "@/utils/constants";

export const WalletIconCard = ({
Expand All @@ -19,15 +18,6 @@ export const WalletIconCard = ({
icons: IconInfoIcons;
}) => {
const [variant, setVariant] = useState(IconVariant.Full);
const Icon = () => (
<Web3Icon
iconInfo={{
type: Web3IconType.wallet,
info: { walletName: name, variant },
}}
/>
);

return (
<IconCard
svgPath={`${githubIconsPath}${icons[variant]}`}
Expand All @@ -37,7 +27,7 @@ export const WalletIconCard = ({
setActiveType={setVariant}
activeType={variant}
>
<Icon />
<WalletIcon walletName={name} mono={variant === IconVariant.Mono} />
</IconCard>
);
};
90 changes: 0 additions & 90 deletions apps/docs/src/components/Web3Icon.tsx

This file was deleted.

34 changes: 34 additions & 0 deletions apps/docs/src/components/Web3Icons/AssetIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"use client";

import { AssetIcon as AI } from "@bgd-labs/react-web3-icons";
import {
AssetIconProps,
ExternalComponentBaseProps,
} from "@bgd-labs/react-web3-icons/dist/utils";

import { cn } from "@/utils/cn";

/**
* Renders an asset icon specified by symbol.
*/
export const AssetIcon = ({
symbol,
className,
...props
}: AssetIconProps & ExternalComponentBaseProps) => {
return (
<AI
symbol={symbol}
className={cn("size-[70px]", className)}
loader={
<div
className={cn(
"size-[70px] animate-pulse rounded-full bg-brand-300",
className,
)}
/>
}
{...props}
/>
);
};
30 changes: 30 additions & 0 deletions apps/docs/src/components/Web3Icons/ChainIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"use client";

import { StaticChainIcon as CI } from "@bgd-labs/react-web3-icons";
import { ExternalComponentBaseProps } from "@bgd-labs/react-web3-icons/dist/utils";

import { cn } from "@/utils/cn";

interface ChainIconProps extends ExternalComponentBaseProps {
chainId: number;
}
/**
* Renders a chain icon specified by chainId.
*/
export const ChainIcon = ({ chainId, className, ...props }: ChainIconProps) => {
return (
<CI
chainId={chainId}
className={cn("size-[70px]", className)}
loader={
<div
className={cn(
"size-[70px] animate-pulse rounded-full bg-brand-300",
className,
)}
/>
}
{...props}
/>
);
};
34 changes: 34 additions & 0 deletions apps/docs/src/components/Web3Icons/WalletIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"use client";

import { WalletIcon as WI } from "@bgd-labs/react-web3-icons";
import { ExternalComponentBaseProps } from "@bgd-labs/react-web3-icons/dist/utils/index";

import { cn } from "@/utils/cn";

interface WalletIconProps extends ExternalComponentBaseProps {
walletName: string;
}
/**
* Renders a wallet icon specified by walletName.
*/
export const WalletIcon = ({
walletName,
className,
...props
}: WalletIconProps) => {
return (
<WI
walletName={walletName}
className={cn("size-[70px]", className)}
loader={
<div
className={cn(
"size-[70px] animate-pulse rounded-full bg-brand-300",
className,
)}
/>
}
{...props}
/>
);
};
Loading

0 comments on commit aecaf94

Please sign in to comment.