diff --git a/src/resources/icons/check.svg b/src/resources/icons/check.svg new file mode 100644 index 0000000..79a02b9 --- /dev/null +++ b/src/resources/icons/check.svg @@ -0,0 +1,10 @@ + +Created with Fabric.js 1.7.22 + + + + + + + + \ No newline at end of file diff --git a/src/ui/App.tsx b/src/ui/App.tsx index 653c64b..761c8b9 100644 --- a/src/ui/App.tsx +++ b/src/ui/App.tsx @@ -6,17 +6,19 @@ import './custom.css' import DownloadHandler from '../utils/download' // Major Components -import Topbar from './components/TopBar' +import TopBar from './components/TopBar' import ServerLaunchSection from './components/ServerLaunchSection' import ProgressBar from './components/common/ProgressBar' import MainProgressBar from './components/common/MainProgressBar' +import Options from './components/menu/Options' interface IProps { - [key: string]: never + [key: string]: never; } interface IState { - isDownloading: boolean + isDownloading: boolean; + optionsOpen: boolean; } const downloadHandler = new DownloadHandler() @@ -39,13 +41,23 @@ class App extends React.Component { super(props) this.state = { isDownloading: false, + optionsOpen: false } } render() { return (
- + { + this.setState({ optionsOpen: !this.state.optionsOpen }) + }} + downFunc={() => null} + /> + + { + this.state.optionsOpen ? : null + } diff --git a/src/ui/components/ServerLaunchSection.tsx b/src/ui/components/ServerLaunchSection.tsx index a14f53d..0a6951c 100644 --- a/src/ui/components/ServerLaunchSection.tsx +++ b/src/ui/components/ServerLaunchSection.tsx @@ -54,7 +54,7 @@ export default class ServerLaunchSection extends React.Component return (
- +
diff --git a/src/ui/components/TopBar.tsx b/src/ui/components/TopBar.tsx index 88cf1c3..7b66d75 100644 --- a/src/ui/components/TopBar.tsx +++ b/src/ui/components/TopBar.tsx @@ -8,14 +8,15 @@ import downBtn from '../../resources/icons/download.svg' import { app } from '@tauri-apps/api' interface IProps { - [key: string]: never + optFunc: () => void; + downFunc: () => void; } interface IState { version: string } export default class TopBar extends React.Component { - constructor(props: Record) { + constructor(props: IProps) { super(props) app.getVersion().then(version => { @@ -45,7 +46,7 @@ export default class TopBar extends React.Component {
minimize
-
+
settings
diff --git a/src/ui/components/common/Checkbox.css b/src/ui/components/common/Checkbox.css index e69de29..56dcd7d 100644 --- a/src/ui/components/common/Checkbox.css +++ b/src/ui/components/common/Checkbox.css @@ -0,0 +1,21 @@ +.Checkbox input[type="checkbox"] { + display: none; +} + +.CheckboxDisplay { + height: 20px; + width: 20px; + + border: 2px solid #ebebec; + border-radius: 2px; +} + +.CheckboxDisplay:hover { + cursor: pointer; + border-color: #cecece; +} + +.CheckboxDisplay img { + height: 100%; + /* filter: invert(78%) sepia(91%) saturate(923%) hue-rotate(334deg) brightness(106%) contrast(102%); */ +} \ No newline at end of file diff --git a/src/ui/components/common/Checkbox.tsx b/src/ui/components/common/Checkbox.tsx index 01406ae..ab0e3a7 100644 --- a/src/ui/components/common/Checkbox.tsx +++ b/src/ui/components/common/Checkbox.tsx @@ -1,9 +1,13 @@ import React from 'react' +import checkmark from '../../../resources/icons/check.svg' + +import './Checkbox.css' interface IProps { label: string, checked: boolean, onChange: () => void, + id: string } interface IState { @@ -27,8 +31,12 @@ export default class Checkbox extends React.Component { render() { return (
- - + +
) } diff --git a/src/ui/components/menu/Menu.css b/src/ui/components/menu/Menu.css index e69de29..02080ca 100644 --- a/src/ui/components/menu/Menu.css +++ b/src/ui/components/menu/Menu.css @@ -0,0 +1,25 @@ +.Menu { + position: fixed; + z-index: 99; + + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + + height: 70%; + width: 60%; + + background-color: #fff; +} + +.MenuInner { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.MenuHeading { + font-size: 2rem; + margin: 20px; +} \ No newline at end of file diff --git a/src/ui/components/menu/Menu.tsx b/src/ui/components/menu/Menu.tsx index 1eca86f..31c17fa 100644 --- a/src/ui/components/menu/Menu.tsx +++ b/src/ui/components/menu/Menu.tsx @@ -1,4 +1,5 @@ import React from 'react' +import './Menu.css' interface IProps { children: React.ReactNode[] | React.ReactNode; @@ -15,7 +16,9 @@ export default class Menu extends React.Component { return (
{this.props.heading}
- {this.props.children} +
+ {this.props.children} +
) } diff --git a/src/ui/components/menu/Options.css b/src/ui/components/menu/Options.css index e69de29..de09ac4 100644 --- a/src/ui/components/menu/Options.css +++ b/src/ui/components/menu/Options.css @@ -0,0 +1,5 @@ +.OptionSection { + display: flex; + flex-direction: row; + align-items: center; +} \ No newline at end of file diff --git a/src/ui/components/menu/Options.tsx b/src/ui/components/menu/Options.tsx index ae699a7..54064b3 100644 --- a/src/ui/components/menu/Options.tsx +++ b/src/ui/components/menu/Options.tsx @@ -1,8 +1,9 @@ import React from 'react' +import Checkbox from '../common/Checkbox' import Menu from './Menu' import './Options.css' -export default class Options extends React.Component<{}, never> { +export default class Options extends React.Component, never> { constructor(props: Record) { super(props) } @@ -13,7 +14,7 @@ export default class Options extends React.Component<{}, never> {
Test Option
- + console.log('Test Option Changed')} />