fix direct links (#133)

This commit is contained in:
Aria Moradi
2022-02-21 01:24:42 +03:30
committed by GitHub
parent f47f71bc4c
commit 237762b762
2 changed files with 9 additions and 14 deletions

View File

@@ -9,18 +9,13 @@ import React from 'react';
import ListItem, { ListItemProps } from '@mui/material/ListItem';
import { Link } from 'react-router-dom';
export default function ListItemLink(props: ListItemProps<Link, {}>) {
return (
<ListItem
// @ts-ignore
// sx={{ color: 'white', textDecoration: 'none', '-webkit-text-decoration': 'none' }}
// @ts-ignore
button
component={Link}
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
/>
);
export default function ListItemLink(props: ListItemProps<Link, { directLink?: boolean }>) {
const { directLink, to } = props;
if (directLink) {
// eslint-disable-next-line react/jsx-props-no-spreading
return <ListItem button component="a" href={to} {...props} />;
}
// eslint-disable-next-line react/jsx-props-no-spreading
// return <ListItem button component="a" {...props} />;
return <ListItem button component={Link} {...props} />;
}

View File

@@ -68,7 +68,7 @@ export default function Backup() {
return (
<>
<List sx={{ padding: 0 }}>
<ListItemLink to={`${baseURL}/api/v1/backup/export/file`}>
<ListItemLink to={`${baseURL}/api/v1/backup/export/file`} directLink>
<ListItemText
primary="Create Backup"
secondary="Backup library as a Tachiyomi backup"