diff --git a/src/resources/icons/wrench.svg b/src/resources/icons/wrench.svg new file mode 100644 index 0000000..ce1978e --- /dev/null +++ b/src/resources/icons/wrench.svg @@ -0,0 +1,10 @@ + +Created with Fabric.js 1.7.22 + + + + + + + + \ No newline at end of file diff --git a/src/ui/Mods.css b/src/ui/Mods.css new file mode 100644 index 0000000..8591764 --- /dev/null +++ b/src/ui/Mods.css @@ -0,0 +1,5 @@ +.Mods { + backdrop-filter: blur(10px); + height: 100%; + width: 100%; +} diff --git a/src/ui/Mods.tsx b/src/ui/Mods.tsx index b6bad0f..af50a21 100644 --- a/src/ui/Mods.tsx +++ b/src/ui/Mods.tsx @@ -1,29 +1,60 @@ import React from 'react' import DownloadHandler from '../utils/download' +import { ModHeader } from './components/mods/ModHeader' +import { ModList } from './components/mods/ModList' import TopBar from './components/TopBar' +import './Mods.css' + interface IProps { downloadHandler: DownloadHandler } interface IState { isDownloading: boolean + category: string } +const headers = [ + { + name: 'hot', + title: 'Hot', + }, + { + name: 'new', + title: 'New', + }, +] + export class Mods extends React.Component { constructor(props: IProps) { super(props) + + this.state = { + isDownloading: false, + category: '', + } } async componentDidMount() { return } + async setCategory(value: string) { + this.setState({ + category: value, + }) + } + render() { return ( - <> +
- + + + + +
) } } diff --git a/src/ui/components/mods/ModHeader.css b/src/ui/components/mods/ModHeader.css new file mode 100644 index 0000000..0247d8b --- /dev/null +++ b/src/ui/components/mods/ModHeader.css @@ -0,0 +1,25 @@ +.ModHeader { + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-around; + width: 100%; + + padding: 10px; + + font-size: 20px; + font-weight: bold; + color: #fff; + background: rgba(77, 77, 77, 0.6); +} + +.ModHeaderTitle { +} + +.ModHeaderTitle:hover { + cursor: pointer; +} + +.ModHeaderTitle.selected { + border-bottom: 2px solid #fff; +} diff --git a/src/ui/components/mods/ModHeader.tsx b/src/ui/components/mods/ModHeader.tsx new file mode 100644 index 0000000..f983144 --- /dev/null +++ b/src/ui/components/mods/ModHeader.tsx @@ -0,0 +1,52 @@ +import React from 'react' + +import './ModHeader.css' + +interface IProps { + headers: { + title: string + name: string + }[] + onChange: (value: string) => void + defaultHeader: string +} + +interface IState { + selected: string +} + +export class ModHeader extends React.Component { + constructor(props: IProps) { + super(props) + + this.state = { + selected: this.props.defaultHeader, + } + } + + setSelected(value: string) { + this.setState({ + selected: value, + }) + + this.props.onChange(value) + } + + render() { + return ( +
+ {this.props.headers.map((header, index) => { + return ( +
this.setSelected(header.name)} + > + {header.title} +
+ ) + })} +
+ ) + } +} diff --git a/src/ui/components/mods/ModList.css b/src/ui/components/mods/ModList.css new file mode 100644 index 0000000..4d80ffe --- /dev/null +++ b/src/ui/components/mods/ModList.css @@ -0,0 +1,6 @@ +.ModList { + width: 100%; + height: 100%; + + background-color: rgba(106, 105, 106, 0.6); +} diff --git a/src/ui/components/mods/ModList.tsx b/src/ui/components/mods/ModList.tsx new file mode 100644 index 0000000..41ce62d --- /dev/null +++ b/src/ui/components/mods/ModList.tsx @@ -0,0 +1,21 @@ +import React from 'react' + +import './ModList.css' + +interface IProps { + sort: string +} + +interface IState { + modList: string[] +} + +export class ModList extends React.Component { + constructor(props: IProps) { + super(props) + } + + render() { + return
+ } +} diff --git a/src/ui/components/mods/ModTile.tsx b/src/ui/components/mods/ModTile.tsx new file mode 100644 index 0000000..336ce12 --- /dev/null +++ b/src/ui/components/mods/ModTile.tsx @@ -0,0 +1 @@ +export {}