Skip to content

Commit 88ac46e

Browse files
committed
Make a spritesheet
1 parent 08415d8 commit 88ac46e

File tree

20 files changed

+88
-282
lines changed

20 files changed

+88
-282
lines changed

src/app/(main)/resources/[category]/icons/ballerina.svg

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/app/(main)/resources/[category]/icons/c-net.svg

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/app/(main)/resources/[category]/icons/clojure.svg

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/app/(main)/resources/[category]/icons/elixir.svg

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/app/(main)/resources/[category]/icons/elm.svg

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/app/(main)/resources/[category]/icons/flutter.svg

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/app/(main)/resources/[category]/icons/go.svg

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/app/(main)/resources/[category]/icons/haskell.svg

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 33 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,35 @@
1-
import type { ComponentType, SVGProps } from "react"
1+
import type { SVGProps } from "react"
22

3-
import Ballerina from "./ballerina.svg?svgr"
4-
import CNet from "./c-net.svg?svgr"
5-
import Clojure from "./clojure.svg?svgr"
6-
import Elixir from "./elixir.svg?svgr"
7-
import Elm from "./elm.svg?svgr"
8-
import Flutter from "./flutter.svg?svgr"
9-
import GoIcon from "./go.svg?svgr"
10-
import Haskell from "./haskell.svg?svgr"
11-
import JavaKotlinAndroid from "./java-kotlin-android.svg?svgr"
12-
import Javascript from "./javascript.svg?svgr"
13-
import Julia from "./julia.svg?svgr"
14-
import LanguageSupport from "./language-support.svg?svgr"
15-
import Php from "./php.svg?svgr"
16-
import Python from "./python.svg?svgr"
17-
import Ruby from "./ruby.svg?svgr"
18-
import Rust from "./rust.svg?svgr"
19-
import Scala from "./scala.svg?svgr"
20-
import SwiftObjectiveCIos from "./swift-objective-c-ios.svg?svgr"
3+
const sprite = new URL("./sprite.svg", import.meta.url).href
214

22-
export const icons = {
23-
ballerina: Ballerina,
24-
"c-net": CNet,
25-
clojure: Clojure,
26-
elixir: Elixir,
27-
elm: Elm,
28-
flutter: Flutter,
29-
go: GoIcon,
30-
haskell: Haskell,
31-
"java-kotlin-android": JavaKotlinAndroid,
32-
javascript: Javascript,
33-
julia: Julia,
34-
"language-support": LanguageSupport,
35-
php: Php,
36-
python: Python,
37-
ruby: Ruby,
38-
rust: Rust,
39-
scala: Scala,
40-
"swift-objective-c-ios": SwiftObjectiveCIos,
41-
} satisfies Record<string, ComponentType<SVGProps<SVGElement>>>
5+
export type IconName =
6+
| "ballerina"
7+
| "c-net"
8+
| "clojure"
9+
| "elixir"
10+
| "elm"
11+
| "flutter"
12+
| "go"
13+
| "haskell"
14+
| "java"
15+
| "javascript"
16+
| "julia"
17+
| "multiplatform"
18+
| "php"
19+
| "python"
20+
| "ruby"
21+
| "rust"
22+
| "scala"
23+
| "swift"
24+
25+
interface IconProps extends SVGProps<SVGSVGElement> {
26+
icon: IconName
27+
}
28+
29+
export function Icon({ icon, ...props }: IconProps) {
30+
return (
31+
<svg {...props}>
32+
<use href={`${sprite}#${icon}`} />
33+
</svg>
34+
)
35+
}

src/app/(main)/resources/[category]/icons/java.svg

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)