diff --git a/src/components/Category/Attacks.js b/src/components/Category/Attacks.js new file mode 100644 index 0000000..e69de29 diff --git a/src/components/Category/Battlegear.js b/src/components/Category/Battlegear.js new file mode 100644 index 0000000..e69de29 diff --git a/src/components/Category/Creatures.js b/src/components/Category/Creatures.js new file mode 100644 index 0000000..02d179b --- /dev/null +++ b/src/components/Category/Creatures.js @@ -0,0 +1,20 @@ +import React from 'react'; +import PropTypes from 'prop-types'; + +const propTypes = { + children: PropTypes.element, +}; + +function Creatures({children}) { + return ( +
+ {children|| +
test
+ } +
+ ); +} + +Creatures.propTypes = propTypes; + +export default Creatures; diff --git a/src/components/Category/Locations.js b/src/components/Category/Locations.js new file mode 100644 index 0000000..e69de29 diff --git a/src/components/Category/Mugic.js b/src/components/Category/Mugic.js new file mode 100644 index 0000000..e69de29 diff --git a/src/components/Single/Attack.js b/src/components/Single/Attack.js new file mode 100644 index 0000000..e69de29 diff --git a/src/components/Single/Battlegear.js b/src/components/Single/Battlegear.js new file mode 100644 index 0000000..e69de29 diff --git a/src/components/Single/Creature.js b/src/components/Single/Creature.js new file mode 100644 index 0000000..bfbc1cc --- /dev/null +++ b/src/components/Single/Creature.js @@ -0,0 +1,27 @@ +import React from 'react'; +import PropTypes from 'prop-types'; + +const propTypes = { + location: PropTypes.object.isRequired, +}; + +function SingleCreature() { + let path = location.pathname.split("/"); + if (path[path.length-1] == "") path.pop(); // Remove trailing backslash + + // /portal/Creatures/Tribe/Name + // The first / gets counted + if( path.length !== 5 ) + { + //TODO return PageNotFound + return(
not valid
); + } + + return( +
test
+ ); +} + +SingleCreature.propTypes = propTypes; + +export default SingleCreature; diff --git a/src/components/Single/Location.js b/src/components/Single/Location.js new file mode 100644 index 0000000..e69de29 diff --git a/src/components/Single/Mugic.js b/src/components/Single/Mugic.js new file mode 100644 index 0000000..e69de29 diff --git a/src/index.js b/src/index.js index 0bc87c5..03637f7 100644 --- a/src/index.js +++ b/src/index.js @@ -8,7 +8,17 @@ import PageNotFound from './components/PageNotFound'; 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 './component/Category/Mugic'; +// import Attacks from './component/Category/Attacks'; +// import Battlegear from './component/Category/Battlegear'; +import SingleCreature from './components/Single/Creature'; +// import Locations from './component/Category/Locations'; +// import Mugic from './component/Category/Mugic'; const routes = ( @@ -19,7 +29,25 @@ const routes = ( + + + + + + + + + + + + + + + + + +