mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-16 17:14:36 +01:00
mod list colors and such
This commit is contained in:
25
src/ui/components/mods/ModHeader.css
Normal file
25
src/ui/components/mods/ModHeader.css
Normal 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;
|
||||
}
|
||||
52
src/ui/components/mods/ModHeader.tsx
Normal file
52
src/ui/components/mods/ModHeader.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
}
|
||||
6
src/ui/components/mods/ModList.css
Normal file
6
src/ui/components/mods/ModList.css
Normal file
@@ -0,0 +1,6 @@
|
||||
.ModList {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
background-color: rgba(106, 105, 106, 0.6);
|
||||
}
|
||||
21
src/ui/components/mods/ModList.tsx
Normal file
21
src/ui/components/mods/ModList.tsx
Normal 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>
|
||||
}
|
||||
}
|
||||
1
src/ui/components/mods/ModTile.tsx
Normal file
1
src/ui/components/mods/ModTile.tsx
Normal file
@@ -0,0 +1 @@
|
||||
export {}
|
||||
Reference in New Issue
Block a user