Skip to content

Instantly share code, notes, and snippets.

@ac205
Created February 18, 2020 00:27
Show Gist options
  • Save ac205/74bb3f6ebda9fbf6f437f2e4f3cd1ab1 to your computer and use it in GitHub Desktop.
Save ac205/74bb3f6ebda9fbf6f437f2e4f3cd1ab1 to your computer and use it in GitHub Desktop.
React Router Help
<Router>
{/* Admin Panel Routes */}
<AdminAppbar />
<AdminMenu />
<Switch>
<Route path="/admin/HeroImages" component={HeroImages} />
<Route path="/admin/features" component={Features} />
<Route path="/admin/salebar" component={SaleBar} />
<Route path="/admin/categories" component={Categories} />
<Route path="/admin/products" component={Products} />
<Route path="/admin/add-product" component={AddProduct} />
<Route path="/admin" component={AdminPanel} />
</Switch>
{/* Main Site Routes */}
<Navbar />
<Menubar />
<MobileMenu />
<Switch>
<Route path="/product-details/:name" component={ProductDetail} />
<Route path="/cart" component={Cart} />
<Route path="/contact" component={Contact} />
<Route path="/about" component={About} />
<Route path="/profile" component={Profile} />
<Route path="/shop" component={Shop} />
<Route path="/" component={Home} />
</Switch>
<Footer />
</Router>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment