Skip to content

Commit 39345dd

Browse files
committed
chore: fmt
1 parent 8ffa48c commit 39345dd

File tree

6 files changed

+183
-119
lines changed

6 files changed

+183
-119
lines changed

components/Footer.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,12 @@ export default function Footer() {
77
<div class="flex items-center justify-center space-x-3 mb-4">
88
<img src="/logo.svg" alt="Andromeda" class="w-8 h-8" />
99
<span class="font-semibold text-text">Andromeda</span>
10+
<CompactGitHubStats showForks className="justify-center" />
1011
</div>
1112
<p class="text-subtext1 mb-6">
1213
A modern, fast, and secure JavaScript & TypeScript runtime built from
1314
the ground up in Rust and powered by Nova Engine.
1415
</p>
15-
16-
{/* Community stats */}
17-
<div class="mb-6">
18-
<CompactGitHubStats showForks className="justify-center" />
19-
</div>
20-
2116
<div class="flex justify-center space-x-6">
2217
<a
2318
href="https://github.com/tryandromeda/andromeda"

islands/CompactGitHubStats.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { useState, useEffect } from "preact/hooks";
2-
import { Star, GitFork } from "lucide-preact";
1+
import { useEffect, useState } from "preact/hooks";
2+
import { GitFork, Star } from "lucide-preact";
33

44
interface GitHubRepo {
55
stargazers_count: number;
@@ -11,20 +11,24 @@ interface CompactGitHubStatsProps {
1111
showForks?: boolean;
1212
}
1313

14-
export default function CompactGitHubStats({ className = "", showForks = false }: CompactGitHubStatsProps) {
14+
export default function CompactGitHubStats(
15+
{ className = "", showForks = false }: CompactGitHubStatsProps,
16+
) {
1517
const [repoData, setRepoData] = useState<GitHubRepo | null>(null);
1618
const [loading, setLoading] = useState(true);
1719

1820
useEffect(() => {
1921
const fetchGitHubData = async () => {
2022
try {
21-
const response = await fetch('https://api.github.com/repos/tryandromeda/andromeda');
23+
const response = await fetch(
24+
"https://api.github.com/repos/tryandromeda/andromeda",
25+
);
2226
if (response.ok) {
2327
const data = await response.json();
2428
setRepoData(data);
2529
}
2630
} catch (error) {
27-
console.error('Error fetching GitHub data:', error);
31+
console.error("Error fetching GitHub data:", error);
2832
} finally {
2933
setLoading(false);
3034
}
@@ -42,7 +46,10 @@ export default function CompactGitHubStats({ className = "", showForks = false }
4246
return (
4347
<div class={`flex items-center gap-2 ${className}`}>
4448
<div class="animate-pulse bg-surface1 rounded px-2 py-1 w-16 h-6"></div>
45-
{showForks && <div class="animate-pulse bg-surface1 rounded px-2 py-1 w-16 h-6"></div>}
49+
{showForks && (
50+
<div class="animate-pulse bg-surface1 rounded px-2 py-1 w-16 h-6">
51+
</div>
52+
)}
4653
</div>
4754
);
4855
}
@@ -59,7 +66,7 @@ export default function CompactGitHubStats({ className = "", showForks = false }
5966
<Star size={14} class="text-yellow" />
6067
<span>{formatNumber(repoData.stargazers_count)}</span>
6168
</a>
62-
69+
6370
{showForks && (
6471
<a
6572
href="https://github.com/tryandromeda/andromeda/forks"

islands/GitHubStats.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,11 @@ export default function GitHubStats() {
5757
if (releaseResponse.ok) {
5858
const release = await releaseResponse.json();
5959

60-
const downloadCount =
61-
release.assets?.reduce(
62-
(total: number, asset: { download_count?: number }) =>
63-
total + (asset.download_count || 0),
64-
0,
65-
) || 0;
60+
const downloadCount = release.assets?.reduce(
61+
(total: number, asset: { download_count?: number }) =>
62+
total + (asset.download_count || 0),
63+
0,
64+
) || 0;
6665

6766
setLatestRelease({
6867
tag_name: release.tag_name,

islands/InstallToggle.tsx

Lines changed: 97 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ const platforms: Platform[] = [
2323
id: "powershell",
2424
name: "Windows (PowerShell)",
2525
icon: Monitor,
26-
command: `iwr -Uri "https://tryandromeda.dev/install.ps1" | Invoke-Expression`,
26+
command:
27+
`iwr -Uri "https://tryandromeda.dev/install.ps1" | Invoke-Expression`,
2728
downloadUrl: "/install.ps1",
2829
color: "blue",
2930
},
3031
{
3132
id: "cmd",
3233
name: "Windows (CMD)",
3334
icon: Zap,
34-
command: "curl -L -o install.bat https://tryandromeda.dev/install.bat && install.bat",
35+
command:
36+
"curl -L -o install.bat https://tryandromeda.dev/install.bat && install.bat",
3537
downloadUrl: "/install.bat",
3638
color: "peach",
3739
},
@@ -40,7 +42,7 @@ const platforms: Platform[] = [
4042
export default function InstallToggle() {
4143
const [selectedPlatform, setSelectedPlatform] = useState("bash");
4244

43-
const currentPlatform = platforms.find(p => p.id === selectedPlatform)!;
45+
const currentPlatform = platforms.find((p) => p.id === selectedPlatform)!;
4446

4547
const copyToClipboard = async (text: string) => {
4648
try {
@@ -52,63 +54,87 @@ export default function InstallToggle() {
5254
};
5355

5456
const downloadScript = () => {
55-
const link = document.createElement('a');
57+
const link = document.createElement("a");
5658
link.href = currentPlatform.downloadUrl;
57-
link.download = currentPlatform.downloadUrl.split('/').pop() || 'install';
59+
link.download = currentPlatform.downloadUrl.split("/").pop() || "install";
5860
document.body.appendChild(link);
5961
link.click();
6062
document.body.removeChild(link);
6163
};
6264
return (
63-
<div class="w-full max-w-4xl mx-auto"> {/* Container with consistent theme colors */}
64-
<div class="relative overflow-hidden bg-base border border-surface1 rounded-2xl shadow-lg"> {/* Header */}
65+
<div class="w-full max-w-4xl mx-auto">
66+
{/* Container with consistent theme colors */}
67+
<div class="relative overflow-hidden bg-base border border-surface1 rounded-2xl shadow-lg">
68+
{/* Header */}
6569
<div class="text-center p-6 sm:p-8 pb-4">
66-
<h3 class="text-xl sm:text-2xl font-bold mb-2 tracking-tight" style={{ color: 'var(--color-text)' }}>
70+
<h3
71+
class="text-xl sm:text-2xl font-bold mb-2 tracking-tight"
72+
style={{ color: "var(--color-text)" }}
73+
>
6774
Quick Install
6875
</h3>
69-
<p class="text-sm sm:text-base font-medium" style={{ color: 'var(--color-subtext1)' }}>
76+
<p
77+
class="text-sm sm:text-base font-medium"
78+
style={{ color: "var(--color-subtext1)" }}
79+
>
7080
Choose your platform to get started
7181
</p>
72-
</div>{/* Platform Selection Grid - Smaller boxes */}
82+
</div>
83+
{/* Platform Selection Grid - Smaller boxes */}
7384
<div class="px-4 sm:px-8 pb-6">
74-
<div class="grid grid-cols-1 sm:grid-cols-3 gap-3">{platforms.map((platform) => {
85+
<div class="grid grid-cols-1 sm:grid-cols-3 gap-3">
86+
{platforms.map((platform) => {
7587
// deno-lint-ignore no-explicit-any
7688
const IconComponent = platform.icon as any;
7789
const isSelected = selectedPlatform === platform.id;
78-
90+
7991
return (
8092
<button
8193
key={platform.id}
8294
type="button"
83-
onClick={() => setSelectedPlatform(platform.id)} class={`group relative overflow-hidden p-4 rounded-lg border transition-all duration-300 transform ${
95+
onClick={() => setSelectedPlatform(platform.id)}
96+
class={`group relative overflow-hidden p-4 rounded-lg border transition-all duration-300 transform ${
8497
isSelected
8598
? `bg-${platform.color} text-base border-${platform.color} shadow-lg scale-105`
8699
: "bg-surface0 hover:bg-surface1 border-surface1 hover:border-surface2 hover:scale-102 hover:shadow-md"
87100
}`}
88-
style={isSelected ? {
89-
backgroundColor: `var(--color-${platform.color})`,
90-
borderColor: `var(--color-${platform.color})`,
91-
color: 'var(--color-base)'
92-
} : {
93-
color: 'var(--color-text)'
94-
}}> {/* Icon */}
101+
style={isSelected
102+
? {
103+
backgroundColor: `var(--color-${platform.color})`,
104+
borderColor: `var(--color-${platform.color})`,
105+
color: "var(--color-base)",
106+
}
107+
: {
108+
color: "var(--color-text)",
109+
}}
110+
>
111+
{/* Icon */}
95112
<div class="flex justify-center mb-2">
96-
<div class={`p-2 rounded-lg transition-colors ${
97-
isSelected
98-
? "bg-base/20"
99-
: "bg-surface1 group-hover:bg-surface2"
100-
}`}> <IconComponent
101-
size={20}
113+
<div
114+
class={`p-2 rounded-lg transition-colors ${
115+
isSelected
116+
? "bg-base/20"
117+
: "bg-surface1 group-hover:bg-surface2"
118+
}`}
119+
>
120+
<IconComponent
121+
size={20}
102122
class={isSelected ? "text-base" : ""}
103-
style={isSelected ? { color: 'var(--color-base)' } : { color: 'var(--color-text)' }}
123+
style={isSelected
124+
? { color: "var(--color-base)" }
125+
: { color: "var(--color-text)" }}
104126
/>
105127
</div>
106-
</div> {/* Platform name */}
107-
<div class="text-center"> <div
128+
</div>{" "}
129+
{/* Platform name */}
130+
<div class="text-center">
131+
<div
108132
class={`text-xs sm:text-sm font-semibold ${
109133
isSelected ? "text-base" : ""
110134
}`}
111-
style={isSelected ? { color: 'var(--color-base)' } : { color: 'var(--color-text)' }}
135+
style={isSelected
136+
? { color: "var(--color-base)" }
137+
: { color: "var(--color-text)" }}
112138
>
113139
{platform.name}
114140
</div>
@@ -120,31 +146,41 @@ export default function InstallToggle() {
120146
</div>
121147

122148
{/* Command Section */}
123-
<div class="px-4 sm:px-8 pb-6 sm:pb-8"> <div class="bg-mantle rounded-xl border border-surface1 overflow-hidden">
149+
<div class="px-4 sm:px-8 pb-6 sm:pb-8">
150+
<div class="bg-mantle rounded-xl border border-surface1 overflow-hidden">
124151
{/* Header with actions */}
125-
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 p-4 bg-surface0 border-b border-surface1"> <h4 class="text-sm sm:text-base font-semibold flex items-center gap-2" style={{ color: 'var(--color-text)' }}>
126-
<Terminal size={16} style={{ color: 'var(--color-subtext1)' }} />
152+
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 p-4 bg-surface0 border-b border-surface1">
153+
<h4
154+
class="text-sm sm:text-base font-semibold flex items-center gap-2"
155+
style={{ color: "var(--color-text)" }}
156+
>
157+
<Terminal
158+
size={16}
159+
style={{ color: "var(--color-subtext1)" }}
160+
/>
127161
Installation Command
128162
</h4>
129-
<div class="flex gap-2"> <button
163+
<div class="flex gap-2">
164+
<button
130165
type="button"
131166
onClick={downloadScript}
132167
class="flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg transition-all duration-200 hover:scale-105 shadow-md hover:shadow-lg"
133168
style={{
134-
backgroundColor: 'var(--color-yellow)',
135-
color: 'var(--color-base)'
169+
backgroundColor: "var(--color-yellow)",
170+
color: "var(--color-base)",
136171
}}
137172
title="Download script"
138173
>
139174
<Download size={16} />
140175
<span class="hidden sm:inline">Download</span>
141-
</button> <button
176+
</button>{" "}
177+
<button
142178
type="button"
143179
onClick={() => copyToClipboard(currentPlatform.command)}
144180
class="flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg transition-all duration-200 hover:scale-105 shadow-md hover:shadow-lg"
145181
style={{
146-
backgroundColor: 'var(--color-green)',
147-
color: 'var(--color-base)'
182+
backgroundColor: "var(--color-green)",
183+
color: "var(--color-base)",
148184
}}
149185
title="Copy to clipboard"
150186
>
@@ -153,9 +189,12 @@ export default function InstallToggle() {
153189
</button>
154190
</div>
155191
</div>
156-
{/* Command display */}
192+
{/* Command display */}
157193
<div class="p-4">
158-
<pre class="text-sm sm:text-base font-mono leading-relaxed overflow-x-auto" style={{ color: 'var(--color-text)' }}>
194+
<pre
195+
class="text-sm sm:text-base font-mono leading-relaxed overflow-x-auto"
196+
style={{ color: "var(--color-text)" }}
197+
>
159198
<code>{currentPlatform.command}</code>
160199
</pre>
161200
</div>
@@ -164,9 +203,23 @@ export default function InstallToggle() {
164203

165204
{/* Info note */}
166205
<div class="px-4 sm:px-8 pb-6 sm:pb-8">
167-
<div class="bg-surface0/50 rounded-lg border border-surface1/50 p-4"> <p class="text-xs sm:text-sm leading-relaxed" style={{ color: 'var(--color-subtext1)' }}>
168-
<span class="font-semibold" style={{ color: 'var(--color-text)' }}>Note:</span> These scripts automatically detect your platform, download the appropriate binary, and add it to your PATH.{" "}
169-
<span class="hidden sm:inline">You can also download and inspect the scripts before running them.</span>
206+
<div class="bg-surface0/50 rounded-lg border border-surface1/50 p-4">
207+
<p
208+
class="text-xs sm:text-sm leading-relaxed"
209+
style={{ color: "var(--color-subtext1)" }}
210+
>
211+
<span
212+
class="font-semibold"
213+
style={{ color: "var(--color-text)" }}
214+
>
215+
Note:
216+
</span>{" "}
217+
These scripts automatically detect your platform, download the
218+
appropriate binary, and add it to your PATH.{" "}
219+
<span class="hidden sm:inline">
220+
You can also download and inspect the scripts before running
221+
them.
222+
</span>
170223
</p>
171224
</div>
172225
</div>

0 commit comments

Comments
 (0)