Skip to content

Commit

Permalink
home page #24
Browse files Browse the repository at this point in the history
  • Loading branch information
shamseen committed Jun 4, 2021
1 parent 3eb0131 commit 05963c8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState } from 'react';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import Components from './Components';
import { HomePage } from './Views';
import {
createPngcat,
deletePngcat,
Expand Down Expand Up @@ -74,7 +75,7 @@ export default function App() {
<Router>
<Components.Navbar />
<Switch>
<Route exact path="/" render={() => <Components.Search />} />
<Route exact path="/" render={() => <HomePage />} />
<Route exact path="/About" render={() => <Components.About />} />
<Route exact path="/Box" render={() => <Components.DragBox pngcat={activeSeq} handleSave={handleSave} />} />
<Route exact path="/Browse" render={() => <Components.Browse getAllPngcats={getAllPngcats} updateState={setActiveSeq} />} />
Expand Down
14 changes: 4 additions & 10 deletions src/Components/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@


// import {default as Search} from './Search/Search';
// import {default as Navbar} from './Navbar/Navbar';
// import {default as About} from './About/About';
// import {default as Dragbox} from './DragBox/DragBox';
// import {default as Browse} from './Browse/Browse';

import Search from './Search/Search';
// import Search from './Search/Search';
import Navbar from './Navbar/Navbar';
import About from './About/About';
import BrowsePngcats from './Browse/Browse';
import DragBox from './DragBox/DragBox';

// to use separately like in HomePage
export { default as Search } from "./Search/Search";

const Components = {
Search: Search,
Navbar: Navbar,
About: About,
DragBox: DragBox,
Expand Down
11 changes: 11 additions & 0 deletions src/Views/HomePage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Search } from "../Components";


export default function HomePage() {
return (
<div id="homepage">
<Search />
{/* TODO: tutorial button */}
</div>
)
}
3 changes: 3 additions & 0 deletions src/Views/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// TODO: treeshaking

export { default as HomePage } from './HomePage';

0 comments on commit 05963c8

Please sign in to comment.