diff --git a/package-lock.json b/package-lock.json index 666ed29..9b37bea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dvorakmortonxd", - "version": "2.0.0", + "version": "2.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dvorakmortonxd", - "version": "2.0.0", + "version": "2.1.0", "dependencies": { "next": "^16.3.5", "react": "^19.3.0", diff --git a/package.json b/package.json index b805d91..2a92539 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dvorakmortonxd", - "version": "2.0.0", + "version": "2.1.0", "private": true, "scripts": { "dev": "next dev --turbopack", diff --git a/src/app/components/MobileHome.tsx b/src/app/components/MobileHome.tsx index 33d1f88..f72f167 100644 --- a/src/app/components/MobileHome.tsx +++ b/src/app/components/MobileHome.tsx @@ -10,6 +10,7 @@ import { } from "react"; import { APPS, APP_BY_ID } from "./apps"; import Clock from "./Clock"; +import { useDragOrder } from "./useDragOrder"; import { MOBILE_WALLPAPER } from "../data"; const DOCK_IDS = ["projects", "services", "socials", "contributions"]; @@ -59,6 +60,11 @@ export default function MobileHome() { const openApp = openId ? APP_BY_ID[openId] : null; const closeTimer = useRef(null); + const [gridApps, setGridApps] = useState(APPS); + const [dockApps, setDockApps] = useState(() => DOCK_IDS.map((id) => ({ id }))); + const gridDrag = useDragOrder(setGridApps); + const dockDrag = useDragOrder(setDockApps); + const clearCloseTimer = () => { if (closeTimer.current !== null) { window.clearTimeout(closeTimer.current); @@ -101,15 +107,24 @@ export default function MobileHome() { setOpenId(appId); }; - const renderIcon = (appId: string, inDock = false) => { + const renderIcon = (appId: string, inDock: boolean, drag: ReturnType) => { const app = APP_BY_ID[appId]; if (!app) return null; return ( + )} @@ -265,15 +338,18 @@ export default function WindowsDesktop() { focus(w.id)} onClose={() => closeWin(w.id)} onCloseAnimationEnd={() => finishClose(w.id)} onMinimize={() => minimizeWin(w.id)} + onMinimizeAnimationEnd={() => finishMinimize(w.id)} onToggleMaximize={() => toggleMax(w.id)} onMove={(x, y) => moveWin(w.id, x, y)} + onResize={(x, y, width, height) => resizeWin(w.id, x, y, width, height)} /> ))} @@ -294,7 +370,7 @@ export default function WindowsDesktop() {
Applications
- {LEFT_APPS.map((app) => ( + {leftApps.map((app) => ( ))} - {SERVICE_SHORTCUTS.map((s) => - s.appId ? ( - - ) : ( - - {s.icon} - {s.label} - - ) - )} - {FRIEND_SHORTCUTS.map((f) => ( - ( + + ))} + {friendItems.map((f) => ( + ))}
@@ -370,7 +434,7 @@ export default function WindowsDesktop() {
{wins.map((w) => { - const app = APP_BY_ID[w.appId]; + const app = getApp(w.appId) ?? APP_BY_ID.welcome; return (