Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 2f0f640

Browse files
authored
feat: install heroicons (#57)
* chore: installed heroicons * chore: reorganized icons
1 parent 99f3b19 commit 2f0f640

31 files changed

+262
-175
lines changed

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gitcoin-ui",
3-
"version": "0.0.10",
3+
"version": "0.0.0",
44
"type": "module",
55
"types": "./dist/index.d.ts",
66
"main": "./dist/index.js",
@@ -106,6 +106,7 @@
106106
]
107107
},
108108
"dependencies": {
109+
"@heroicons/react": "1.0.6",
109110
"@hookform/resolvers": "^3.9.0",
110111
"@radix-ui/react-accordion": "^1.2.1",
111112
"@radix-ui/react-alert-dialog": "^1.1.2",
@@ -159,4 +160,4 @@
159160
"vite-plugin-wasm": "^3.3.0",
160161
"zod": "^3.23.8"
161162
}
162-
}
163+
}

pnpm-lock.yaml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/assets/icons/calendar.svg

-3
This file was deleted.

src/assets/icons/check.svg

-3
This file was deleted.

src/assets/icons/clipboardList.svg

-4
This file was deleted.

src/assets/icons/clock.svg

-3
This file was deleted.
File renamed without changes.
File renamed without changes.

src/assets/icons/custom/index.ts

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import CheckerIcon from "./checker.svg?react";
2+
import ExplorerIcon from "./explorer.svg?react";
3+
import ShineIcon from "./shine.svg?react";
4+
import UserIcon from "./user.svg?react";
5+
import VerifiedBadgeIcon from "./verifiedBadge.svg?react";
6+
7+
enum CustomIconType {
8+
CHECKER = "checker",
9+
EXPLORER = "explorer",
10+
SHINE = "shine",
11+
USER = "user",
12+
VERIFIEDBADGE = "verifiedBadge",
13+
}
14+
15+
const customIconComponents: Record<CustomIconType, React.FC<React.SVGProps<SVGSVGElement>>> = {
16+
checker: CheckerIcon,
17+
explorer: ExplorerIcon,
18+
shine: ShineIcon,
19+
user: UserIcon,
20+
verifiedBadge: VerifiedBadgeIcon,
21+
};
22+
const customIcons = Object.keys(customIconComponents).sort((a, b) =>
23+
a.localeCompare(b),
24+
) as CustomIconType[];
25+
26+
export { CheckerIcon, ExplorerIcon, ShineIcon, UserIcon, VerifiedBadgeIcon };
27+
export { CustomIconType, customIconComponents, customIcons };
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/assets/icons/exclamationCircle.svg

-3
This file was deleted.

src/assets/icons/globe.svg

-3
This file was deleted.

src/assets/icons/heroicons.ts

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
// Status Icons
2+
import { InformationCircleIcon } from "@heroicons/react/outline";
3+
import {
4+
CalendarIcon,
5+
CheckCircleIcon as CheckSolidIcon,
6+
CheckIcon,
7+
ChevronLeftIcon,
8+
ChevronRightIcon,
9+
ClipboardListIcon,
10+
ClockIcon,
11+
ExclamationCircleIcon,
12+
GlobeAltIcon as GlobeIcon,
13+
LinkIcon,
14+
QuestionMarkCircleIcon as SolidQuestionMarkCircleIcon,
15+
SparklesIcon,
16+
StarIcon,
17+
XCircleIcon as XSolidIcon,
18+
XIcon,
19+
} from "@heroicons/react/solid";
20+
21+
enum HeroiconsType {
22+
CALENDAR = "calendar",
23+
CHECK = "check",
24+
CHEVRON_LEFT = "chevron-left",
25+
CLIPBOARD_LIST = "clipboardList",
26+
CLOCK = "clock",
27+
EXCLAMATION_CIRCLE = "exclamation-circle",
28+
LINK = "link",
29+
GLOBE = "globe",
30+
INFORMATION_CIRCLE = "informationCircle",
31+
SOLID_CHECK = "solid-check",
32+
SOLID_QUESTION_MARK_CIRCLE = "questionMarkCircle",
33+
SOLID_X = "solid-x",
34+
SPARKLES = "sparkles",
35+
STAR = "star",
36+
X = "x",
37+
}
38+
39+
const heroiconsComponents: Record<HeroiconsType, React.FC<React.SVGProps<SVGSVGElement>>> = {
40+
calendar: CalendarIcon,
41+
check: CheckIcon,
42+
"chevron-left": ChevronLeftIcon,
43+
clipboardList: ClipboardListIcon,
44+
clock: ClockIcon,
45+
"exclamation-circle": ExclamationCircleIcon,
46+
informationCircle: InformationCircleIcon,
47+
globe: GlobeIcon,
48+
link: LinkIcon,
49+
questionMarkCircle: SolidQuestionMarkCircleIcon,
50+
"solid-check": CheckSolidIcon,
51+
sparkles: SparklesIcon,
52+
star: StarIcon,
53+
"solid-x": XSolidIcon,
54+
x: XIcon,
55+
};
56+
57+
const heroIcons = Object.keys(heroiconsComponents).sort((a, b) =>
58+
a.localeCompare(b),
59+
) as HeroiconsType[];
60+
61+
export {
62+
CalendarIcon,
63+
CheckSolidIcon,
64+
CheckIcon,
65+
ChevronLeftIcon,
66+
ChevronRightIcon,
67+
ClipboardListIcon,
68+
ClockIcon,
69+
ExclamationCircleIcon,
70+
InformationCircleIcon,
71+
GlobeIcon,
72+
LinkIcon,
73+
SolidQuestionMarkCircleIcon,
74+
SparklesIcon,
75+
StarIcon,
76+
XSolidIcon,
77+
XIcon,
78+
};
79+
80+
export { heroiconsComponents, HeroiconsType, heroIcons };

src/assets/icons/index.ts

+6-36
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,10 @@
1-
// Status Icons
2-
export { default as CheckIcon } from "./check.svg?react";
3-
// Solid Check Icon
4-
export { default as CheckSolidIcon } from "./solid/check.svg?react";
5-
export { default as ExclamationCircleIcon } from "./exclamationCircle.svg?react";
6-
export { default as XIcon } from "./x.svg?react";
7-
export { default as LinkIcon } from "./link.svg?react";
8-
export { default as clipboardListIcon } from "./clipboardList.svg?react";
9-
export { default as StarIcon } from "./star.svg?react";
10-
export { default as InformationCircleIcon } from "./information_circle.svg?react";
11-
12-
// Solid X Icon
13-
export { default as XSolidIcon } from "./solid/x.svg?react";
14-
export { default as SolidQuestionMarkCircleIcon } from "./solid/questionMarkCircle.svg?react";
15-
export { default as ChevronLeftIcon } from "./solid/chevron-left.svg?react";
16-
17-
// Time Icons
18-
export { default as ClockIcon } from "./clock.svg?react";
19-
export { default as CalendarIcon } from "./calendar.svg?react";
20-
21-
// Miscellaneous Icons
22-
export { default as SparklesIcon } from "./sparkles.svg?react";
23-
export { default as ShineIcon } from "./shine.svg?react";
24-
export { default as UserIcon } from "./user.svg?react";
25-
export { default as VerifiedBadgeIcon } from "./verifiedBadge.svg?react";
26-
export { default as GlobeIcon } from "./globe.svg?react";
27-
export { default as ExplorerIcon } from "./explorer.svg?react";
28-
export { default as CheckerIcon } from "./checker.svg?react";
1+
export * from "./heroicons";
292

303
// Social Media Icons
31-
export { default as GithubIcon } from "./github.svg?react";
32-
export { default as TwitterIcon } from "./twitter.svg?react";
4+
export * from "./socialMedia";
335

346
// Cryptocurrency Icons
35-
export { default as ETHIcon } from "./networks/eth.svg?react";
36-
export { default as PolygonIcon } from "./networks/polygon.svg?react";
37-
export { default as ArbitrumIcon } from "./networks/arbitrum.svg?react";
38-
export { default as AvaxIcon } from "./networks/avax.svg?react";
39-
export { default as BaseIcon } from "./networks/base.svg?react";
40-
export { default as OptimismIcon } from "./networks/optimism.svg?react";
7+
export * from "./networks";
8+
9+
// Custom Icons
10+
export * from "./custom";

src/assets/icons/information_circle.svg

-3
This file was deleted.

src/assets/icons/link.svg

-4
This file was deleted.

src/assets/icons/networks/index.ts

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import ArbitrumIcon from "./arbitrum.svg?react";
2+
import AvaxIcon from "./avax.svg?react";
3+
import BaseIcon from "./base.svg?react";
4+
import ETHIcon from "./eth.svg?react";
5+
import OptimismIcon from "./optimism.svg?react";
6+
import PolygonIcon from "./polygon.svg?react";
7+
8+
enum NetworkIconType {
9+
ETH = "eth",
10+
OPTIMISM = "optimism",
11+
POLYGON = "polygon",
12+
ARBITRUM = "arbitrum",
13+
AVAX = "avax",
14+
BASE = "base",
15+
}
16+
17+
const networkIconComponents: Record<NetworkIconType, React.FC<React.SVGProps<SVGSVGElement>>> = {
18+
arbitrum: ArbitrumIcon,
19+
avax: AvaxIcon,
20+
base: BaseIcon,
21+
eth: ETHIcon,
22+
optimism: OptimismIcon,
23+
polygon: PolygonIcon,
24+
};
25+
26+
const networkIcons = Object.keys(networkIconComponents).sort((a, b) =>
27+
a.localeCompare(b),
28+
) as NetworkIconType[];
29+
30+
export { ArbitrumIcon, AvaxIcon, BaseIcon, ETHIcon, OptimismIcon, PolygonIcon };
31+
export { NetworkIconType, networkIconComponents, networkIcons };
File renamed without changes.

src/assets/icons/socialMedia/index.ts

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import GithubIcon from "./github.svg?react";
2+
import TwitterIcon from "./twitter.svg?react";
3+
4+
enum SocialMediaIconType {
5+
TWITTER = "twitter",
6+
GITHUB = "github",
7+
}
8+
9+
const socialMediaIconComponents: Record<
10+
SocialMediaIconType,
11+
React.FC<React.SVGProps<SVGSVGElement>>
12+
> = {
13+
twitter: TwitterIcon,
14+
github: GithubIcon,
15+
};
16+
17+
const socialMediaIcons = Object.keys(socialMediaIconComponents).sort((a, b) =>
18+
a.localeCompare(b),
19+
) as SocialMediaIconType[];
20+
21+
export { GithubIcon, TwitterIcon };
22+
export { SocialMediaIconType, socialMediaIconComponents, socialMediaIcons };
File renamed without changes.

src/assets/icons/solid/check.svg

-3
This file was deleted.

src/assets/icons/solid/chevron-left.svg

-5
This file was deleted.

src/assets/icons/solid/questionMarkCircle.svg

-3
This file was deleted.

src/assets/icons/solid/x.svg

-3
This file was deleted.

src/assets/icons/sparkles.svg

-4
This file was deleted.

src/assets/icons/star.svg

-10
This file was deleted.

src/assets/icons/x.svg

-3
This file was deleted.

0 commit comments

Comments
 (0)