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, Element, Mugic, Discipline, Ability, Tribe } from '../../Snippets'; function Artist(props) { let artists = []; props.artist.split(/(?=, )/).forEach((artist, i) => { artists.push({artist}); }); return (
{artists}
) } @inject((stores, props, context) => props) @observer export default class SingleCreature extends React.Component { // ** Process the tribe ** // // /portal/Creatures/{Tribe}/{Name} // /portal/{Tribe}/Creatures/{Name} // The first / gets counted render() { let path = this.props.location.pathname.split("/"); if (path[path.length-1] == "") path.pop(); // Remove trailing backslash const name = (() => { if (path.length >= 5) return decodeURIComponent(path[4]); if (path.length == 4) return decodeURIComponent(path[3]); })(); const creature = API.portal.creatures.findOne({ 'gsx$name': name }); if (!creature) { return(); } const tribe = creature.gsx$tribe; const card_data = API.cards.creatures.findOne({ 'gsx$name': name }); const locations = creature.gsx$location.split(/[;]+\s*/).map((item, i) => { return

{item}

; }); const battlegear = creature.gsx$battlegear.split(/[;]+\s*/).map((item, i) => { return

{item}

; }); let mugic = []; for (let i = 0; i < card_data.gsx$mugicability; i++) { mugic.push(); } // TODO readd creature to Portal Search after rewrite return (
{creature.gsx$appearance && <>
Appearance:
{creature.gsx$appearance}

}
Background:
{creature.gsx$background}

Details:
{creature.gsx$details}

Favorite Battlegear(s):
{battlegear}

Favorite Location(s):
{locations}

Height (ft):
{creature.gsx$height}

Special Abilities:
{creature.gsx$specialabilities}

Weight (lb):
{creature.gsx$weight}

{card_data.gsx$artist && <>
Artist(s):

}
Card ID: {card_data.gsx$id}

Set: {card_data.gsx$set}

Rarity: {card_data.gsx$rarity}

Tribe:

Ability:

Courage: {card_data.gsx$courage}

Power: {card_data.gsx$power}

Speed: {card_data.gsx$speed}

Wisdom: {card_data.gsx$wisdom}

Energy: {card_data.gsx$energy}

Elements:
=0} />  =0} />  =0} />  =0} />

Flavortext:
{card_data.gsx$flavortext}

Mugic Ability: {mugic}
} />); } }