mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-13 23:54:48 +01:00
Linting & prettier
Bump version
This commit is contained in:
@@ -143,12 +143,13 @@ export class Mods extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
async setSearch(text: string) {
|
||||
if(this.timeout) clearTimeout(this.timeout);
|
||||
if (this.timeout) clearTimeout(this.timeout)
|
||||
this.timeout = window.setTimeout(() => {
|
||||
this.setState({
|
||||
search: text,
|
||||
},
|
||||
this.forceUpdate
|
||||
this.setState(
|
||||
{
|
||||
search: text,
|
||||
},
|
||||
this.forceUpdate
|
||||
)
|
||||
}, 300)
|
||||
}
|
||||
@@ -207,13 +208,15 @@ export class Mods extends React.Component<IProps, IState> {
|
||||
{this.state.category != 'installed' && (
|
||||
<>
|
||||
<div className="ModPagesPage">
|
||||
<TextInput
|
||||
<TextInput
|
||||
id="search"
|
||||
key="search"
|
||||
placeholder={this.state.page.toString()}
|
||||
onChange={(text: string) => {this.setSearch(text)}}
|
||||
onChange={(text: string) => {
|
||||
this.setSearch(text)
|
||||
}}
|
||||
initalValue={''}
|
||||
/>
|
||||
/>
|
||||
</div>
|
||||
<ModPages onClick={this.setPage} headers={pages} defaultHeader={this.state.page} />
|
||||
</>
|
||||
|
||||
@@ -17,11 +17,11 @@ interface IState {
|
||||
horny: boolean
|
||||
modList: ModData[] | null
|
||||
installedList:
|
||||
| {
|
||||
path: string
|
||||
info: ModData | PartialModData
|
||||
}[]
|
||||
| null
|
||||
| {
|
||||
path: string
|
||||
info: ModData | PartialModData
|
||||
}[]
|
||||
| null
|
||||
}
|
||||
|
||||
export class ModList extends React.Component<IProps, IState> {
|
||||
@@ -68,7 +68,9 @@ export class ModList extends React.Component<IProps, IState> {
|
||||
|
||||
if (!(this.props.search == '')) {
|
||||
// idk the api so just filter all mods to search
|
||||
mods = (await getAllMods(this.props.mode)).filter(mod => mod.name.toLowerCase().includes(this.props.search.toLowerCase()))
|
||||
mods = (await getAllMods(this.props.mode)).filter((mod) =>
|
||||
mod.name.toLowerCase().includes(this.props.search.toLowerCase())
|
||||
)
|
||||
} else {
|
||||
mods = await getMods(this.props.mode, this.props.page)
|
||||
}
|
||||
@@ -89,21 +91,21 @@ export class ModList extends React.Component<IProps, IState> {
|
||||
return (
|
||||
<div className="ModList">
|
||||
{(this.state.modList && this.props.mode !== 'installed') ||
|
||||
(this.state.installedList && this.props.mode === 'installed') ? (
|
||||
(this.state.installedList && this.props.mode === 'installed') ? (
|
||||
<div className="ModListInner">
|
||||
{this.props.mode === 'installed'
|
||||
? this.state.installedList?.map((mod) => (
|
||||
<ModTile
|
||||
horny={this.state.horny}
|
||||
path={mod.path}
|
||||
mod={mod.info}
|
||||
key={mod.info.name}
|
||||
onClick={this.downloadMod}
|
||||
/>
|
||||
))
|
||||
<ModTile
|
||||
horny={this.state.horny}
|
||||
path={mod.path}
|
||||
mod={mod.info}
|
||||
key={mod.info.name}
|
||||
onClick={this.downloadMod}
|
||||
/>
|
||||
))
|
||||
: this.state.modList?.map((mod: ModData) => (
|
||||
<ModTile horny={this.state.horny} mod={mod} key={mod.id} onClick={this.downloadMod} />
|
||||
))}
|
||||
<ModTile horny={this.state.horny} mod={mod} key={mod.id} onClick={this.downloadMod} />
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<LoadingCircle />
|
||||
|
||||
@@ -124,7 +124,7 @@ export default class NewsSection extends React.Component<IProps, IState> {
|
||||
case 'latest_version':
|
||||
news = (
|
||||
<tr>
|
||||
<td>Latest version: Grasscutter 1.4.8 - Cultivation 1.0.26</td>
|
||||
<td>Latest version: Grasscutter 1.4.8 - Cultivation 1.0.27</td>
|
||||
</tr>
|
||||
)
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user