Every icon on the Log Portfolio desktop — About Me, My Computer, Control Panel, Internet Explorer, MSN Messenger, and Outlook Express — is driven by a single array inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/log-portfolio/llms.txt
Use this file to discover all available pages before exploring further.
components/Desktop.js. Adding a new window is as simple as appending one object to that array and writing the React component that will render inside it.
The Desktop App Registry
The registry array is assigned to the constantee near the bottom of components/Desktop.js. Each entry fully describes both the desktop icon and the window it opens:
Registry Entry Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the window. Also used as the hash route when opening from a static page. |
title | string | Text shown in the window’s title bar and below the desktop icon. |
icon | ReactNode | A Lucide icon at size={32} for the desktop grid. The same icon is cloned at size={16} for the taskbar button automatically. |
component | ReactNode | The React element rendered as the window’s scrollable content area. |
defaultSize | { width: number, height: number } | Initial pixel dimensions of the window when it opens. The user can resize it after opening. |
Adding a New Window
Write your content component
Create the React component that will live inside the window. You can define it inline in
Desktop.js (as all the built-in apps do) or import it from a separate file. Keep the root element at h-full so it fills the window:Import an icon
All icons are Lucide React icons, accessed through Choose an icon that visually represents your window’s content.
../assets/createLucideIcon.js in the built bundle. In source, import directly from lucide-react:Add an entry to the registry array
Open That’s it — no additional routing, context registration, or boilerplate required.
components/Desktop.js and add a new object to the ee array. Pick a unique id that has not been used by any other entry:Opening Windows Programmatically
If you need to open a window from inside another component — for example, a button inside the blog that opens the contact form — use theuseWindows() hook from contexts/WindowContext.js:
Duplicate Window Behaviour
openWindow checks whether a window with the same id already exists in the windows state. If a matching window is found, it is focused and un-minimized rather than opened a second time. This means you never end up with two copies of the same window — safe to call from anywhere, as many times as you like.
Linking from a Static URL
Log Portfolio includes pre-built static pages in thepages/ directory (e.g. pages/AboutPage.html) that deep-link directly into a specific window without requiring the user to double-click the icon. Each static page sets a global variable before the app boots:
Set the route value
Update the
__STATIC_PAGE_ROUTE__ value and the hash assignment to a unique path that matches your window’s id:The
icon field in each registry entry is stored at size={32} for the desktop grid. When the desktop component opens a window, it calls React.cloneElement(entry.icon, { size: 16 }) to create the smaller taskbar variant automatically — so you only need to specify the icon once.