Skip to content

Commit

Permalink
fix direct links (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
AriaMoradi authored Feb 20, 2022
1 parent f47f71b commit 237762b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
21 changes: 8 additions & 13 deletions src/components/util/ListItemLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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} />;
}
2 changes: 1 addition & 1 deletion src/screens/settings/Backup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 237762b

Please sign in to comment.