Skip to content

Commit 4876ad6

Browse files
committedDec 18, 2024·
update icon
1 parent f2a9c27 commit 4876ad6

18 files changed

+78
-67
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,4 @@ apps/docs/src/data/mesh-wallets.json
4848

4949
# svelte
5050
.svelte-kit/
51+
vite.config.ts.*

‎apps/playground/src/components/card/card-title-desc-image.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,31 @@ import React from "react";
22
import Image from "next/image";
33

44
import Link from "~/components/link";
5+
import Icon from "../icon";
56
import Card from "./card";
67

78
export default function CardTitleDescImage({
89
title,
910
desc,
1011
link,
11-
thumbnailHeroicon,
12+
icon,
1213
thumbnailImage,
1314
thumbnailNotioly,
1415
}: {
1516
title: string;
1617
desc?: string;
1718
link: string;
18-
thumbnailHeroicon?: any;
19+
icon?: any;
1920
thumbnailImage?: string;
2021
thumbnailNotioly?: string;
2122
}) {
2223
return (
2324
<Link href={link}>
2425
<Card className="h-full cursor-pointer">
2526
<div className="flex flex-row items-center gap-2">
26-
{thumbnailHeroicon ? (
27+
{icon ? (
2728
<div className="w-8 dark:text-white">
28-
{React.createElement(thumbnailHeroicon)}
29+
<Icon icon={icon} />
2930
</div>
3031
) : thumbnailNotioly ? (
3132
<div className="relative h-40 w-full bg-white">
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React from "react";
2+
3+
export default function Icon({
4+
icon,
5+
className,
6+
}: {
7+
icon: any;
8+
className?: string;
9+
}) {
10+
if (icon) {
11+
if (typeof icon === "object" || typeof icon === "function") {
12+
return React.createElement(icon, { className: className });
13+
}
14+
15+
if (typeof icon === "string") {
16+
return <img src={icon} alt={icon} className={className} />;
17+
}
18+
}
19+
20+
return <></>;
21+
}

‎apps/playground/src/components/layouts/header-and-cards.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default function HeaderAndCards({
2727
title={item.title}
2828
desc={item.desc}
2929
link={item.link}
30-
thumbnailHeroicon={item.icon}
30+
icon={item.icon}
3131
thumbnailImage={item.thumbnail}
3232
key={i}
3333
/>

‎apps/playground/src/components/link/index.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import React from "react";
22
import NextLink from "next/link";
33

4+
import Icon from "../icon";
5+
46
export default function Link({
57
children,
68
href,
@@ -21,7 +23,7 @@ export default function Link({
2123
target={target ? target : href.startsWith("http") ? "_blank" : "_self"}
2224
rel="noreferrer"
2325
>
24-
{icon && React.createElement(icon, { className: "mr-2 w-4 h-4" })}
26+
<Icon icon={icon} className="mr-2 h-4 w-4" />
2527
{children}
2628
</NextLink>
2729
);

‎apps/playground/src/components/site/footer/index.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from "react";
22
import Image from "next/image";
33

4+
import Icon from "~/components/icon";
45
import Link from "~/components/link";
56
import { socials } from "~/data/social";
67
import Sitemap from "./sitemap";
@@ -42,9 +43,7 @@ export default function Footer() {
4243
className="text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white"
4344
key={i}
4445
>
45-
{React.createElement(social.icon, {
46-
className: "w-5 h-5",
47-
})}
46+
<Icon icon={social.icon} className="h-5 w-5" />
4847
</Link>
4948
</li>
5049
);

‎apps/playground/src/components/site/navbar/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
XMarkIcon,
88
} from "@heroicons/react/24/solid";
99

10+
import Icon from "~/components/icon";
1011
import Link from "~/components/link";
1112
import SvgMesh from "~/components/svgs/mesh";
1213
import { linksAbout } from "~/data/links-about";
@@ -131,7 +132,7 @@ export default function Navbar() {
131132
key={i}
132133
aria-label={social.link}
133134
>
134-
{React.createElement(social.icon, { className: "w-6 h-6" })}
135+
<Icon icon={social.icon} className="h-6 w-6" />
135136
</Link>
136137
);
137138
})}

‎apps/playground/src/components/site/navbar/submenu-item-dropdown.tsx

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React, { useState } from "react";
2-
import Link from "~/components/link";
32
import { ChevronRightIcon } from "@heroicons/react/24/solid";
43

4+
import Icon from "~/components/icon";
5+
import Link from "~/components/link";
56
import { MenuItem } from "~/types/menu-item";
67

78
export default function SubmenuItemDropdown({
@@ -26,10 +27,10 @@ export default function SubmenuItemDropdown({
2627
<Link href={link ?? "#"}>
2728
<button
2829
type="button"
29-
className="hover:text-black dark:hover:text-white flex w-full items-center justify-between px-4 py-2"
30+
className="flex w-full items-center justify-between px-4 py-2 hover:text-black dark:hover:text-white"
3031
>
3132
<span className="flex items-center">
32-
{icon && React.createElement(icon, { className: "mr-2 w-4 h-4" })}
33+
<Icon icon={icon} className="mr-2 h-4 w-4" />
3334
{title}
3435
</span>
3536
<ChevronRightIcon className="h-4 w-4" />
@@ -71,9 +72,9 @@ function Item({
7172
<li>
7273
<Link
7374
href={link}
74-
className="hover:text-black dark:hover:text-white flex w-full items-center px-4 py-2"
75+
className="flex w-full items-center px-4 py-2 hover:text-black dark:hover:text-white"
7576
>
76-
{icon && React.createElement(icon, { className: "mr-2 w-4 h-4" })}
77+
<Icon icon={icon} className="mr-2 h-4 w-4" />
7778
{title}
7879
</Link>
7980
</li>

‎apps/playground/src/components/site/navbar/submenu-item.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from "react";
22

3+
import Icon from "~/components/icon";
34
import Link from "~/components/link";
45

56
export default function SubmenuItem({
@@ -15,10 +16,10 @@ export default function SubmenuItem({
1516
<li>
1617
<Link
1718
href={link}
18-
className="hover:text-black dark:hover:text-white flex w-full items-center px-4 py-2"
19+
className="flex w-full items-center px-4 py-2 hover:text-black dark:hover:text-white"
1920
target={link.startsWith("http") ? "_blank" : "_self"}
2021
>
21-
{icon && React.createElement(icon, { className: "mr-2 w-4 h-4" })}
22+
<Icon icon={icon} className="mr-2 w-4 h-4" />
2223
{title}
2324
</Link>
2425
</li>

‎apps/playground/src/components/svgs/discord.tsx

-8
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@ const SvgDiscord = ({
66
fill?: string;
77
}) => {
88
return (
9-
// <svg
10-
// xmlns="http://www.w3.org/2000/svg"
11-
// viewBox="0 0 48 48"
12-
// className={className}
13-
// fill={fill}
14-
// >
15-
// <path d="M39.248,10.177c-2.804-1.287-5.812-2.235-8.956-2.778c-0.057-0.01-0.114,0.016-0.144,0.068 c-0.387,0.688-0.815,1.585-1.115,2.291c-3.382-0.506-6.747-0.506-10.059,0c-0.3-0.721-0.744-1.603-1.133-2.291 c-0.03-0.051-0.087-0.077-0.144-0.068c-3.143,0.541-6.15,1.489-8.956,2.778c-0.024,0.01-0.045,0.028-0.059,0.051 c-5.704,8.522-7.267,16.835-6.5,25.044c0.003,0.04,0.026,0.079,0.057,0.103c3.763,2.764,7.409,4.442,10.987,5.554 c0.057,0.017,0.118-0.003,0.154-0.051c0.846-1.156,1.601-2.374,2.248-3.656c0.038-0.075,0.002-0.164-0.076-0.194 c-1.197-0.454-2.336-1.007-3.432-1.636c-0.087-0.051-0.094-0.175-0.014-0.234c0.231-0.173,0.461-0.353,0.682-0.534 c0.04-0.033,0.095-0.04,0.142-0.019c7.201,3.288,14.997,3.288,22.113,0c0.047-0.023,0.102-0.016,0.144,0.017 c0.22,0.182,0.451,0.363,0.683,0.536c0.08,0.059,0.075,0.183-0.012,0.234c-1.096,0.641-2.236,1.182-3.434,1.634 c-0.078,0.03-0.113,0.12-0.075,0.196c0.661,1.28,1.415,2.498,2.246,3.654c0.035,0.049,0.097,0.07,0.154,0.052 c3.595-1.112,7.241-2.79,11.004-5.554c0.033-0.024,0.054-0.061,0.057-0.101c0.917-9.491-1.537-17.735-6.505-25.044 C39.293,10.205,39.272,10.187,39.248,10.177z M16.703,30.273c-2.168,0-3.954-1.99-3.954-4.435s1.752-4.435,3.954-4.435 c2.22,0,3.989,2.008,3.954,4.435C20.658,28.282,18.906,30.273,16.703,30.273z M31.324,30.273c-2.168,0-3.954-1.99-3.954-4.435 s1.752-4.435,3.954-4.435c2.22,0,3.989,2.008,3.954,4.435C35.278,28.282,33.544,30.273,31.324,30.273z" />
16-
// </svg>
179
<svg
1810
xmlns="http://www.w3.org/2000/svg"
1911
viewBox="0 0 512 512"

‎apps/playground/src/components/text/header2.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import React from "react";
22

3+
import Icon from "../icon";
4+
35
export default function Header2({
46
children,
57
heroicon,
@@ -12,7 +14,7 @@ export default function Header2({
1214
<Title>
1315
<div className="flex items-center">
1416
<div className="mr-4 p-2">
15-
{React.createElement(heroicon, { className: "w-16 h-16" })}
17+
<Icon icon={heroicon} className="h-16 w-16" />
1618
</div>
1719
<span>{children}</span>
1820
</div>

‎apps/playground/src/data/catalyst.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const fund13 = [
1919
`Transaction building`,
2020
`End-to-end working example`,
2121
],
22-
status: "Voting",
22+
status: "In Progress",
2323
},
2424
{
2525
title: "Cardano Devkit - 'Ganache' of Cardano for better DevXP",
@@ -31,7 +31,8 @@ export const fund13 = [
3131
`Desktop app to launch local blockchain`,
3232
`Get blockchain data e.g. UTXOs and balances`,
3333
],
34-
status: "Voting",
34+
status: "In Progress",
35+
funded: false
3536
},
3637
{
3738
title: "Cquisitor - Transaction Investigation Tool",
@@ -44,7 +45,7 @@ export const fund13 = [
4445
`Phase-2 validation`,
4546
`Integration with Whisky and Mesh`,
4647
],
47-
status: "Voting",
48+
status: "In Progress",
4849
},
4950
{
5051
title: "Multisig Platform",
@@ -58,7 +59,7 @@ export const fund13 = [
5859
`Fluidtokens and Minswap integrations`,
5960
`Plutus script multisig wallet`,
6061
],
61-
status: "Voting",
62+
status: "In Progress",
6263
},
6364
{
6465
title: "Builder Fest #2 in Asia",
@@ -69,7 +70,7 @@ export const fund13 = [
6970
`Gathering of developers in Vietnam`,
7071
`Increase collaboration between projects for Cardano ecosystem open-source`,
7172
],
72-
status: "Voting",
73+
status: "In Progress",
7374
},
7475
{
7576
title: "Maintain Mesh and Build Developer Community",
@@ -82,7 +83,7 @@ export const fund13 = [
8283
`Create tutorials and documentation`,
8384
`Create workshops and live coding sessions`,
8485
],
85-
status: "Voting",
86+
status: "In Progress",
8687
},
8788
];
8889

‎apps/playground/src/data/links-aiken.ts

+1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@ export const metaAiken: MenuItem = {
3939
desc: "A functional programming language created for Cardano smart contract development",
4040
link: "/aiken",
4141
items: linksAiken,
42+
icon: "/images/aiken/aiken-icon.png",
4243
};

‎apps/playground/src/data/links-yaci.ts

+1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ export const metaYaci: MenuItem = {
3232
desc: "A custom Cardano devnet to tailor your devnet needs with a builtin indexer",
3333
link: "/yaci",
3434
items: linksYaci,
35+
icon: "/providers/yaci.png",
3536
};
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export const searchBlacklistLinks = [
2-
"https://meshjs.dev/",
32
"https://meshjs.dev/apis/wallets/appwallet",
3+
"https://pbl.meshjs.dev",
4+
"https://meshjs.dev/about/catalyst",
45
];

‎apps/playground/src/pages/about/catalyst/index.tsx

+17-32
Original file line numberDiff line numberDiff line change
@@ -31,37 +31,15 @@ function Section({ title, items }: { title: string; items: any[] }) {
3131
<Header3>{title}</Header3>
3232
<div className="grid w-full grid-cols-1 gap-2 lg:grid-cols-3">
3333
{items.map((item, index) => (
34-
<CardLink
35-
title={item.title}
36-
desc={item.desc}
37-
url={item.url}
38-
completed={item.completed}
39-
tobecompleted={item.tobecompleted}
40-
status={item.status}
41-
key={index}
42-
/>
34+
<CardLink item={item} key={index} />
4335
))}
4436
</div>
4537
</div>
4638
</div>
4739
);
4840
}
4941

50-
function CardLink({
51-
title,
52-
desc,
53-
url,
54-
completed,
55-
tobecompleted,
56-
status,
57-
}: {
58-
title: string;
59-
desc: string;
60-
url?: string;
61-
completed: string[];
62-
tobecompleted: string[];
63-
status: string;
64-
}) {
42+
function CardLink({ item }: { item: any }) {
6543
function getDomain(url) {
6644
url = url.replace(/(https?:\/\/)?(www.)?/i, "");
6745

@@ -74,16 +52,23 @@ function CardLink({
7452
return (
7553
<div className="block max-w-sm rounded-lg border border-gray-200 bg-white p-6 shadow dark:border-gray-700 dark:bg-gray-800">
7654
<h5 className="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">
77-
{title}
55+
{item.title}
7856
</h5>
7957
<div className="mb-2 flex gap-2">
8058
<span className="me-2 rounded bg-green-100 px-2.5 py-0.5 text-xs font-medium text-green-800 dark:bg-green-900 dark:text-green-300">
81-
{status}
59+
{item.status}
8260
</span>
61+
{item.funded != undefined && item.funded == false && (
62+
<span className="rounded bg-red-100 px-2.5 py-0.5 text-xs font-medium text-red-800 dark:bg-red-900 dark:text-red-300">
63+
Not funded
64+
</span>
65+
)}
8366
</div>
84-
<p className="font-normal text-gray-700 dark:text-gray-400">{desc}</p>
67+
<p className="font-normal text-gray-700 dark:text-gray-400">
68+
{item.desc}
69+
</p>
8570
<ul className="mt-4 text-sm text-gray-500 dark:text-gray-300">
86-
{completed.map((item, index) => (
71+
{item.completed.map((item, index) => (
8772
<li key={index} className="flex">
8873
<div className="mr-2 h-4 w-4">
8974
<svg
@@ -106,7 +91,7 @@ function CardLink({
10691
))}
10792
</ul>
10893
<ul className="mt-4 text-sm text-gray-500 dark:text-gray-300">
109-
{tobecompleted.map((item, index) => (
94+
{item.tobecompleted.map((item, index) => (
11095
<li key={index} className="flex">
11196
<div className="mr-2 h-4 w-4">
11297
<svg
@@ -123,11 +108,11 @@ function CardLink({
123108
</li>
124109
))}
125110
</ul>
126-
{url && (
111+
{item.url && (
127112
<div className="mt-4 text-sm text-gray-500 dark:text-gray-300">
128-
<Link href={url}>
113+
<Link href={item.url}>
129114
<span className="text-blue-500 hover:text-blue-700">
130-
{getDomain(url)}
115+
{getDomain(item.url)}
131116
</span>
132117
</Link>
133118
</div>

‎apps/playground/src/pages/api/google/search.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ export default async function handler(
4040
if (item.htmlSnippet.includes("&middot;")) {
4141
return false;
4242
}
43-
if (searchBlacklistLinks.includes(item.link)) {
43+
// if link is in blacklist, filter it out
44+
if (searchBlacklistLinks.some((link) => item.link.includes(link))) {
4445
return false;
4546
}
4647
return true;

‎apps/playground/src/pages/home/features.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function SectionFeatures() {
1212
title={item.title}
1313
desc={item.desc}
1414
link={item.link}
15-
thumbnailHeroicon={item.icon}
15+
icon={item.icon}
1616
thumbnailImage={item.thumbnail}
1717
key={i}
1818
/>

0 commit comments

Comments
 (0)
Please sign in to comment.