Skip to content

Commit 03b1d55

Browse files
committed
chore: lint code
1 parent 2648c53 commit 03b1d55

File tree

2 files changed

+64
-18
lines changed

2 files changed

+64
-18
lines changed

example/src/App.tsx

Lines changed: 63 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
import { type Component, createSignal, onCleanup, onMount, For } from "solid-js";
1+
import {
2+
type Component,
3+
For,
4+
createSignal,
5+
onCleanup,
6+
onMount,
7+
} from "solid-js";
28
import { MarkdownRenderer, type Themes } from "solid-markdown-wasm";
39
import { MonacoEditor } from "solid-monaco";
4-
import initialMarkdown from "../src/assets/markdown_preview.md?raw";
510
import haxiomLogo from "../src/assets/haxiom.svg";
11+
import initialMarkdown from "../src/assets/markdown_preview.md?raw";
612

713
// All available themes from the Rust lib.rs (matches the Themes type)
814
const CODE_THEMES: Themes[] = [
@@ -70,10 +76,14 @@ const App: Component = () => {
7076
window.matchMedia("(prefers-color-scheme: dark)").matches,
7177
);
7278
const [codeTheme, setCodeTheme] = createSignal<Themes>(
73-
window.matchMedia("(prefers-color-scheme: dark)").matches ? "ayu-dark" : "ayu-light"
79+
window.matchMedia("(prefers-color-scheme: dark)").matches
80+
? "ayu-dark"
81+
: "ayu-light",
7482
);
7583
const [editorTheme, setEditorTheme] = createSignal<string>(
76-
window.matchMedia("(prefers-color-scheme: dark)").matches ? "vs-dark" : "vs"
84+
window.matchMedia("(prefers-color-scheme: dark)").matches
85+
? "vs-dark"
86+
: "vs",
7787
);
7888
let timeoutId: number | NodeJS.Timeout | undefined;
7989

@@ -154,12 +164,37 @@ const App: Component = () => {
154164
>
155165
{/* Left side - Logo and project name */}
156166
<div class="flex items-center gap-3">
157-
<img src={haxiomLogo} alt="Haxiom" class="h-6 w-6" classList={{ "invert": isDarkMode() }} />
158-
<span class="font-semibold" classList={{ "text-white": isDarkMode(), "text-gray-900": !isDarkMode() }}>
167+
<img
168+
src={haxiomLogo}
169+
alt="Haxiom"
170+
class="h-6 w-6"
171+
classList={{ invert: isDarkMode() }}
172+
/>
173+
<span
174+
class="font-semibold"
175+
classList={{
176+
"text-white": isDarkMode(),
177+
"text-gray-900": !isDarkMode(),
178+
}}
179+
>
159180
Haxiom
160181
</span>
161-
<span classList={{ "text-gray-500": isDarkMode(), "text-gray-400": !isDarkMode() }}>/</span>
162-
<span classList={{ "text-gray-400": isDarkMode(), "text-gray-500": !isDarkMode() }}>solid-markdown-wasm</span>
182+
<span
183+
classList={{
184+
"text-gray-500": isDarkMode(),
185+
"text-gray-400": !isDarkMode(),
186+
}}
187+
>
188+
/
189+
</span>
190+
<span
191+
classList={{
192+
"text-gray-400": isDarkMode(),
193+
"text-gray-500": !isDarkMode(),
194+
}}
195+
>
196+
solid-markdown-wasm
197+
</span>
163198
</div>
164199

165200
{/* Right side - Theme selectors and Try Haxiom */}
@@ -168,7 +203,10 @@ const App: Component = () => {
168203
{/* biome-ignore lint/a11y/noLabelWithoutControl: <explanation> */}
169204
<label
170205
class="text-sm font-medium"
171-
classList={{ "text-gray-300": isDarkMode(), "text-gray-700": !isDarkMode() }}
206+
classList={{
207+
"text-gray-300": isDarkMode(),
208+
"text-gray-700": !isDarkMode(),
209+
}}
172210
>
173211
Editor Theme:
174212
</label>
@@ -187,7 +225,10 @@ const App: Component = () => {
187225
{/* biome-ignore lint/a11y/noLabelWithoutControl: <explanation> */}
188226
<label
189227
class="text-sm font-medium"
190-
classList={{ "text-gray-300": isDarkMode(), "text-gray-700": !isDarkMode() }}
228+
classList={{
229+
"text-gray-300": isDarkMode(),
230+
"text-gray-700": !isDarkMode(),
231+
}}
191232
>
192233
Code Block Theme:
193234
</label>
@@ -196,16 +237,18 @@ const App: Component = () => {
196237
value={codeTheme()}
197238
onChange={(e) => setCodeTheme(e.currentTarget.value as Themes)}
198239
>
199-
<For each={CODE_THEMES}>{(theme) => <option value={theme}>{theme}</option>}</For>
240+
<For each={CODE_THEMES}>
241+
{(theme) => <option value={theme}>{theme}</option>}
242+
</For>
200243
</select>
201244
</div>
202245
{/* Try Haxiom link */}
203246
<a
204-
href="https://haxiom.io"
205-
target="_blank"
206-
rel="noopener noreferrer"
207-
class="text-sm font-medium px-3 py-1.5 rounded transition-colors text-black hover:opacity-80"
208-
style={{ "background-color": "#6fffe9" }}
247+
href="https://haxiom.io"
248+
target="_blank"
249+
rel="noopener noreferrer"
250+
class="text-sm font-medium px-3 py-1.5 rounded transition-colors text-black hover:opacity-80"
251+
style={{ "background-color": "#6fffe9" }}
209252
>
210253
Try Haxiom
211254
</a>
@@ -226,7 +269,10 @@ const App: Component = () => {
226269
</div>
227270
<div
228271
class="w-1/2 flex flex-col"
229-
classList={{ "bg-[#0d1117]": isDarkMode(), "bg-white": !isDarkMode() }}
272+
classList={{
273+
"bg-[#0d1117]": isDarkMode(),
274+
"bg-white": !isDarkMode(),
275+
}}
230276
>
231277
<div class="m-0 h-full shadow-sm overflow-y-auto p-4 px-6">
232278
<MarkdownRenderer

src/components/MarkdownRenderer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import init, { render_md, type Themes } from "markdown-renderer";
21
import { Check, ChevronsDownUp, ChevronsUpDown, Copy } from "lucide-solid";
2+
import init, { render_md, type Themes } from "markdown-renderer";
33
import {
44
type Component,
55
type JSX,

0 commit comments

Comments
 (0)