- );
+ const store = API;
+
+ let path = this.props.location.pathname.split("/");
+ if (path[path.length-1] == "") path.pop(); // Remove trailing backslash
+
+ let tribe = (() => {
+ if (path.length !== 4) return "None";
+ if (path[2] === "Mugic") return path[3];
+ if (path[3] === "Mugic") return path[2];
+ })();
+
+ if (store.urls === null ||
+ store.portal === null ||
+ store.cards === null) {
+ return (Loading...);
+ }
+
+ // If there isn't a supported tribe,
+ // Displays list of tribes
+ if (!store.urls.Mugic.hasOwnProperty(tribe)) {
+ return(
+
+ Generic
+
+ Danian
+
+ OverWorld
+
+ UnderWorld
+
+ Mipedian
+
+ );
+ }
+
+ if (!store.cards.built.includes("mugic_Cards")) {
+ store.cards.setupMugic("Cards");
+ return (Loading...);
+ }
+
+ if (!store.portal.built.includes("mugic_"+tribe)) {
+ store.portal.setupMugic(tribe);
+ return (Loading...);
+ }
+
+ const mugic = store.portal.mugic.find({'gsx$tribe': tribe});
+ const output = mugic.map((single_mugic, i) => {
+ const card_data = store.cards.mugic.findOne({'gsx$name': single_mugic.gsx$name});
+ return (
+
+
+ {single_mugic.gsx$name}
+ {/* TODO
*/}
+
+
+ );
+ });
+
+ return ({output}
);
}
fakerender() {
diff --git a/src/components/portal/Home.js b/src/components/portal/Home.js
index 1f093ca..642bb13 100644
--- a/src/components/portal/Home.js
+++ b/src/components/portal/Home.js
@@ -10,6 +10,9 @@ export default function PortalHome() {
to="/portal/Creatures"
>Creatures