mirror of
https://github.com/OpenFactorioServerManager/factorio-server-manager.git
synced 2024-12-31 03:11:17 +02:00
feature: delete modpacks
This commit is contained in:
parent
f92564b1a8
commit
b79efab742
@ -116,7 +116,7 @@ const Mods = () => {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{modPacks.map((pack, i) => <ModPack key={i} modPack={pack}/>)}
|
||||
{modPacks.map((pack, i) => <ModPack key={i} modPack={pack} reloadModPacks={fetchModPacks}/>)}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
|
@ -1,10 +1,22 @@
|
||||
import React from "react";
|
||||
import {faTrashAlt} from "@fortawesome/free-solid-svg-icons";
|
||||
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
|
||||
import modsResource from "../../../../api/resources/mods";
|
||||
|
||||
const ModPack = ({modPack, reloadModPacks}) => {
|
||||
|
||||
const deleteModPack = name => {
|
||||
modsResource.packs.delete(name)
|
||||
.then(reloadModPacks)
|
||||
}
|
||||
|
||||
const ModPack = ({modPack}) => {
|
||||
return (
|
||||
<tr>
|
||||
<td>{modPack.name}</td>
|
||||
<td/>
|
||||
<td>
|
||||
<FontAwesomeIcon className={"text-red cursor-pointer hover:text-red-light"}
|
||||
onClick={() => deleteModPack(modPack.name)} icon={faTrashAlt}/>
|
||||
</td>
|
||||
</tr>
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user