From 5ab07e55b6cf7c0af7b3fa144ffc6f95a6e6eb9a Mon Sep 17 00:00:00 2001 From: Plsr Date: Mon, 20 Feb 2023 00:06:30 +0100 Subject: [PATCH 1/6] Refactor AppWindow component --- src/components/AppWindow.tsx | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/src/components/AppWindow.tsx b/src/components/AppWindow.tsx index e36e844..d78a91a 100644 --- a/src/components/AppWindow.tsx +++ b/src/components/AppWindow.tsx @@ -46,10 +46,9 @@ const AppWindow: FC = ({ app, className }) => { bounds="parent" defaultPosition={{ x: left, y: top }} handle=".handle"> - {name} @@ -62,13 +61,13 @@ const AppWindow: FC = ({ app, className }) => { - +
{React.createElement(component, { shouldClose: shouldClose, onCloseConfirm: handleCloseConfirm, })} - - +
+ ) } @@ -101,30 +100,10 @@ const TitleBarTitle = styled.p` cursor: default; ` -const Content = styled.div` - width: 100%; - height: 100%; -` - const TitleBarButton = styled.div` cursor: pointer; ` -const Window = styled.div<{ width: number; height: number }>` - width: ${(props) => props.width + 'px'}; - height: ${(props) => props.height + 'px'}; - background-color: white; - border-radius: 8px; - position: absolute; - pointer-events: auto; - box-shadow: 0.9px 1px 5.4px rgba(0, 0, 0, 0.02), - 2.1px 2.3px 12.9px rgba(0, 0, 0, 0.028), - 3.9px 4.4px 24.3px rgba(0, 0, 0, 0.035), - 6.9px 7.8px 43.3px rgba(0, 0, 0, 0.042), - 13px 14.6px 81px rgba(0, 0, 0, 0.05), 31px 35px 194px rgba(0, 0, 0, 0.07); - overflow: hidden; -` - interface AppWindowProps { app: App className?: string From ad0270393fdaf56eb510d0fd716ccd37521aa979 Mon Sep 17 00:00:00 2001 From: Plsr Date: Mon, 20 Feb 2023 00:06:45 +0100 Subject: [PATCH 2/6] Add basic browser app Almost no funcitonality yet, but it can browse the web a little. --- src/app-components/BrowserApp.tsx | 30 ++++++++++++++++++++++++++++++ src/util/appDirectory.tsx | 11 +++++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/app-components/BrowserApp.tsx diff --git a/src/app-components/BrowserApp.tsx b/src/app-components/BrowserApp.tsx new file mode 100644 index 0000000..41ffd67 --- /dev/null +++ b/src/app-components/BrowserApp.tsx @@ -0,0 +1,30 @@ +import { useState } from 'react' + +export const BrowserApp = () => { + const [address, setAddress] = useState('https://www.google.com/search?igu=1') + const [addressInputVal, setAddressInputVal] = useState( + 'https://www.google.com/search?igu=1', + ) + + const handleClick = () => { + if (!addressInputVal) { + return + } + + setAddress(addressInputVal) + } + + return ( +
+
+ setAddressInputVal(event.target.value)} + className="w-3/4" + /> + +
+