layout
Seto Elkahfi committed
Aug 1, 2024 at 23:27 UTC
fa606e15781360de3c9547c5562ebda2a1111682
4 files changed
+43
-40
frontend/splitfire-desktop/app/_ui/global-nav.tsx
-2
@@ -9,8 +9,6 @@ import { useContext, useState } from 'react';
9
import Image from 'next/image';
10
import { UserContext } from '../_src/lib/CurrentUserContext';
11
12
-
13
-
12
export function GlobalNav() {
13
14
const [isOpen, setIsOpen] = useState(false);
frontend/splitfire-desktop/app/layout.tsx
+38
-33
@@ -1,4 +1,4 @@
1
- "use client"
1
+"use client";
2
3
import { AddressBar } from "./_ui/address-bar";
4
import { GlobalNav } from "./_ui/global-nav";
@@ -11,7 +11,7 @@ import { useLogger } from "./_src/lib/logger";
11
enum State {
12
LOADING,
13
LOADED,
14
- ERROR
14
+ ERROR,
15
}
16
17
export default function RootLayout({
@@ -19,63 +19,68 @@ export default function RootLayout({
19
}: {
20
children: React.ReactNode;
21
}) {
22
-
23
- const log = useLogger('App')
24
- const [state, setState] = useState(State.LOADING)
25
- const [user, setUser] = useState<CurrentUser | null>(null)
22
+ const log = useLogger("App");
23
+ const [state, setState] = useState(State.LOADING);
24
+ const [user, setUser] = useState<CurrentUser | null>(null);
25
26
const updateUser = (newUser: CurrentUser | null) => {
28
- setUser(newUser)
29
- }
27
+ setUser(newUser);
28
+ };
29
30
const getCurrentUser = async () => {
32
- setState(State.LOADING)
31
+ setState(State.LOADING);
32
try {
34
- const result = await db.currentUser.where({ type: CurrentUserType.MAIN }).first()
35
- log.debug('Result: ', result)
33
+ const result = await db.currentUser
34
+ .where({ type: CurrentUserType.MAIN })
35
+ .first();
36
+ log.debug("Result: ", result);
37
if (result) {
37
- setUser(result)
38
+ setUser(result);
39
}
39
- setState(State.LOADED)
40
+ setState(State.LOADED);
41
} catch (error) {
41
- log.error(error)
42
- setState(State.ERROR)
42
+ log.error(error);
43
+ setState(State.ERROR);
44
}
44
- }
45
+ };
46
47
useEffect(() => {
47
- getCurrentUser()
48
- // eslint-disable-next-line react-hooks/exhaustive-deps
49
- }, [])
48
+ getCurrentUser();
49
+ // eslint-disable-next-line react-hooks/exhaustive-deps
50
+ }, []);
51
52
if (state === State.LOADING) {
52
- return ( <html lang="en" className="[color-scheme:dark]">
53
- <body className="bg-gray-1100 overflow-y-scroll bg-[url('/grid.svg')] pb-36">
54
- Loading app ...
55
- </body>
56
- </html>);
53
+ return (
54
+ <html lang="en" className="[color-scheme:dark]">
55
+ <body className="bg-gray-1100 overflow-y-scroll bg-[url('/grid.svg')] pb-36">
56
+ Loading app ...
57
+ </body>
58
+ </html>
59
+ );
60
}
61
62
if (state === State.ERROR) {
60
- return ( <html lang="en" className="[color-scheme:dark]">
61
- <body className="bg-gray-1100 overflow-y-scroll bg-[url('/grid.svg')] pb-36">
62
- Error loading app ...
63
- </body>
64
- </html>);
63
+ return (
64
+ <html lang="en" className="[color-scheme:dark]">
65
+ <body className="bg-gray-1100 overflow-y-scroll bg-[url('/grid.svg')] pb-36">
66
+ Error loading app ...
67
+ </body>
68
+ </html>
69
+ );
70
}
66
-
71
+
72
return (
73
<html lang="en" className="[color-scheme:dark]">
69
- <body className="bg-gray-1100 overflow-y-scroll bg-[url('/grid.svg')] pb-36">
74
+ <body className="bg-gray-1100 overflow-none bg-[url('/grid.svg')] pb-36">
75
<UserContext.Provider value={{ user, updateUser }}>
76
<GlobalNav />
77
<div className="lg:pl-72">
73
- <div className="bg-vc-border-gradient rounded-lg p-px shadow-lg shadow-black/20">
78
+ <div className="fixed top-0 w-full bg-vc-border-gradient rounded-lg p-px shadow-lg shadow-black/20">
79
<div className="rounded-lg bg-black">
80
<AddressBar />
81
</div>
82
</div>
78
- <div className="mx-auto max-w-4xl space-y-8 px-2 pt-20 lg:px-8 lg:py-8">
83
+ <div className="mx-auto max-w-4xl space-y-8 px-2 mt-10 lg:px-8 lg:py-8">
84
<div className="bg-vc-border-gradient rounded-lg p-px shadow-lg shadow-black/20">
85
<div className="rounded-lg bg-black p-3.5 lg:p-6">
86
{children}
frontend/splitfire-desktop/app/play/_components/audio-info.tsx
+2
-2
@@ -19,9 +19,9 @@ export function AudioInfo(props: { }) {
19
<abbr title="Track">Played:</abbr> {numberPlayed}
20
</p>
21
<h2 className="text-slate-500 dark:text-slate-400 text-sm leading-6 truncate">
22
- Music: New Album The Lorem
22
+ Key: C Major
23
</h2>
24
- <p className="text-slate-900 dark:text-slate-50 text-lg">{difficulty}</p>
24
+ <p className="text-slate-500 dark:text-slate-50 text-lg">{difficulty}</p>
25
</div>
26
</div>
27
);
frontend/splitfire-desktop/src-tauri/tauri.conf.json
+3
-3
@@ -30,7 +30,7 @@
30
"icons/icon.ico"
31
],
32
"identifier": "ai.splitfire.desktop",
33
- "longDescription": "",
33
+ "longDescription": "Community, artificial intelligence, music, community",
34
"macOS": {
35
"entitlements": null,
36
"exceptionDomain": "",
@@ -39,7 +39,7 @@
39
"signingIdentity": null
40
},
41
"resources": [],
42
- "shortDescription": "",
42
+ "shortDescription": "artificial intelligence, music, community",
43
"targets": "all",
44
"windows": {
45
"certificateThumbprint": null,
@@ -57,7 +57,7 @@
57
{
58
"maximized": true,
59
"height": 600,
60
- "resizable": true,
60
+ "resizable": false,
61
"title": "SplitFire",
62
"width": 800
63
}