diff --git a/src/mods.go b/src/mods.go
index 714442b..efcd224 100644
--- a/src/mods.go
+++ b/src/mods.go
@@ -4,7 +4,6 @@ import (
"io/ioutil"
"log"
"encoding/json"
- "os"
)
type Mod struct {
@@ -22,20 +21,16 @@ func listInstalledMods(modDir string) ([]Mod, error) {
if err != nil {
log.Println(err.Error())
- os.Exit(1)
+ return nil, err
}
- log.Print(file)
-
var result ModsList
err_json := json.Unmarshal(file, &result)
if err_json != nil {
log.Println(err_json.Error())
- os.Exit(1)
+ return result.Mods, err_json
}
- log.Printf("%v", result)
-
return result.Mods, nil
}
diff --git a/ui/App/components/Mods/Mod.jsx b/ui/App/components/Mods/Mod.jsx
index deeb978..63d89e0 100644
--- a/ui/App/components/Mods/Mod.jsx
+++ b/ui/App/components/Mods/Mod.jsx
@@ -1,14 +1,6 @@
import React from 'react';
class Mod extends React.Component {
- togglePress(e) {
- e.preventDefault();
- console.log(this.refs.modName);
- const node = this.refs.modName;
- const modName = node.name;
- this.props.toggleMod(modName);
- }
-
render() {
if (this.props.mod.enabled === "false") {
this.modStatus = Disabled
@@ -20,14 +12,12 @@ class Mod extends React.Component {
{this.props.mod.name} |
{this.modStatus} |
-
+
|
)
@@ -35,8 +25,7 @@ class Mod extends React.Component {
}
Mod.propTypes = {
- mod: React.PropTypes.object.isRequired,
- toggleMod: React.PropTypes.func.isRequired
+ mod: React.PropTypes.object.isRequired
}
export default Mod
diff --git a/ui/App/components/Mods/overview.jsx b/ui/App/components/Mods/overview.jsx
new file mode 100644
index 0000000..b992738
--- /dev/null
+++ b/ui/App/components/Mods/overview.jsx
@@ -0,0 +1,43 @@
+import React from 'react';
+import Mod from './Mod';
+
+class ModOverview extends React.Component {
+ render() {
+
+
+
Manage Mods
+
+
+
+
+
+
+
+ Name |
+ Status |
+ Toggle Status |
+
+
+
+ {this.props.installedMods.map ( (mod, i) => {
+ return(
+
+ )
+ })}
+
+
+
+
+
+ }
+}
+
+ModOverview.propTypes = {
+ installedMods: React.PropTypes.array.isRequired
+}
+
+export default ModOverview;
\ No newline at end of file
diff --git a/ui/App/components/ModsContent.js b/ui/App/components/ModsContent.js
index 3ae95e0..8ce6f64 100644
--- a/ui/App/components/ModsContent.js
+++ b/ui/App/components/ModsContent.js
@@ -1,5 +1,6 @@
import React from 'react';
import {IndexLink} from 'react-router';
+import ModOverview from './Mods/overview';
class ModsContent extends React.Component {
constructor(props) {
@@ -46,7 +47,9 @@ class ModsContent extends React.Component {
)