Skip to content

Commit aab80bf

Browse files
committed
Update
1 parent df40ed2 commit aab80bf

10 files changed

Lines changed: 79 additions & 16 deletions

App.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ import PositionsTable from "./components/PositionsTable";
66
import PortfolioChart from "./components/PortfolioChart";
77
import CategoricalAnalysis from "./components/CategoricalAnalysis";
88
import FileDropZone from "./components/FileDropZone";
9-
import { LayoutDashboard, Trash2, Maximize2, Minimize2 } from "lucide-react";
9+
import { Trash2, Maximize2, Minimize2 } from "lucide-react";
1010

1111
const APP_NAME = "Alloc";
1212
const STORAGE_KEY = `${APP_NAME}_json_data`;
1313
const FULL_WIDTH_STORAGE_KEY = `${APP_NAME}_full_width_preference`;
14+
const FAVICON_PATH = `${import.meta.env.BASE_URL}android-chrome-512x512.png`;
1415

1516
const App: React.FC = () => {
1617
const [account, setAccount] = useState<AccountData | null>(null);
@@ -40,7 +41,7 @@ const App: React.FC = () => {
4041

4142
// Load full-width preference
4243
const fullWidthPreference = localStorage.getItem(
43-
FULL_WIDTH_STORAGE_KEY
44+
FULL_WIDTH_STORAGE_KEY,
4445
);
4546
if (fullWidthPreference !== null) {
4647
setIsFullWidth(fullWidthPreference === "true");
@@ -65,13 +66,13 @@ const App: React.FC = () => {
6566

6667
if (!account) {
6768
throw new Error(
68-
"Failed to parse account data. Please check the file format."
69+
"Failed to parse account data. Please check the file format.",
6970
);
7071
}
7172

7273
if (!positions || positions.length === 0) {
7374
throw new Error(
74-
"Failed to parse positions data or file is empty. Please check the file format."
75+
"Failed to parse positions data or file is empty. Please check the file format.",
7576
);
7677
}
7778

@@ -133,11 +134,11 @@ const App: React.FC = () => {
133134
// Calculate some aggregate totals that might be missing or useful
134135
const totalDailyPL = positions.reduce(
135136
(acc, curr) => acc + curr.today_pl_val,
136-
0
137+
0,
137138
);
138139
const totalUnrealizedPL = positions.reduce(
139140
(acc, curr) => acc + curr.unrealized_pl,
140-
0
141+
0,
141142
);
142143

143144
return (
@@ -151,7 +152,11 @@ const App: React.FC = () => {
151152
>
152153
<div className="flex justify-between h-16 items-center">
153154
<div className="flex items-center gap-2">
154-
<LayoutDashboard className="h-6 w-6 text-blue-500" />
155+
<img
156+
src={FAVICON_PATH}
157+
alt="Alloc logo"
158+
className="h-7 w-7 rounded-sm"
159+
/>
155160
<span className="font-bold text-xl text-white tracking-tight">
156161
<span className="text-blue-500">Alloc</span>{" "}
157162
Dashboard

components/FileDropZone.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
FileText,
55
AlertCircle,
66
CheckCircle2,
7-
LayoutDashboard,
87
Sparkles,
98
} from "lucide-react";
109
import { generateDemoData } from "../utils/demoDataGenerator";
@@ -15,6 +14,8 @@ interface FileDropZoneProps {
1514
parseError?: string | null;
1615
}
1716

17+
const FAVICON_PATH = `${import.meta.env.BASE_URL}android-chrome-512x512.png`;
18+
1819
const FileDropZone: React.FC<FileDropZoneProps> = ({
1920
onFileLoaded,
2021
onError,
@@ -83,7 +84,7 @@ const FileDropZone: React.FC<FileDropZoneProps> = ({
8384
JSON.parse(jsonContent);
8485
} catch (e) {
8586
throw new Error(
86-
"Invalid JSON format. Please check the file."
87+
"Invalid JSON format. Please check the file.",
8788
);
8889
}
8990

@@ -97,7 +98,7 @@ const FileDropZone: React.FC<FileDropZoneProps> = ({
9798
setDataFile(null);
9899
}
99100
},
100-
[onFileLoaded, onError]
101+
[onFileLoaded, onError],
101102
);
102103

103104
const handleDragOver = useCallback((e: React.DragEvent) => {
@@ -119,14 +120,14 @@ const FileDropZone: React.FC<FileDropZoneProps> = ({
119120
setIsDragging(false);
120121
handleFiles(e.dataTransfer.files);
121122
},
122-
[handleFiles]
123+
[handleFiles],
123124
);
124125

125126
const handleFileInput = useCallback(
126127
(e: React.ChangeEvent<HTMLInputElement>) => {
127128
handleFiles(e.target.files);
128129
},
129-
[handleFiles]
130+
[handleFiles],
130131
);
131132

132133
const handleDemoMode = useCallback(() => {
@@ -149,8 +150,12 @@ const FileDropZone: React.FC<FileDropZoneProps> = ({
149150
<div className="w-full max-w-2xl">
150151
<div className="text-center mb-8">
151152
<div className="flex justify-center mb-4">
152-
<div className="p-4 bg-slate-800 rounded-full border border-slate-700">
153-
<LayoutDashboard className="h-12 w-12 text-blue-500" />
153+
<div className="p-4">
154+
<img
155+
src={FAVICON_PATH}
156+
alt="Alloc logo"
157+
className="h-16 w-16 rounded-md"
158+
/>
154159
</div>
155160
</div>
156161
<h1 className="text-3xl font-bold text-white mb-2">

index.html

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,41 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<title>Alloc</title>
6+
<meta name="theme-color" content="#0f172a" />
7+
<link rel="icon" href="./favicon.ico" sizes="any" />
8+
<link
9+
rel="icon"
10+
type="image/png"
11+
sizes="16x16"
12+
href="./favicon-16x16.png"
13+
/>
14+
<link
15+
rel="icon"
16+
type="image/png"
17+
sizes="32x32"
18+
href="./favicon-32x32.png"
19+
/>
20+
<link
21+
rel="icon"
22+
type="image/png"
23+
sizes="192x192"
24+
href="./android-chrome-192x192.png"
25+
/>
26+
<link
27+
rel="icon"
28+
type="image/png"
29+
sizes="512x512"
30+
href="./android-chrome-512x512.png"
31+
/>
32+
<link
33+
rel="apple-touch-icon"
34+
sizes="180x180"
35+
href="./apple-touch-icon.png"
36+
/>
37+
<link rel="manifest" href="./site.webmanifest" />
38+
<title>MX Alloc Dashboard</title>
739
</head>
840
<body>
941
<div id="root"></div>

public/android-chrome-192x192.png

4.54 KB
Loading

public/android-chrome-512x512.png

15.3 KB
Loading

public/apple-touch-icon.png

4.3 KB
Loading

public/favicon-16x16.png

453 Bytes
Loading

public/favicon-32x32.png

918 Bytes
Loading

public/favicon.ico

15 KB
Binary file not shown.

public/site.webmanifest

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "Alloc Dashboard",
3+
"short_name": "Alloc",
4+
"icons": [
5+
{
6+
"src": "./android-chrome-192x192.png",
7+
"sizes": "192x192",
8+
"type": "image/png"
9+
},
10+
{
11+
"src": "./android-chrome-512x512.png",
12+
"sizes": "512x512",
13+
"type": "image/png"
14+
}
15+
],
16+
"theme_color": "#0f172a",
17+
"background_color": "#0f172a",
18+
"display": "standalone",
19+
"start_url": ".",
20+
"scope": "."
21+
}

0 commit comments

Comments
 (0)