From c2d3f7ab99563ab7b091ec2fe4d54c7664b29b27 Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Wed, 24 Apr 2019 00:29:07 +0900 Subject: [PATCH] =?UTF-8?q?routes=E3=82=92=E5=88=87=E3=82=8A=E5=87=BA?= =?UTF-8?q?=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routes.ts | 8 ++++++++ styles/TopAppBar.tsx | 7 +------ 2 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 routes.ts diff --git a/routes.ts b/routes.ts new file mode 100644 index 0000000..43b03c3 --- /dev/null +++ b/routes.ts @@ -0,0 +1,8 @@ +import { createElement } from "react"; +import { Home, Info } from "@material-ui/icons"; + +const routes = [ + { pathname: "/", icon: createElement(Home) }, + { pathname: "/about", icon: createElement(Info) } +]; +export default routes; diff --git a/styles/TopAppBar.tsx b/styles/TopAppBar.tsx index 3738d73..4775268 100644 --- a/styles/TopAppBar.tsx +++ b/styles/TopAppBar.tsx @@ -2,12 +2,7 @@ import React, { useState } from "react"; import { withRouter } from "next/router"; import { makeStyles } from "@material-ui/styles"; import { AppBar, Tabs, Tab } from "@material-ui/core"; -import { Home, Info } from "@material-ui/icons"; - -export const routes = [ - { pathname: "/", icon: }, - { pathname: "/about", icon: } -]; +import routes from "../routes"; const TopAppBar: React.FC<{ router: any }> = ({ router }) => { const classes = makeStyles({