Skip to content

Commit e4219d6

Browse files
committed
wip: lintfix
1 parent cf272f3 commit e4219d6

File tree

7 files changed

+137
-126
lines changed

7 files changed

+137
-126
lines changed

package-lock.json

Lines changed: 22 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@
2424
"@docusaurus/module-type-aliases": "^3.8.0",
2525
"@docusaurus/preset-classic": "^3.8.0",
2626
"@docusaurus/theme-common": "^3.8.0",
27-
"@matrixai/lint": "^0.2.11",
27+
"@matrixai/lint": "^0.2.12",
2828
"@mdx-js/react": "^3.1.0",
29+
"@tailwindcss/postcss": "^4.1.8",
2930
"@tsconfig/docusaurus": "^2.0.3",
3031
"clsx": "^2.1.1",
3132
"polykey": "^2.3.4",
@@ -35,7 +36,6 @@
3536
"react": "^19.1.0",
3637
"react-dom": "^19.1.0",
3738
"typescript": "^5.8.3",
38-
"@tailwindcss/postcss": "^4.1.8",
3939
"unist-util-visit": "^5.0.0",
4040
"wrangler": "^4.19.1"
4141
}

src/components/Map.tsx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const Map = React.forwardRef<
1616
nodesGeo?: { [nodeId: string]: IpGeo };
1717
}
1818
// Complains about props not being validated
19-
// eslint-disable-next-line
2019
>(({ className, nodesGeo, ...props }, ref) => {
2120
const [width, setWidth] = React.useState<number>(0);
2221

@@ -120,7 +119,11 @@ const Map = React.forwardRef<
120119
return (
121120
<div className={className} ref={ref} {...props}>
122121
<div className="relative">
123-
<img src="images/map.svg" className="w-full text-white" />
122+
<img
123+
alt="Polykey Node Map"
124+
className="w-full text-white"
125+
src="images/map.svg"
126+
/>
124127
{/* <div
125128
className="absolute"
126129
style={{
@@ -143,8 +146,8 @@ const Map = React.forwardRef<
143146
const { x, y } = latLonToOffsets(lat * 1.8, lng, 100, 100);
144147
return (
145148
<div
149+
className="absolute grid aspect-square -translate-x-1/2 -translate-y-1/2 place-items-center rounded-full border border-[rgba(255,255,255)]"
146150
key={i}
147-
className="aspect-square border-[rgba(255, 255, 255, 0.4)] border rounded-full absolute grid place-items-center -translate-x-1/2 -translate-y-1/2"
148151
style={{
149152
left: `${x > 0 ? x : 100 + x}%`,
150153
top: `${y}%`,
@@ -155,23 +158,24 @@ const Map = React.forwardRef<
155158
}%`,
156159
}}
157160
>
158-
<div className="aspect-square bg-white w-[75%] rounded-full flex justify-center">
161+
<div className="flex aspect-square w-3/4 justify-center rounded-full bg-white">
159162
<img
163+
alt="Polykey Logo"
164+
className="w-3/5"
160165
src="images/polykey-logomark-dark.svg"
161-
className="w-[60%]"
162166
/>
163167
</div>
164168
<div
165169
className="
166170
absolute bottom-0 right-0
167-
rounded-full
168-
aspect-square w-6 leading-5
169-
bg-[#134647] border-[#289295]
170-
border-2 text-center
171-
text-xs
172-
text-white
173171
inline-block
174-
align-middle"
172+
aspect-square w-6 rounded-full
173+
border-2 border-[#289295]
174+
bg-[#134647] text-center
175+
align-middle
176+
text-xs
177+
leading-5
178+
text-white"
175179
>
176180
{count}
177181
</div>

src/components/ResourceChart.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import { Line } from 'react-chartjs-2';
33

4-
function ResourceChart({
4+
const ResourceChart = ({
55
data,
66
title,
77
...props
@@ -13,7 +13,7 @@ function ResourceChart({
1313
};
1414
};
1515
title?: string;
16-
} & React.HTMLAttributes<HTMLCanvasElement>) {
16+
} & React.HTMLAttributes<HTMLCanvasElement>) => {
1717
const [isRegistered, setIsRegistered] = React.useState(false);
1818
React.useEffect(() => {
1919
const registerList: Array<any> = [];
@@ -47,15 +47,15 @@ function ResourceChart({
4747
const timestamps = Object.values(data).at(0)?.timestamps ?? [];
4848
return isRegistered ? (
4949
<Line
50-
title={title}
51-
datasetIdKey="id"
5250
data={{
5351
labels: timestamps,
5452
datasets: Object.entries(data).map(([nodeId, data]) => ({
5553
label: nodeId,
5654
data: data.values,
5755
})),
5856
}}
57+
datasetIdKey="id"
58+
height={200}
5959
options={{
6060
scales: {
6161
x: {
@@ -114,12 +114,12 @@ function ResourceChart({
114114
},
115115
},
116116
}}
117-
height={200}
117+
title={title}
118118
{...props}
119119
/>
120120
) : (
121121
<></>
122122
);
123-
}
123+
};
124124

125125
export default ResourceChart;

src/components/SeedNodeCard.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const NodeCard = React.forwardRef<
99
data?: SeednodesStatusGetResult[''];
1010
}
1111
// Complains about props not being validated
12-
// eslint-disable-next-line
1312
>(({ className, nodeId, data, ...props }, ref) => {
1413
let contents: React.JSX.Element;
1514
if (data == null) {
@@ -18,12 +17,12 @@ const NodeCard = React.forwardRef<
1817
contents = (
1918
<>
2019
<span className="font-semibold">Error:</span>
21-
<div className="overflow-x-auto break-normal flex gap-1 items-center">
22-
<div className="w-3 h-3 rounded-full bg-red-400" />
20+
<div className="flex items-center gap-1 overflow-x-auto break-normal">
21+
<div className="size-3 rounded-full bg-red-400" />
2322
{data.error}
2423
</div>
2524
<span className="font-semibold">Message:</span>
26-
<pre className="overflow-x-auto break-normal flex gap-1 items-center">
25+
<pre className="flex items-center gap-1 overflow-x-auto break-normal">
2726
{data.message}
2827
</pre>
2928
</>
@@ -32,8 +31,8 @@ const NodeCard = React.forwardRef<
3231
contents = (
3332
<>
3433
<span className="font-semibold">Status:</span>
35-
<div className="overflow-x-auto break-normal flex gap-1 items-center">
36-
<div className="w-3 h-3 rounded-full bg-red-400" />
34+
<div className="flex items-center gap-1 overflow-x-auto break-normal">
35+
<div className="size-3 rounded-full bg-red-400" />
3736
{data.status}
3837
</div>
3938
</>
@@ -42,8 +41,8 @@ const NodeCard = React.forwardRef<
4241
contents = (
4342
<>
4443
<span className="font-semibold">Status:</span>
45-
<div className="overflow-x-auto break-normal flex gap-1 items-center">
46-
<div className="w-3 h-3 rounded-full bg-green-400" />
44+
<div className="flex items-center gap-1 overflow-x-auto break-normal">
45+
<div className="size-3 rounded-full bg-green-400" />
4746
{data.status}
4847
</div>
4948
<span className="font-semibold">Agent Service Address:</span>
@@ -67,8 +66,8 @@ const NodeCard = React.forwardRef<
6766
}
6867
return (
6968
<div
69+
className={clsx('rounded-2xl bg-[#E4F6F2] p-3', className)}
7070
ref={ref}
71-
className={clsx('bg-[#E4F6F2] rounded-2xl p-3', className)}
7271
{...props}
7372
>
7473
<span className="font-semibold">Node ID:</span>

0 commit comments

Comments
 (0)