From f6166f2ced6d87786f8fbfb187d09b58ffbb5900 Mon Sep 17 00:00:00 2001 From: LynithDev <61880709+LynithDev@users.noreply.github.com> Date: Wed, 15 May 2024 11:11:30 +0200 Subject: [PATCH] screenshots --- desktop/src/index.tsx | 2 + desktop/src/ui/pages/cluster/ClusterMods.tsx | 2 +- desktop/src/ui/pages/cluster/ClusterRoot.tsx | 2 +- .../ui/pages/cluster/ClusterScreenshots.tsx | 45 +++++++++++++++++++ package.json | 2 +- 5 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 desktop/src/ui/pages/cluster/ClusterScreenshots.tsx diff --git a/desktop/src/index.tsx b/desktop/src/index.tsx index 10b26960..0ccffc50 100644 --- a/desktop/src/index.tsx +++ b/desktop/src/index.tsx @@ -12,6 +12,7 @@ import ClusterOverview from './ui/pages/cluster/ClusterOverview'; import ClusterMods from './ui/pages/cluster/ClusterMods'; import ClusterRoot from '~ui/pages/cluster/ClusterRoot'; import ClusterLogs from '~ui/pages/cluster/ClusterLogs'; +import ClusterScreenshots from '~ui/pages/cluster/ClusterScreenshots'; render(() => ( @@ -22,6 +23,7 @@ render(() => ( + ), document.getElementById('root') as HTMLElement); diff --git a/desktop/src/ui/pages/cluster/ClusterMods.tsx b/desktop/src/ui/pages/cluster/ClusterMods.tsx index b1c465d1..b1360701 100644 --- a/desktop/src/ui/pages/cluster/ClusterMods.tsx +++ b/desktop/src/ui/pages/cluster/ClusterMods.tsx @@ -1,7 +1,7 @@ import { open } from '@tauri-apps/plugin-shell'; import { ArrowRightIcon, Edit02Icon, LinkExternal01Icon, Trash03Icon } from '@untitled-theme/icons-solid'; import { OverlayScrollbarsComponent } from 'overlayscrollbars-solid'; -import { For, Show } from 'solid-js'; +import { For } from 'solid-js'; import * as uuid from 'uuid'; import Button from '~ui/components/base/Button'; diff --git a/desktop/src/ui/pages/cluster/ClusterRoot.tsx b/desktop/src/ui/pages/cluster/ClusterRoot.tsx index bec4b236..b6850d7e 100644 --- a/desktop/src/ui/pages/cluster/ClusterRoot.tsx +++ b/desktop/src/ui/pages/cluster/ClusterRoot.tsx @@ -1,6 +1,6 @@ import { useSearchParams } from '@solidjs/router'; import type { ParentProps } from 'solid-js'; -import { EyeIcon, File06Icon, Globe04Icon, Image03Icon, PackagePlusIcon, Settings04Icon, Tool02Icon, User01Icon } from '@untitled-theme/icons-solid'; +import { EyeIcon, File06Icon, Globe04Icon, Image03Icon, PackagePlusIcon, Settings04Icon, Tool02Icon } from '@untitled-theme/icons-solid'; import Sidebar from '../../components/Sidebar'; import AnimatedRoutes from '../../components/AnimatedRoutes'; import ErrorBoundary from '../../components/ErrorBoundary'; diff --git a/desktop/src/ui/pages/cluster/ClusterScreenshots.tsx b/desktop/src/ui/pages/cluster/ClusterScreenshots.tsx new file mode 100644 index 00000000..d0d833b2 --- /dev/null +++ b/desktop/src/ui/pages/cluster/ClusterScreenshots.tsx @@ -0,0 +1,45 @@ +import { OverlayScrollbarsComponent } from 'overlayscrollbars-solid'; +import { For } from 'solid-js'; + +const list = Array(19).fill({ + date_taken: Math.floor(Date.now() / 1000), + path: 'https://www.researchgate.net/publication/301648368/figure/fig2/AS:667842240315400@1536237406360/A-screenshot-from-Minecraft-a-popular-video-game-which-poses-a-challenging-lifelong.ppm', +}); + +// TODO: Make sure the screenshots in the list are downscaled, grid / container can get laggy on low end devices +interface Screenshot { + path: string; + date_taken: number; +}; + +function ClusterScreenshots() { + return ( +
+

Screenshots

+ +
+ +
+ + {screenshot => ( + + )} + +
+
+
+
+ ); +} + +export default ClusterScreenshots; + +function ScreenshotEntry(props: Screenshot) { + return ( +
+ {/*
*/} + {props.path} + {/*
*/} +
+ ); +} diff --git a/package.json b/package.json index 62f6d0ec..e47fe971 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@onelauncher/root", "type": "module", "version": "1.0.0", - "packageManager": "pnpm@9.1.0", + "packageManager": "pnpm@9.1.1", "description": "Next-generation open source Minecraft launcher and tools for interacting with Polyfrost", "license": "GPL-3.0-only", "repository": {