-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move To React: Separate the Apps into different files
- Loading branch information
1 parent
a1d8206
commit dd135b2
Showing
3 changed files
with
96 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from "react"; | ||
import minimize from "../assets/img/minimize.png"; | ||
import maximize from "../assets/img/maximize.png"; | ||
import close from "../assets/img/close.png"; | ||
|
||
interface AppProps { | ||
windowX: string; | ||
windowY: string; | ||
isOpen: boolean; | ||
isTopWindow: boolean; | ||
closeApp: () => void; | ||
setTopWindow: () => void; | ||
} | ||
|
||
const FirefoxApp: React.FC<AppProps> = ({ windowX, windowY, isOpen, isTopWindow, closeApp, setTopWindow }) => { | ||
return ( | ||
<div id="firefox" className={isOpen ? "firefoxApp show" : "firefoxApp hide"} style={{ top: windowY, left: windowX, zIndex: isTopWindow ? "3" : "1" }} onClick={setTopWindow}> | ||
<div className="app-header"> | ||
<div className="app-title"> | ||
<p>Firefox Web Browser</p> | ||
</div> | ||
<div className="app-buttons"> | ||
<img src={minimize} width="24px" height="24px" onClick={closeApp} /> | ||
<img src={maximize} width="24px" height="24px" /> | ||
<img src={close} width="24px" height="24px" onClick={closeApp} /> | ||
</div> | ||
</div> | ||
<div className="app-content"> To Do... </div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default FirefoxApp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import React from "react"; | ||
import minimize from "../assets/img/minimize.png"; | ||
import maximize from "../assets/img/maximize.png"; | ||
import close from "../assets/img/close.png"; | ||
import users from "../assets/img/users.png"; | ||
import system from "../assets/img/system.png"; | ||
|
||
interface AppProps { | ||
windowX: string; | ||
windowY: string; | ||
isOpen: boolean; | ||
isTopWindow: boolean; | ||
closeApp: () => void; | ||
setTopWindow: () => void; | ||
} | ||
|
||
const SettingsApp: React.FC<AppProps> = ({ windowX, windowY, isOpen, isTopWindow, closeApp, setTopWindow }) => { | ||
return ( | ||
<div id="settings" className={isOpen ? "settingsApp show" : "settingsApp hide"} style={{ top: windowY, left: windowX, zIndex: isTopWindow ? "3" : "1" }} onClick={setTopWindow}> | ||
<div className="app-header"> | ||
<div className="app-title"> | ||
<p>Settings</p> | ||
</div> | ||
<div className="app-buttons"> | ||
<img src={minimize} width="24px" height="24px" onClick={closeApp} /> | ||
<img src={maximize} width="24px" height="24px" /> | ||
<img src={close} width="24px" height="24px" onClick={closeApp} /> | ||
</div> | ||
</div> | ||
<div className="app-content"> | ||
<div className="settings-content"> | ||
<div className="settings-Left-Panel"> | ||
<div className="menuOption"> | ||
<img src={users} width="24px" height="24px" /> | ||
<p>Users</p> | ||
</div> | ||
<div className="menuOption"> | ||
<img src={system} width="24px" height="24px" /> | ||
<p>System</p> | ||
</div> | ||
</div> | ||
<div className="settings-Right-Panel"></div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default SettingsApp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters