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 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
// sx={{ color: 'white', textDecoration: 'none', '-webkit-text-decoration': 'none' }}
// @ts-ignore
button
component={Link}
// eslint-disable-next-line react/jsx-props-no-spreading // eslint-disable-next-line react/jsx-props-no-spreading
{...props} return <ListItem button component="a" href={to} {...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} />;
} }

View File

@@ -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"