diff --git a/src/components/portal/Single/Attack.js b/src/components/portal/Single/Attack.js index 5527336..a4739a8 100644 --- a/src/components/portal/Single/Attack.js +++ b/src/components/portal/Single/Attack.js @@ -23,31 +23,37 @@ export default class SingleAttack extends React.Component { let name = decodeURIComponent(path[3]); const attack = API.portal.attacks.findOne({'gsx$name': name}); - if (!attack) { - return(); - } - const card_data = API.cards.attacks.findOne({'gsx$name': name}); - return ( -
- Attributes:
- {attack.gsx$attributes} -
-
-
- Background:
- {attack.gsx$background} -
-
-
- Details:
- {attack.gsx$details} -
- } - /> - ); + if (attack) { + return ( +
+ Attributes:
+ {attack.gsx$attributes} +
+
+
+ Background:
+ {attack.gsx$background} +
+
+
+ Details:
+ {attack.gsx$details} +
+ } + /> + ); + } + else { + if (card_data.gsx$splash) { + return (); + } + else { + return(); + } + } } } diff --git a/src/components/portal/Single/Battlegear.js b/src/components/portal/Single/Battlegear.js index 19b5935..701c87a 100644 --- a/src/components/portal/Single/Battlegear.js +++ b/src/components/portal/Single/Battlegear.js @@ -23,30 +23,36 @@ export default class SingleBattlegear extends React.Component { let name = decodeURIComponent(path[3]); const battlegear = API.portal.battlegear.findOne({'gsx$name': name}); - if (!battlegear) { - return(); - } - const card_data = API.cards.battlegear.findOne({'gsx$name': name}); - return ( -
- Attributes:
- {battlegear.gsx$attributes} -
-
-
- Background:
- {battlegear.gsx$background} -
-
-
- Details:
- {battlegear.gsx$details} -
- } - />); + if (battlegear) { + return ( +
+ Attributes:
+ {battlegear.gsx$attributes} +
+
+
+ Background:
+ {battlegear.gsx$background} +
+
+
+ Details:
+ {battlegear.gsx$details} +
+ } + />); + } + else { + if (card_data.gsx$splash) { + return (); + } + else { + return(); + } + } } } diff --git a/src/components/portal/Single/Location.js b/src/components/portal/Single/Location.js index cdb9cab..0a94a15 100644 --- a/src/components/portal/Single/Location.js +++ b/src/components/portal/Single/Location.js @@ -1,8 +1,5 @@ import React from 'react'; -import Interactive from 'react-interactive'; -import { Link } from 'react-router-dom'; import API from '../../SpreadsheetData'; -import s from '../../../styles/app.style'; import {observer, inject} from 'mobx-react'; import Single from './_base'; import {PageNotFound, Initiative} from '../../Snippets'; @@ -23,36 +20,50 @@ export default class SingleLocation extends React.Component { let name = decodeURIComponent(path[3]); const location = API.portal.locations.findOne({'gsx$name': name}); - if (!location) { - return(); - } - const card_data = API.cards.locations.findOne({'gsx$name': name}); - return ( -
- Initiative: - -
- } - col2={ -
- Local Features:
- {location.gsx$localfeatures} -
-
-
- Background:
- {location.gsx$background} -
-
-
- Details:
- {location.gsx$details} -
-
} - />); + if (location) { + return ( +
+ Initiative: + +
+ } + col2={ +
+ Local Features:
+ {location.gsx$localfeatures} +
+
+
+ Background:
+ {location.gsx$background} +
+
+
+ Details:
+ {location.gsx$details} +
+
} + />); + } + else { + if (card_data.gsx$splash) { + return ( +
+ Initiative: + +
+ } + />); + } + else { + return(); + } + } } } diff --git a/src/components/portal/Single/Mugic.js b/src/components/portal/Single/Mugic.js index 33e8d72..8715abb 100644 --- a/src/components/portal/Single/Mugic.js +++ b/src/components/portal/Single/Mugic.js @@ -1,11 +1,9 @@ import React from 'react'; -import Interactive from 'react-interactive'; -import { Link } from 'react-router-dom'; import API from '../../SpreadsheetData'; import s from '../../../styles/app.style'; import {observer, inject} from 'mobx-react'; import Single from './_base'; -import {PageNotFound, Rarity, Unique, Name, Element, Mugic, Discipline, Ability, Tribe} from '../../Snippets'; +import {PageNotFound, Mugic, Tribe} from '../../Snippets'; @inject((stores, props, context) => props) @observer export default class SingleMugic extends React.Component { @@ -25,52 +23,71 @@ export default class SingleMugic extends React.Component { })(); const mugic = API.portal.mugic.findOne({'gsx$name': name}); - - if (!mugic) { - return(); - } - - const tribe = mugic.gsx$tribe; - const card_data = API.cards.mugic.findOne({'gsx$name': name}); - let cost = []; - if (card_data.gsx$cost == 0) { - cost.push(0); - } - else if (card_data.gsx$cost.toLowerCase() == 'x') { - cost.push(X); - } - else { - for (let i = 0; i < card_data.gsx$cost; i++) { - cost.push(); + const cost = () => { + let cost = []; + if (card_data.gsx$cost == 0) { + cost.push(0); } + else if (card_data.gsx$cost.toLowerCase() == 'x') { + cost.push(X); + } + else { + for (let i = 0; i < card_data.gsx$cost; i++) { + cost.push(); + } + } + return cost; } - return ( -
- Tribe: - -
-
-
- Cost: - {cost} -
- } - col2={ -
- Background:
- {mugic.gsx$background} -
-
-
- Details:
- {mugic.gsx$details} -
-
} - />); + if (mugic) { + return ( +
+ Tribe: + +
+
+
+ Cost: + {cost()} +
+ } + col2={ +
+ Background:
+ {mugic.gsx$background} +
+
+
+ Details:
+ {mugic.gsx$details} +
+
} + />); + } + else { + if (card_data.gsx$splash) { + return ( +
+ Tribe: + +
+
+
+ Cost: + {cost()} +
+ } + />); + } + else { + return(); + } + } } }