mod tiles and nsfw blurring

This commit is contained in:
SpikeHD
2022-07-23 20:33:36 -07:00
parent d97e5c192f
commit 95267720a4
5 changed files with 105 additions and 25 deletions

View File

@@ -1,15 +1,16 @@
import React from 'react'
import { getMods } from '../../../utils/gamebanana'
import { getMods, ModData } from '../../../utils/gamebanana'
import { LoadingCircle } from './LoadingCircle'
import './ModList.css'
import { ModTile } from './ModTile'
interface IProps {
mode: string
}
interface IState {
modList: string[]
modList: ModData[]
}
export class ModList extends React.Component<IProps, IState> {
@@ -22,13 +23,23 @@ export class ModList extends React.Component<IProps, IState> {
const mods = await getMods(this.props.mode)
console.log(mods)
this.setState({
modList: mods,
})
}
render() {
return (
<div className="ModList">
<LoadingCircle />
{this.state && this.state.modList ? (
<div className="ModListInner">
{this.state.modList.map((mod: ModData) => (
<ModTile mod={mod} key={mod.id} />
))}
</div>
) : (
<LoadingCircle />
)}
</div>
)
}