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}) {
//if(props === undefined){
// props = {};
//}
//props.url = props.url || "";
//{props.url !== "" && <><BackItem /> <Divider /></>}
let url = props?.url || "";
return (<NavList>
{url !== "" && <><BackItem /> <Divider /></>}
<NavItem name="All" to="/" icon={<HomeIcon />} />
<NavItem name="Manga" to="/search?content_type=manga" icon={<CollectionIcon />}></NavItem>
<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 { getPresenter } from './reader/reader';
import { BackItem, CommonMenuList, ContentInfo, Headline, NavItem, NavList } from '../component/mod';
import {NotFoundPage} from './404';
export const makeContentInfoUrl = (id: number) => `/doc/${id}`;
export const makeMangaReaderUrl = (id: number) => `/doc/${id}/reader`;
@ -45,7 +46,6 @@ export const DocumentAbout = (prop: { match: MatchType }) => {
})();
}, []);
const classes = useStyles();
console.log(info.doc);
if (isNaN(id)) {
return (
<Headline menu={menu_list()}>
@ -83,9 +83,7 @@ export const DocumentAbout = (prop: { match: MatchType }) => {
</Headline>
</Route>
<Route>
<Headline menu={menu_list()}>
<Typography variant='h2'>404 Not Found invalid url : {prop.match.path}</Typography>
</Headline>
<NotFoundPage></NotFoundPage>
</Route>
</Switch>);
}