fix direct links (#133)
This commit is contained in:
@@ -9,18 +9,13 @@ import React from 'react';
|
|||||||
import ListItem, { ListItemProps } from '@mui/material/ListItem';
|
import ListItem, { ListItemProps } from '@mui/material/ListItem';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
export default function ListItemLink(props: ListItemProps<Link, {}>) {
|
export default function ListItemLink(props: ListItemProps<Link, { directLink?: boolean }>) {
|
||||||
return (
|
const { directLink, to } = props;
|
||||||
<ListItem
|
if (directLink) {
|
||||||
// @ts-ignore
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||||
// sx={{ color: 'white', textDecoration: 'none', '-webkit-text-decoration': 'none' }}
|
return <ListItem button component="a" href={to} {...props} />;
|
||||||
// @ts-ignore
|
}
|
||||||
button
|
|
||||||
component={Link}
|
|
||||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
||||||
{...props}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||||
// return <ListItem button component="a" {...props} />;
|
return <ListItem button component={Link} {...props} />;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ export default function Backup() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<List sx={{ padding: 0 }}>
|
<List sx={{ padding: 0 }}>
|
||||||
<ListItemLink to={`${baseURL}/api/v1/backup/export/file`}>
|
<ListItemLink to={`${baseURL}/api/v1/backup/export/file`} directLink>
|
||||||
<ListItemText
|
<ListItemText
|
||||||
primary="Create Backup"
|
primary="Create Backup"
|
||||||
secondary="Backup library as a Tachiyomi backup"
|
secondary="Backup library as a Tachiyomi backup"
|
||||||
|
|||||||
Reference in New Issue
Block a user