#5 collection; portal home page

This commit is contained in:
Daniel 2018-01-19 22:14:43 -05:00
parent 754b7e8c96
commit 1413c0eb53
6 changed files with 42 additions and 34 deletions

View File

@ -1,9 +1,26 @@
import React from 'react';
import Interactive from 'react-interactive';
import { Link } from 'react-router-dom';
import s from '../styles/home.style';
import { Route, Link } from 'react-router-dom';
export default function Home() {
/* Components */
import {PageNotFound, UnderConstruction} from './Snippets';
import EnterTheCode from './account/EnterTheCode';
import Collection from './collection/index';
import Portal from './portal/index';
export function Routing(props) {
return (
<div>
<Route exact path={props.match.url} component={Home} />
<Route path="/PageNotFound" component={PageNotFound} />
<Route path="/UnderConstruction" component={UnderConstruction} />
<Route path="/EnterTheCode" component={EnterTheCode} />
<Route path="/collection" component={Collection} />
<Route path="/portal" component={Portal} />
</div>
);
}
function Home() {
return (
<div>
<link rel="stylesheet" href="/src/css/with_love.css" />

View File

@ -1,19 +0,0 @@
import React from 'react';
import { Route } from 'react-router-dom';
import {PageNotFound, UnderConstruction} from './Snippets';
import Home from './Home';
import EnterTheCode from './account/EnterTheCode';
export function Routing(props) {
console.log(props);
const match = props.match;
return (
<div>
<Route exact path={match.url} component={Home} />
<Route path={`${match.url}EnterTheCode`} component={EnterTheCode} />
<Route path="/PageNotFound" component={PageNotFound} />
<Route path="/UnderConstruction" component={UnderConstruction} />
</div>
);
}

View File

@ -7,7 +7,7 @@ import CardList from './List';
import SearchForm from './Search';
@inject((stores, props, context) => props) @observer
export default class CollectionHome extends React.Component {
export default class Home extends React.Component {
@observable n = 10;
@observable p = 1;
@observable content = [];

View File

@ -2,9 +2,8 @@ import React from 'react';
import { render } from 'react-dom';
import { Link } from 'react-router-dom';
import { BrowserRouter as Router, Route } from 'react-router-dom';
import s from '../styles/app.style';
import {Routing} from './Routing';
import {Routing} from './Home';
const language = "ENG";
const bkgrnd = "05";

View File

@ -1,7 +1,20 @@
import React from 'react';
import { Route } from 'react-router-dom';
import API from '../SpreadsheetData';
export default class PortalHome extends React.Component {
export function Routing(props) {
console.log(props);
const match = props.match;
return (
<div>
<Route exact path={match.url} component={Home} />
{/* <Route path={`${match.url}collection`} component={CollectionHome} /> */}
</div>
);
}
class Home extends React.Component {
componentDidMount() {
this.coin = null;

View File

@ -1,14 +1,12 @@
import React from 'react';
import PropTypes from 'prop-types';
import s from '../../styles/app.style';
import Interactive from 'react-interactive';
import {observable} from "mobx";
import {observer, inject} from 'mobx-react';
import { Link } from 'react-router';
import {Link} from 'react-router-dom';
import {Routing} from './Home';
import Search from './Search';
@inject((stores, props, context) => props) @observer
export default class PortalBase extends React.Component {
export default class Base extends React.Component {
render() {
return (
@ -16,13 +14,13 @@ export default class PortalBase extends React.Component {
<link rel="stylesheet" href="/src/css/portal.css" />
<Header />
<br />
{this.props.children}
<Routing {...this.props} />
</div>
);
}
}
function Header(props) {
function Header() {
const types = (() => {
return (