CommonMenuList Backbutton

This commit is contained in:
monoid 2021-01-16 00:16:56 +09:00
parent 5171211f7a
commit 41c0c39620
2 changed files with 4 additions and 9 deletions

View File

@ -28,12 +28,9 @@ export const BackItem = (props:{to?:string})=>{
} }
export function CommonMenuList(props?:{url?:string}) { export function CommonMenuList(props?:{url?:string}) {
//if(props === undefined){ let url = props?.url || "";
// props = {};
//}
//props.url = props.url || "";
//{props.url !== "" && <><BackItem /> <Divider /></>}
return (<NavList> return (<NavList>
{url !== "" && <><BackItem /> <Divider /></>}
<NavItem name="All" to="/" icon={<HomeIcon />} /> <NavItem name="All" to="/" icon={<HomeIcon />} />
<NavItem name="Manga" to="/search?content_type=manga" icon={<CollectionIcon />}></NavItem> <NavItem name="Manga" to="/search?content_type=manga" icon={<CollectionIcon />}></NavItem>
<NavItem name="Video" to="/search?content_type=video" icon={<VideoIcon />} /> <NavItem name="Video" to="/search?content_type=video" icon={<VideoIcon />} />

View File

@ -6,6 +6,7 @@ import { Link, Paper, makeStyles, Theme, Box, useTheme, Typography } from '@mate
import {ArrowBack as ArrowBackIcon } from '@material-ui/icons'; import {ArrowBack as ArrowBackIcon } from '@material-ui/icons';
import { getPresenter } from './reader/reader'; import { getPresenter } from './reader/reader';
import { BackItem, CommonMenuList, ContentInfo, Headline, NavItem, NavList } from '../component/mod'; import { BackItem, CommonMenuList, ContentInfo, Headline, NavItem, NavList } from '../component/mod';
import {NotFoundPage} from './404';
export const makeContentInfoUrl = (id: number) => `/doc/${id}`; export const makeContentInfoUrl = (id: number) => `/doc/${id}`;
export const makeMangaReaderUrl = (id: number) => `/doc/${id}/reader`; export const makeMangaReaderUrl = (id: number) => `/doc/${id}/reader`;
@ -45,7 +46,6 @@ export const DocumentAbout = (prop: { match: MatchType }) => {
})(); })();
}, []); }, []);
const classes = useStyles(); const classes = useStyles();
console.log(info.doc);
if (isNaN(id)) { if (isNaN(id)) {
return ( return (
<Headline menu={menu_list()}> <Headline menu={menu_list()}>
@ -83,9 +83,7 @@ export const DocumentAbout = (prop: { match: MatchType }) => {
</Headline> </Headline>
</Route> </Route>
<Route> <Route>
<Headline menu={menu_list()}> <NotFoundPage></NotFoundPage>
<Typography variant='h2'>404 Not Found invalid url : {prop.match.path}</Typography>
</Headline>
</Route> </Route>
</Switch>); </Switch>);
} }