From 4e8b03f86b4ec9454268d1b3f5d32a8ceaf4fce9 Mon Sep 17 00:00:00 2001
From: LynithDev <61880709+LynithDev@users.noreply.github.com>
Date: Tue, 17 Jun 2025 21:42:42 +0200
Subject: [PATCH] temp: cluster pages
---
.../frontend/src/components/Navbar.tsx | 2 +-
.../app/{test.tsx => clusters/index.tsx} | 4 +-
.../src/routes/app/clusters/route.tsx | 57 +++++++++++++++++
.../frontend/src/routes/app/index.tsx | 61 +++++++++++--------
.../frontend/src/routes/app/route.tsx | 15 +++--
packages/web_common/src/theme.css | 1 +
6 files changed, 102 insertions(+), 38 deletions(-)
rename apps/oneclient/frontend/src/routes/app/{test.tsx => clusters/index.tsx} (54%)
create mode 100644 apps/oneclient/frontend/src/routes/app/clusters/route.tsx
diff --git a/apps/oneclient/frontend/src/components/Navbar.tsx b/apps/oneclient/frontend/src/components/Navbar.tsx
index 505ad7a7..74913b2c 100644
--- a/apps/oneclient/frontend/src/components/Navbar.tsx
+++ b/apps/oneclient/frontend/src/components/Navbar.tsx
@@ -20,7 +20,7 @@ export function Navbar() {
Home
- Clusters
+ Clusters
Accounts
diff --git a/apps/oneclient/frontend/src/routes/app/test.tsx b/apps/oneclient/frontend/src/routes/app/clusters/index.tsx
similarity index 54%
rename from apps/oneclient/frontend/src/routes/app/test.tsx
rename to apps/oneclient/frontend/src/routes/app/clusters/index.tsx
index 9f1b1495..08b49803 100644
--- a/apps/oneclient/frontend/src/routes/app/test.tsx
+++ b/apps/oneclient/frontend/src/routes/app/clusters/index.tsx
@@ -1,9 +1,9 @@
import { createFileRoute } from '@tanstack/react-router';
-export const Route = createFileRoute('/app/test')({
+export const Route = createFileRoute('/app/clusters/')({
component: RouteComponent,
});
function RouteComponent() {
- return Hello "/app/test"!
;
+ return Hello "/app/clusters/"!
;
}
diff --git a/apps/oneclient/frontend/src/routes/app/clusters/route.tsx b/apps/oneclient/frontend/src/routes/app/clusters/route.tsx
new file mode 100644
index 00000000..66b2e11f
--- /dev/null
+++ b/apps/oneclient/frontend/src/routes/app/clusters/route.tsx
@@ -0,0 +1,57 @@
+import { AnimatedOutlet, AnimatedOutletProvider } from '@onelauncher/common/components';
+import { createFileRoute } from '@tanstack/react-router';
+
+export const Route = createFileRoute('/app/clusters')({
+ component: RouteComponent,
+});
+
+function RouteComponent() {
+ return (
+
+ );
+}
+
+function BackgroundGradients() {
+ return (
+
+ );
+}
diff --git a/apps/oneclient/frontend/src/routes/app/index.tsx b/apps/oneclient/frontend/src/routes/app/index.tsx
index bce289b7..6d36a199 100644
--- a/apps/oneclient/frontend/src/routes/app/index.tsx
+++ b/apps/oneclient/frontend/src/routes/app/index.tsx
@@ -15,36 +15,43 @@ export const Route = createFileRoute('/app/')({
component: RouteComponent,
});
+const clusters = [
+ {
+ mc_version: '1.8.9',
+ },
+ undefined,
+ {
+ mc_version: '1.21.4',
+ },
+];
+
function RouteComponent() {
- const { data: clusters } = useCommandSuspense>(
- 'getClusters',
- async () => {
- await new Promise(resolve => setTimeout(resolve, 3000)); // Simulate loading delay
- return bindings.core.getClusters();
- },
- {
- select: ((data: Array) => {
- const sorted = data.sort((a, b) => {
- if (a.last_played && b.last_played)
- return new Date(b.last_played).getTime() - new Date(a.last_played).getTime();
- else if (a.last_played)
- return -1; // a has last_played, b does not
- else if (b.last_played)
- return 1; // b has last_played, a does not
+ // const { data: clusters } = useCommandSuspense>(
+ // 'getClusters',
+ // bindings.core.getClusters,
+ // {
+ // select: ((data: Array) => {
+ // const sorted = data.sort((a, b) => {
+ // if (a.last_played && b.last_played)
+ // return new Date(b.last_played).getTime() - new Date(a.last_played).getTime();
+ // else if (a.last_played)
+ // return -1; // a has last_played, b does not
+ // else if (b.last_played)
+ // return 1; // b has last_played, a does not
- const aVersion = a.mc_version.replaceAll('.', '');
- const bVersion = b.mc_version.replaceAll('.', '');
- return Number.parseInt(bVersion) - Number.parseInt(aVersion);
- });
+ // const aVersion = a.mc_version.replaceAll('.', '');
+ // const bVersion = b.mc_version.replaceAll('.', '');
+ // return Number.parseInt(bVersion) - Number.parseInt(aVersion);
+ // });
- return [
- sorted[0],
- sorted[1],
- undefined,
- ];
- }) as (data: Array) => Array,
- },
- );
+ // return [
+ // sorted[0],
+ // sorted[1],
+ // undefined,
+ // ];
+ // }) as (data: Array) => Array,
+ // },
+ // );
return (
diff --git a/apps/oneclient/frontend/src/routes/app/route.tsx b/apps/oneclient/frontend/src/routes/app/route.tsx
index e4cf6791..269c75ad 100644
--- a/apps/oneclient/frontend/src/routes/app/route.tsx
+++ b/apps/oneclient/frontend/src/routes/app/route.tsx
@@ -1,7 +1,7 @@
import { LoaderSuspense, Navbar } from '@/components';
import { GameBackground } from '@/components/GameBackground';
import { AnimatedOutlet } from '@onelauncher/common/components';
-import { createFileRoute, Outlet } from '@tanstack/react-router';
+import { createFileRoute } from '@tanstack/react-router';
export const Route = createFileRoute('/app')({
component: RouteComponent,
@@ -16,19 +16,18 @@ function RouteComponent() {
diff --git a/packages/web_common/src/theme.css b/packages/web_common/src/theme.css
index 74ee89cc..f0be6864 100644
--- a/packages/web_common/src/theme.css
+++ b/packages/web_common/src/theme.css
@@ -83,6 +83,7 @@
* {
user-select: none !important;
-webkit-user-select: none !important;
+ -webkit-user-drag: none !important;
cursor: default !important;
}