mirror of
https://github.com/chaoticbackup/chaoticbackup.github.io.git
synced 2026-04-25 15:58:11 -05:00
page skeleton
This commit is contained in:
parent
f9d04b57d0
commit
4b61996523
0
src/components/Category/Attacks.js
Normal file
0
src/components/Category/Attacks.js
Normal file
0
src/components/Category/Battlegear.js
Normal file
0
src/components/Category/Battlegear.js
Normal file
20
src/components/Category/Creatures.js
Normal file
20
src/components/Category/Creatures.js
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
|
const propTypes = {
|
||||||
|
children: PropTypes.element,
|
||||||
|
};
|
||||||
|
|
||||||
|
function Creatures({children}) {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{children||
|
||||||
|
<div>test</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Creatures.propTypes = propTypes;
|
||||||
|
|
||||||
|
export default Creatures;
|
||||||
0
src/components/Category/Locations.js
Normal file
0
src/components/Category/Locations.js
Normal file
0
src/components/Category/Mugic.js
Normal file
0
src/components/Category/Mugic.js
Normal file
0
src/components/Single/Attack.js
Normal file
0
src/components/Single/Attack.js
Normal file
0
src/components/Single/Battlegear.js
Normal file
0
src/components/Single/Battlegear.js
Normal file
27
src/components/Single/Creature.js
Normal file
27
src/components/Single/Creature.js
Normal file
|
|
@ -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(<div>not valid</div>);
|
||||||
|
}
|
||||||
|
|
||||||
|
return(
|
||||||
|
<div>test</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
SingleCreature.propTypes = propTypes;
|
||||||
|
|
||||||
|
export default SingleCreature;
|
||||||
0
src/components/Single/Location.js
Normal file
0
src/components/Single/Location.js
Normal file
0
src/components/Single/Mugic.js
Normal file
0
src/components/Single/Mugic.js
Normal file
28
src/index.js
28
src/index.js
|
|
@ -8,7 +8,17 @@ import PageNotFound from './components/PageNotFound';
|
||||||
import ExampleComponent from './components/ExampleComponent';
|
import ExampleComponent from './components/ExampleComponent';
|
||||||
import ExampleTwoDeepComponent from './components/ExampleTwoDeepComponent';
|
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 = (
|
const routes = (
|
||||||
<Route path="/" component={App}>
|
<Route path="/" component={App}>
|
||||||
|
|
@ -19,7 +29,25 @@ const routes = (
|
||||||
<Route path="two-deep" mapMenuTitle="Two Deep" component={ExampleTwoDeepComponent} />
|
<Route path="two-deep" mapMenuTitle="Two Deep" component={ExampleTwoDeepComponent} />
|
||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
|
<Route path="Attacks" component={PageNotFound}>
|
||||||
|
<Route path="*" component={PageNotFound} />
|
||||||
|
</Route>
|
||||||
|
|
||||||
|
<Route path="Battlegear" component={PageNotFound}>
|
||||||
|
<Route path="*" component={PageNotFound} />
|
||||||
|
</Route>
|
||||||
|
|
||||||
|
<Route path="Creatures" component={Creatures}>
|
||||||
|
<Route path="*" component={SingleCreature} />
|
||||||
|
</Route>
|
||||||
|
|
||||||
|
<Route path="Locations" component={PageNotFound}>
|
||||||
|
<Route path="*" component={PageNotFound} />
|
||||||
|
</Route>
|
||||||
|
|
||||||
|
<Route path="Mugic" component={PageNotFound}>
|
||||||
|
<Route path="*" component={PageNotFound} />
|
||||||
|
</Route>
|
||||||
|
|
||||||
</Route>
|
</Route>
|
||||||
<Route path="*" mapMenuTitle="Page Not Found" component={PageNotFound} />
|
<Route path="*" mapMenuTitle="Page Not Found" component={PageNotFound} />
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user