mod list colors and such

This commit is contained in:
SpikeHD
2022-07-21 23:46:51 -07:00
parent c659979851
commit f946cedb4d
8 changed files with 153 additions and 2 deletions

5
src/ui/Mods.css Normal file
View File

@@ -0,0 +1,5 @@
.Mods {
backdrop-filter: blur(10px);
height: 100%;
width: 100%;
}

View File

@@ -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<IProps, IState> {
constructor(props: IProps) {
super(props)
this.state = {
isDownloading: false,
category: '',
}
}
async componentDidMount() {
return
}
async setCategory(value: string) {
this.setState({
category: value,
})
}
render() {
return (
<>
<div className="Mods">
<TopBar />
</>
<ModHeader onChange={this.setCategory} headers={headers} defaultHeader={'hot'} />
<ModList sort={this.state.category} />
</div>
)
}
}

View File

@@ -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;
}

View File

@@ -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<IProps, IState> {
constructor(props: IProps) {
super(props)
this.state = {
selected: this.props.defaultHeader,
}
}
setSelected(value: string) {
this.setState({
selected: value,
})
this.props.onChange(value)
}
render() {
return (
<div className="ModHeader">
{this.props.headers.map((header, index) => {
return (
<div
key={index}
className={`ModHeaderTitle ${this.state.selected === header.name ? 'selected' : ''}`}
onClick={() => this.setSelected(header.name)}
>
{header.title}
</div>
)
})}
</div>
)
}
}

View File

@@ -0,0 +1,6 @@
.ModList {
width: 100%;
height: 100%;
background-color: rgba(106, 105, 106, 0.6);
}

View File

@@ -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<IProps, IState> {
constructor(props: IProps) {
super(props)
}
render() {
return <div className="ModList"></div>
}
}

View File

@@ -0,0 +1 @@
export {}