Spaces:
Running
Running
Download algospaced-ui/src/components/desktop/DesktopStartMenu.tsx from iamfebin/algospaced-dsa: direct link, hf CLI and curl.
- Browser
- Download file 7.68 kB
-
https://huggingface.co/spaces/iamfebin/algospaced-dsa/resolve/main/algospaced-ui/src/components/desktop/DesktopStartMenu.tsx
- Command line
-
hf download hf://spaces/iamfebin/algospaced-dsa/algospaced-ui/src/components/desktop/DesktopStartMenu.tsx
-
curl -L -o DesktopStartMenu.tsx https://huggingface.co/spaces/iamfebin/algospaced-dsa/resolve/main/algospaced-ui/src/components/desktop/DesktopStartMenu.tsx
7.68 kB
| import React from 'react'; | |
| interface DesktopStartMenuProps extends React.HTMLAttributes<HTMLDivElement> { | |
| isOpen: boolean; | |
| onOpenWindow: (id: string) => void; | |
| onTriggerSync: () => void; | |
| onSignOut: () => void; | |
| style?: React.CSSProperties; | |
| } | |
| export const DesktopStartMenu = React.forwardRef<HTMLDivElement, DesktopStartMenuProps>( | |
| ( | |
| { | |
| isOpen, | |
| onOpenWindow, | |
| onTriggerSync, | |
| onSignOut, | |
| style, | |
| className, | |
| ...rest | |
| }, | |
| ref | |
| ) => { | |
| if (!isOpen) return null; | |
| return ( | |
| <div | |
| ref={ref} | |
| onClick={(e) => e.stopPropagation()} | |
| id="start-menu" | |
| style={style} | |
| {...rest} | |
| className={`w-64 bg-white border-[3px] border-ink-black shadow-[6px_6px_0px_0px_#1E293B] flex flex-col p-4 z-[90] select-none ${style ? '' : 'absolute bottom-14 left-0 ml-2 mb-2' | |
| } ${className || ''}`} | |
| > | |
| <div className="flex items-center justify-between border-b-[2px] border-ink-black pb-2 mb-3"> | |
| <span className="font-arcade text-[9px] font-bold text-ink-black tracking-wider">ALGOSPACED OS</span> | |
| <span className="font-arcade text-[7px] font-extrabold bg-[#facc15] text-ink-black px-1.5 py-0.5 border-[1.5px] border-ink-black shadow-[1.5px_1.5px_0_0_#1E293B]"> | |
| BETA | |
| </span> | |
| </div> | |
| <div className="flex flex-col gap-2.5 font-window-title text-base font-bold"> | |
| <button | |
| onClick={() => onOpenWindow('queue')} | |
| className="w-full text-left hover:bg-secondary-container px-3 py-1.5 border-2 border-transparent hover:border-ink-black transition-colors cursor-pointer flex items-center gap-2" | |
| > | |
| <span className="material-symbols-outlined text-lg" style={{ fontVariationSettings: "'FILL' 1" }}> | |
| view_list | |
| </span> | |
| Daily Queue | |
| </button> | |
| <button | |
| onClick={() => onOpenWindow('cardManager')} | |
| className="w-full text-left hover:bg-sky-100 px-3 py-1.5 border-2 border-transparent hover:border-ink-black transition-colors cursor-pointer flex items-center gap-2" | |
| > | |
| <span className="material-symbols-outlined text-lg text-sky-600" style={{ fontVariationSettings: "'FILL' 1" }}> | |
| style | |
| </span> | |
| Card Manager | |
| </button> | |
| <button | |
| onClick={() => onOpenWindow('journey')} | |
| className="w-full text-left hover:bg-secondary-container px-3 py-1.5 border-2 border-transparent hover:border-ink-black transition-colors cursor-pointer flex items-center gap-2" | |
| > | |
| <span className="material-symbols-outlined text-lg" style={{ fontVariationSettings: "'FILL' 1" }}> | |
| route | |
| </span> | |
| Journey Path | |
| </button> | |
| <button | |
| onClick={onTriggerSync} | |
| className="w-full text-left hover:bg-secondary-container px-3 py-1.5 border-2 border-transparent hover:border-ink-black transition-colors cursor-pointer flex items-center gap-2" | |
| > | |
| <span className="material-symbols-outlined text-lg" style={{ fontVariationSettings: "'FILL' 1" }}> | |
| cloud_sync | |
| </span> | |
| Drive Sync | |
| </button> | |
| <button | |
| onClick={() => onOpenWindow('github')} | |
| className="w-full text-left hover:bg-slate-100 px-3 py-1.5 border-2 border-transparent hover:border-ink-black transition-colors cursor-pointer flex items-center gap-2" | |
| > | |
| <span className="material-symbols-outlined text-lg text-slate-800" style={{ fontVariationSettings: "'FILL' 1" }}> | |
| code | |
| </span> | |
| GitHub Solutions | |
| </button> | |
| <button | |
| onClick={() => onOpenWindow('terminal')} | |
| className="w-full text-left hover:bg-secondary-container px-3 py-1.5 border-2 border-transparent hover:border-ink-black transition-colors cursor-pointer flex items-center gap-2" | |
| > | |
| <span className="material-symbols-outlined text-lg" style={{ fontVariationSettings: "'FILL' 1" }}> | |
| terminal | |
| </span> | |
| Terminal | |
| </button> | |
| <button | |
| onClick={() => onOpenWindow('computer')} | |
| className="w-full text-left hover:bg-secondary-container px-3 py-1.5 border-2 border-transparent hover:border-ink-black transition-colors cursor-pointer flex items-center gap-2" | |
| > | |
| <span className="material-symbols-outlined text-lg" style={{ fontVariationSettings: "'FILL' 1" }}> | |
| desktop_windows | |
| </span> | |
| My Computer | |
| </button> | |
| <button | |
| onClick={() => onOpenWindow('companion')} | |
| className="w-full text-left hover:bg-[#ffe24c]/40 px-3 py-1.5 border-2 border-transparent hover:border-[#f59e0b] transition-colors cursor-pointer flex items-center gap-2" | |
| > | |
| <span className="material-symbols-outlined text-lg text-[#f59e0b]" style={{ fontVariationSettings: "'FILL' 1" }}> | |
| castle | |
| </span> | |
| Auri | |
| </button> | |
| <button | |
| onClick={() => onOpenWindow('store')} | |
| className="w-full text-left hover:bg-amber-100 px-3 py-1.5 border-2 border-transparent hover:border-ink-black transition-colors cursor-pointer flex items-center gap-2" | |
| > | |
| <span className="material-symbols-outlined text-lg text-amber-600" style={{ fontVariationSettings: "'FILL' 1" }}> | |
| storefront | |
| </span> | |
| STORE | |
| </button> | |
| <button | |
| onClick={() => onOpenWindow('python')} | |
| className="w-full text-left hover:bg-secondary-container px-3 py-1.5 border-2 border-transparent hover:border-ink-black transition-colors cursor-pointer flex items-center gap-2" | |
| > | |
| <span className="material-symbols-outlined text-lg" style={{ fontVariationSettings: "'FILL' 1" }}> | |
| sports_esports | |
| </span> | |
| Python Challenge | |
| </button> | |
| <button | |
| onClick={() => onOpenWindow('mysql')} | |
| className="w-full text-left hover:bg-secondary-container px-3 py-1.5 border-2 border-transparent hover:border-ink-black transition-colors cursor-pointer flex items-center gap-2" | |
| > | |
| <span className="material-symbols-outlined text-lg" style={{ fontVariationSettings: "'FILL' 1" }}> | |
| database | |
| </span> | |
| MySQL Playground | |
| </button> | |
| <button | |
| onClick={() => onOpenWindow('settings')} | |
| className="w-full text-left hover:bg-[#10b981]/25 px-3 py-1.5 border-2 border-transparent hover:border-[#10b981] transition-colors cursor-pointer flex items-center gap-2" | |
| > | |
| <span className="material-symbols-outlined text-lg text-[#10b981]" style={{ fontVariationSettings: "'FILL' 1" }}> | |
| key | |
| </span> | |
| API Configuration | |
| </button> | |
| </div> | |
| <div className="mt-4 flex justify-end border-t-[3px] border-ink-black pt-4 select-none"> | |
| <button | |
| onClick={onSignOut} | |
| className="bg-highlight-pink text-white font-window-title px-4 py-2.5 border-[3px] border-ink-black shadow-[3px_3px_0px_0px_#1E293B] active:translate-y-0.5 active:translate-x-0.5 active:shadow-none hover:bg-rose-600 transition-all cursor-pointer font-bold uppercase text-xs" | |
| > | |
| Shut Down | |
| </button> | |
| </div> | |
| </div> | |
| ); | |
| } | |
| ); | |
| DesktopStartMenu.displayName = 'DesktopStartMenu'; | |