Skip to content

Commit 3eae2d3

Browse files
committed
new icons
1 parent f241913 commit 3eae2d3

File tree

7 files changed

+58
-32
lines changed

7 files changed

+58
-32
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
"devDependencies": {
4545
"@biomejs/biome": "2.3.1",
4646
"@cloudflare/workers-types": "^4.20251014.0",
47+
"@magicons/hero-icons": "^0.0.3",
48+
"@magicons/react": "^0.0.1",
4749
"@testing-library/jest-dom": "^6.9.1",
4850
"@testing-library/react": "^16.0.1",
4951
"@testing-library/user-event": "^14.6.1",
@@ -58,6 +60,7 @@
5860
"@vitest/coverage-v8": "^4.0.4",
5961
"autoprefixer": "^10.4.21",
6062
"jsdom": "^27.0.1",
63+
"magicons": "^0.0.3",
6164
"playwright": "^1.56.1",
6265
"rollup-plugin-visualizer": "^6.0.5",
6366
"tailwindcss": "^4.1.16",

pnpm-lock.yaml

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/SearchBar.tsx

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Icon } from "@magicons/react";
12
import { useState } from "react";
23
import { useNavigate } from "react-router-dom";
34

@@ -61,20 +62,7 @@ export function SearchBar({
6162
<button
6263
type="submit"
6364
className="px-4 py-2 bg-blue-500 hover:bg-blue-600 text-white rounded-r-lg transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500">
64-
<svg
65-
className="w-5 h-5"
66-
fill="none"
67-
stroke="currentColor"
68-
viewBox="0 0 24 24"
69-
xmlns="http://www.w3.org/2000/svg">
70-
<title>Search</title>
71-
<path
72-
strokeLinecap="round"
73-
strokeLinejoin="round"
74-
strokeWidth={2}
75-
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
76-
/>
77-
</svg>
65+
<Icon src="@hero-MagnifyingGlass" />
7866
</button>
7967
</form>
8068
);

src/pages/Product.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ShoppingBagIcon, UserIcon } from "@heroicons/react/24/outline";
1+
import { Icon } from "@magicons/react";
22
import { lazy, Suspense, useEffect, useState } from "react";
33
import { Link, useParams } from "react-router-dom";
44
import ColorPicker from "../components/ColorPicker";
@@ -55,13 +55,18 @@ export default function ProductPage() {
5555
href="/profile"
5656
className="p-2 text-gray-400 hover:text-gray-500 lg:ml-4">
5757
<span className="sr-only">Account</span>
58-
<UserIcon aria-hidden="true" className="h-6 w-6" />
58+
<Icon
59+
src="@hero-User"
60+
aria-hidden="true"
61+
className="h-6 w-6"
62+
/>
5963
</a>
6064

6165
{/* Cart */}
6266
<div className="ml-4 flow-root lg:ml-6">
6367
<Link to="/cart" className="group -m-2 flex items-center p-2">
64-
<ShoppingBagIcon
68+
<Icon
69+
src="@hero-ShoppingBag"
6570
aria-hidden="true"
6671
className="h-6 w-6 shrink-0 text-gray-400 group-hover:text-gray-500"
6772
/>

src/pages/SearchResults.tsx

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Icon } from "@magicons/react";
12
import { useEffect, useState } from "react";
23
import { Link, useSearchParams } from "react-router-dom";
34
import { BASE_URL } from "../config";
@@ -111,20 +112,7 @@ export default function SearchResults() {
111112
{products.length === 0 && query ? (
112113
<div className="text-center py-12">
113114
<div className="text-gray-400 mb-4">
114-
<svg
115-
className="w-16 h-16 mx-auto"
116-
fill="none"
117-
stroke="currentColor"
118-
viewBox="0 0 24 24"
119-
xmlns="http://www.w3.org/2000/svg">
120-
<title>No products found</title>
121-
<path
122-
strokeLinecap="round"
123-
strokeLinejoin="round"
124-
strokeWidth={1}
125-
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
126-
/>
127-
</svg>
115+
<Icon src="@hero-MagnifyingGlass" />
128116
</div>
129117
<h3 className="text-lg font-medium text-gray-900 mb-2">
130118
No products found

tsconfig.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@
2121
"noFallthroughCasesInSwitch": true,
2222
"types": [
2323
"@cloudflare/workers-types/2023-07-01",
24-
"vitest"
24+
"vitest",
25+
"@magicons/hero-icons",
26+
"@magicons/lucide-icons",
27+
"@magicons/mdi-icons"
2528
]
2629
},
30+
2731
"include": ["src"],
2832
"references": [{ "path": "./tsconfig.node.json" }]
2933
}

vite.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ import tailwindcss from '@tailwindcss/vite';
22
import viteReact from '@vitejs/plugin-react';
33
import { defineConfig } from 'vite';
44
import { visualizer } from "rollup-plugin-visualizer";
5+
import { magicons } from 'magicons'
56

67

78
const isAnalyze = process.env.ANALYZE === 'true';
89

910

1011
export default defineConfig({
1112
plugins: [viteReact(), tailwindcss(),
13+
magicons(),
1214
(isAnalyze) &&
1315
visualizer({
1416
filename: 'stats.html',

0 commit comments

Comments
 (0)