Skip to content

Commit

Permalink
Remove solid-heroicons (they are breaking ssr)
Browse files Browse the repository at this point in the history
  • Loading branch information
thetarnav committed Sep 12, 2024
1 parent 92772cc commit 57e2930
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
23 changes: 19 additions & 4 deletions packages/audio/dev/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
import { Component, For, Show, createSignal } from "solid-js";
import { Component, For, JSX, Show, createSignal, splitProps } from "solid-js";
import { createAudio, AudioState } from "../src/index.js";

import { Icon } from "solid-heroicons";
import { play, pause } from "solid-heroicons/solid";
import { speakerWave } from "solid-heroicons/outline";
// import { Icon } from "solid-heroicons";
// import { play, pause } from "solid-heroicons/solid";
// import { speakerWave } from "solid-heroicons/outline";

type IconPath = {path: () => JSX.Element; outline?: boolean; mini?: boolean}
type IconProps = JSX.SvgSVGAttributes<SVGSVGElement> & {path: IconPath}

const Icon = (props: IconProps) => {
const [internal, external] = splitProps(props, ["path"]);
return (<svg viewBox={internal.path.mini ? "0 0 20 20" : "0 0 24 24"} fill={internal.path.outline ? "none" : "currentColor"} stroke={internal.path.outline ? "currentColor" : "none"} stroke-width={internal.path.outline ? 1.5 : undefined} {...external}>
{internal.path.path()}
</svg>);
};

const play: IconPath = { path: () => <><path fill-rule="evenodd" d="M4.5 5.653c0-1.426 1.529-2.33 2.779-1.643l11.54 6.348c1.295.712 1.295 2.573 0 3.285L7.28 19.991c-1.25.687-2.779-.217-2.779-1.643V5.653z" clip-rule="evenodd"/></>, outline: false, mini: false };
const pause: IconPath = { path: () => <><path fill-rule="evenodd" d="M6.75 5.25a.75.75 0 01.75-.75H9a.75.75 0 01.75.75v13.5a.75.75 0 01-.75.75H7.5a.75.75 0 01-.75-.75V5.25zm7.5 0A.75.75 0 0115 4.5h1.5a.75.75 0 01.75.75v13.5a.75.75 0 01-.75.75H15a.75.75 0 01-.75-.75V5.25z" clip-rule="evenodd"/></>, outline: false, mini: false };
const speakerWave: IconPath = { path: () => <><path stroke-linecap="round" stroke-linejoin="round" d="M19.114 5.636a9 9 0 010 12.728M16.463 8.288a5.25 5.25 0 010 7.424M6.75 8.25l4.72-4.72a.75.75 0 011.28.53v15.88a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 012.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75z"/></>, outline: true, mini: false };

const formatTime = (time: number) => new Date(time * 1000).toISOString().substr(14, 8);

Expand All @@ -12,6 +26,7 @@ const App: Component = () => {
const [playing, setPlaying] = createSignal(false);
const [volume, setVolume] = createSignal(1);
const [audio, { seek }] = createAudio(source, playing, volume);

return (
<div class="box-border flex h-screen w-full items-center justify-center overflow-hidden bg-gray-900">
<div class="flex flex-col items-center">
Expand Down
1 change: 0 additions & 1 deletion packages/audio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"primitives"
],
"devDependencies": {
"solid-heroicons": "^3.2.4",
"solid-js": "^1.8.7"
},
"dependencies": {
Expand Down
12 changes: 0 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 57e2930

Please sign in to comment.