diff --git a/404.html b/404.html index 5eea322..ac8090b 100644 --- a/404.html +++ b/404.html @@ -2,7 +2,7 @@ - Chaotic Backup Collection + Chaotic Backup diff --git a/package.json b/package.json index 278b2e5..cbf6c31 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,14 @@ { - "name": "chaoticbackup-collection", + "name": "chaoticbackup", "version": "0.0.2", - "description": "Chaotic Backup Collection", + "description": "Chaotic Backup", "scripts": { "start": "webpack-dev-server -d --inline --host 0.0.0.0 --history-api-fallback --progress", "build": "webpack -p" }, "repository": { "type": "git", - "url": "git+https://github.com/chaoticbackup/collection.git" + "url": "git+https://github.com/chaoticbackup/chaoticbackup.github.io.git" }, "author": "Danude Sandstorm", "license": "MIT", diff --git a/src/components/App.js b/src/components/App.js index d2481e3..9b44a1d 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -2,7 +2,7 @@ import React, { PropTypes } from 'react'; import Interactive from 'react-interactive'; import { Link } from 'react-router'; import s from '../styles/app.style'; -import {ChangePage, language, bkgrnd } from './Helper'; +import {ChangePage, language, bkgrnd } from './AppHelper'; const propTypes = { children: PropTypes.element.isRequired, @@ -55,7 +55,7 @@ function App({ children, routes }) {
  • Trade
  • Home
  • Forums
  • -
  • Collection
  • +
  • Portal
  • Play
  • diff --git a/src/components/Helper.js b/src/components/AppHelper.js similarity index 76% rename from src/components/Helper.js rename to src/components/AppHelper.js index 68cb8d6..28e07c4 100644 --- a/src/components/Helper.js +++ b/src/components/AppHelper.js @@ -7,15 +7,15 @@ export function ChangePage(asParams) { let location = "#"; switch (asParams) { case 'collect': - location = 'http://www.tradecardsonline.com/im/editCollection/collection_type/1'; + location = '/collection/'; + break; + case 'register': break; - // case 'register' : - // location ='/Registration.aspx'; - // break; case 'build': location = 'http://www.tradecardsonline.com/?action=selectCard&goal=DK&game_id=82'; break; case 'centerOval': + location = '/'; break; case 'enterTheCode': break; @@ -23,7 +23,7 @@ export function ChangePage(asParams) { location = 'http://www.tradecardsonline.com/?action=selectCard&goal=&game_id=82'; break; case 'portal': - location = ('/collection/') + location = '/portal/'; break; case 'forum': location = 'http://chaoticbackup.forumotion.com'; @@ -32,7 +32,7 @@ export function ChangePage(asParams) { location = 'http://www.tradecardsonline.com/?action=selectCard&goal=DK&game_id=82'; break; default: - location = '/collection/UnderConstruction/'; + location = '/construction/'; break; } return location; diff --git a/src/components/ExampleComponent.js b/src/components/ExampleComponent.js new file mode 100644 index 0000000..f08ddda --- /dev/null +++ b/src/components/ExampleComponent.js @@ -0,0 +1,33 @@ +import React, { PropTypes } from 'react'; +import Interactive from 'react-interactive'; +import { Link } from 'react-router'; +import s from '../styles/exampleComponent.style'; + +const propTypes = { + children: PropTypes.element, +}; + +function ExampleComponent({ children }) { + return ( +
    +

    + This is an example page. Refresh the page or copy/paste the url to + test out the redirect functionality (this same page should load + after the redirect). +

    + {children || +
    + Example two deep with query and hash +
    + } +
    + ); +} + +ExampleComponent.propTypes = propTypes; + +export default ExampleComponent; diff --git a/src/components/ExampleTwoDeepComponent.js b/src/components/ExampleTwoDeepComponent.js new file mode 100644 index 0000000..0646d5c --- /dev/null +++ b/src/components/ExampleTwoDeepComponent.js @@ -0,0 +1,71 @@ +import React, { PropTypes } from 'react'; +import Interactive from 'react-interactive'; +import { Link } from 'react-router'; +import s from '../styles/exampleTwoDeepComponent.style'; + +const propTypes = { + location: PropTypes.object.isRequired, +}; + +function ExampleTwoDeepComponent({ location }) { + const queryPresent = Object.keys(location.query).length !== 0; + const hashPresent = location.hash !== ''; + + function queryStringTitle() { + if (queryPresent) return 'The query string field-value pairs are:'; + return 'No query string in the url'; + } + + function hashFragmentTitle() { + if (hashPresent) return 'The hash fragment is:'; + return 'No hash fragment in the url'; + } + + function linkToShowQueryAndOrHash() { + if (queryPresent && hashPresent) return null; + + const queryString = (queryPresent ? location.search : '?field1=foo&field2=bar'); + const hashFragment = (hashPresent ? location.hash : '#boom!'); + + let linkText = ''; + if (queryPresent && !hashPresent) linkText = 'Show with hash fragment'; + if (!queryPresent && hashPresent) linkText = 'Show with query string'; + if (!queryPresent && !hashPresent) linkText = 'Show with query string and hash fragment'; + + return ( +
    + {linkText} +
    + ); + } + + return ( +
    +
    +
    {queryStringTitle()}
    + +
    +
    +
    {hashFragmentTitle()}
    + +
    + {linkToShowQueryAndOrHash()} +
    + ); +} + +ExampleTwoDeepComponent.propTypes = propTypes; + +export default ExampleTwoDeepComponent; diff --git a/src/components/Home.js b/src/components/Home.js index 3a176d3..a871832 100644 --- a/src/components/Home.js +++ b/src/components/Home.js @@ -6,25 +6,20 @@ import s from '../styles/home.style'; function Home() { return (
    - Creatures -
    - Danian -
    - Overworld -
    - Underworld -
    - Mipedian +
    + Example page +
    +
    + Example two deep with query and hash +
    ); } diff --git a/src/components/collection/Home.js b/src/components/collection/Home.js new file mode 100644 index 0000000..95a18a1 --- /dev/null +++ b/src/components/collection/Home.js @@ -0,0 +1,19 @@ +import React from 'react'; +import UnderConstruction from '../UnderConstruction'; + +export default class SingleCreature extends React.Component { + render() { + return ( +
    + +

    + In the meantime, you can check out  + Trade Cards Online + . +

    +
    + ); + } + +} + diff --git a/src/components/Category/Attacks.js b/src/components/portal/Category/Attacks.js similarity index 100% rename from src/components/Category/Attacks.js rename to src/components/portal/Category/Attacks.js diff --git a/src/components/Category/Battlegear.js b/src/components/portal/Category/Battlegear.js similarity index 100% rename from src/components/Category/Battlegear.js rename to src/components/portal/Category/Battlegear.js diff --git a/src/components/Category/Creatures.js b/src/components/portal/Category/Creatures.js similarity index 92% rename from src/components/Category/Creatures.js rename to src/components/portal/Category/Creatures.js index c05ea7b..f374a0a 100644 --- a/src/components/Category/Creatures.js +++ b/src/components/portal/Category/Creatures.js @@ -1,9 +1,9 @@ import React from 'react'; import Interactive from 'react-interactive'; import { Link } from 'react-router'; -import PageNotFound from '../PageNotFound'; -import API from '../Spreadsheet'; -import s from '../../styles/app.style'; +import PageNotFound from '../../PageNotFound'; +import API from '../../Spreadsheet'; +import s from '../../../styles/app.style'; export default class Creatures extends React.Component { @@ -21,8 +21,8 @@ export default class Creatures extends React.Component { } // ** Process the tribe ** // - // /collection/Creatures/ - // /collection/{Tribe}/Creatures/ + // /portal/Creatures/ + // /portal/{Tribe}/Creatures/ // The first / gets counted getData(props) { if (props.children) return this.props = props; @@ -75,7 +75,7 @@ export default class Creatures extends React.Component { return (
    {tribe} {list_creatures(tribe, "Creatures/"+tribe+"/")}
    diff --git a/src/components/Category/Locations.js b/src/components/portal/Category/Locations.js similarity index 100% rename from src/components/Category/Locations.js rename to src/components/portal/Category/Locations.js diff --git a/src/components/Category/Mugic.js b/src/components/portal/Category/Mugic.js similarity index 86% rename from src/components/Category/Mugic.js rename to src/components/portal/Category/Mugic.js index 031aa20..8248d91 100644 --- a/src/components/Category/Mugic.js +++ b/src/components/portal/Category/Mugic.js @@ -1,10 +1,10 @@ import React from 'react'; import Interactive from 'react-interactive'; import { Link } from 'react-router'; -import UnderConstruction from '../UnderConstruction'; -import PageNotFound from '../PageNotFound'; -import API from '../Spreadsheet'; -import s from '../../styles/app.style'; +import UnderConstruction from '../../UnderConstruction'; +import PageNotFound from '../../PageNotFound'; +import API from '../../Spreadsheet'; +import s from '../../../styles/app.style'; export default class Mugic extends React.Component { @@ -34,8 +34,8 @@ export default class Mugic extends React.Component { if (path[path.length-1] == "") path.pop(); // Remove trailing backslash // ** Process the tribe ** // - // /collection/Mugic/ - // /collection/{Tribe}/Mugic/ + // /portal/Mugic/ + // /portal/{Tribe}/Mugic/ // The first / gets counted return ( diff --git a/src/components/Category/Tribes.js b/src/components/portal/Category/Tribes.js similarity index 94% rename from src/components/Category/Tribes.js rename to src/components/portal/Category/Tribes.js index 0ece25a..a1c93b1 100644 --- a/src/components/Category/Tribes.js +++ b/src/components/portal/Category/Tribes.js @@ -1,5 +1,5 @@ import React from 'react'; -import UnderConstruction from '../UnderConstruction'; +import UnderConstruction from '../../UnderConstruction'; // This module handles tribe pages and subpages // Allows for urls such as diff --git a/src/components/portal/Home.js b/src/components/portal/Home.js new file mode 100644 index 0000000..d61e5f9 --- /dev/null +++ b/src/components/portal/Home.js @@ -0,0 +1,30 @@ +import React from 'react'; +import Interactive from 'react-interactive'; +import { Link } from 'react-router'; +import s from '../../styles/home.style'; + +export default function PortalHome() { + return ( +
    + Creatures +
    + Danian +
    + Overworld +
    + Underworld +
    + Mipedian +
    + ); +} diff --git a/src/components/Single/Attack.js b/src/components/portal/Single/Attack.js similarity index 100% rename from src/components/Single/Attack.js rename to src/components/portal/Single/Attack.js diff --git a/src/components/Single/Battlegear.js b/src/components/portal/Single/Battlegear.js similarity index 100% rename from src/components/Single/Battlegear.js rename to src/components/portal/Single/Battlegear.js diff --git a/src/components/Single/Creature.js b/src/components/portal/Single/Creature.js similarity index 89% rename from src/components/Single/Creature.js rename to src/components/portal/Single/Creature.js index 7730d23..75fd4e2 100644 --- a/src/components/Single/Creature.js +++ b/src/components/portal/Single/Creature.js @@ -2,10 +2,10 @@ import React from 'react'; import Interactive from 'react-interactive'; import { Link } from 'react-router'; // import {browserHistory} from 'react-router'; -import PageNotFound from '../PageNotFound'; -import UnderConstruction from '../UnderConstruction'; -import API from '../Spreadsheet'; -import s from '../../styles/app.style'; +import PageNotFound from '../../PageNotFound'; +import UnderConstruction from '../../UnderConstruction'; +import API from '../../Spreadsheet'; +import s from '../../../styles/app.style'; export default class SingleCreature extends React.Component { @@ -23,8 +23,8 @@ export default class SingleCreature extends React.Component { } // ** Process the tribe ** // - // /collection/Creatures/{Tribe}/{Name} - // /collection/{Tribe}/Creatures/{Name} + // /portal/Creatures/{Tribe}/{Name} + // /portal/{Tribe}/Creatures/{Name} // The first / gets counted getData(props) { let path = props.location.pathname.split("/"); @@ -91,15 +91,15 @@ export default class SingleCreature extends React.Component { ); const elements = card_data.gsx$elements.$t.split(/[ ,]+/).map((item, i) => { - return {item}; + return {item}; }); const locations = creature.gsx$location.$t.split(/[,]+\s*/).map((item, i) => { - return

    {item}

    ; + return

    {item}

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

    {item}

    ; + return

    {item}

    ; }); return( @@ -164,7 +164,7 @@ export default class SingleCreature extends React.Component {
    Tribe: {this.state.tribe} - +

    diff --git a/src/components/Single/Location.js b/src/components/portal/Single/Location.js similarity index 100% rename from src/components/Single/Location.js rename to src/components/portal/Single/Location.js diff --git a/src/components/Single/Mugic.js b/src/components/portal/Single/Mugic.js similarity index 100% rename from src/components/Single/Mugic.js rename to src/components/portal/Single/Mugic.js diff --git a/src/index.js b/src/index.js index 28d8094..2a55963 100644 --- a/src/index.js +++ b/src/index.js @@ -6,23 +6,44 @@ import App from './components/App'; import Home from './components/Home'; import PageNotFound from './components/PageNotFound'; import UnderConstruction from './components/UnderConstruction'; +import ExampleComponent from './components/ExampleComponent'; +import ExampleTwoDeepComponent from './components/ExampleTwoDeepComponent'; -// import Attacks from './component/Category/Attacks'; -// import Battlegear from './component/Category/Battlegear'; -import Creatures from './components/Category/Creatures'; -// import Locations from './component/Category/Locations'; -import Mugic from './components/Category/Mugic'; -import Tribes from './components/Category/Tribes'; -// import SingleAttack from './component/Category/Attacks'; -// import SingleBattlegear from './component/Category/Battlegear'; -import SingleCreature from './components/Single/Creature'; -// import SingleLocation from './component/Category/Locations'; -// import SingleMugic from './component/Category/Mugic'; +import CollectionHome from './components/collection/Home'; + +import PortalHome from './components/portal/Home'; +// import Attacks from './components/portal/Category/Attacks'; +// import Battlegear from './components/portal/Category/Battlegear'; +import Creatures from './components/portal/Category/Creatures'; +// import Locations from './components/portal/Category/Locations'; +import Mugic from './components/portal/Category/Mugic'; +import Tribes from './components/portal/Category/Tribes'; +// import SingleAttack from './components/portal/Category/Attacks'; +// import SingleBattlegear from './components/portal/Category/Battlegear'; +import SingleCreature from './components/portal/Single/Creature'; +// import SingleLocation from './components/portal/Category/Locations'; +// import SingleMugic from './components/portal/Category/Mugic'; const routes = ( - - - + + + + {/* Test */} + + + + + {/* Construction */} + + + {/* Collection */} + + + + + {/* Portal */} + + {/* Attacks */}