Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix links to work on a bare host #132

Merged
merged 1 commit into from
Feb 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/components/util/ListItemLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,20 @@

import React from 'react';
import ListItem, { ListItemProps } from '@mui/material/ListItem';
import { Link } from 'react-router-dom';

export default function ListItemLink(props: ListItemProps<'a', { button?: true }>) {
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}
/>
);
// eslint-disable-next-line react/jsx-props-no-spreading
return <ListItem button component="a" {...props} />;
// return <ListItem button component="a" {...props} />;
}
6 changes: 3 additions & 3 deletions src/screens/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ export default function Settings() {
return (
<>
<List sx={{ padding: 0 }}>
<ListItemLink href="/settings/categories">
<ListItemLink to="/settings/categories">
<ListItemIcon>
<ListAltIcon />
</ListItemIcon>
<ListItemText primary="Categories" />
</ListItemLink>
<ListItemLink href="/settings/backup">
<ListItemLink to="/settings/backup">
<ListItemIcon>
<BackupIcon />
</ListItemIcon>
Expand Down Expand Up @@ -134,7 +134,7 @@ export default function Settings() {
</IconButton>
</ListItemSecondaryAction>
</ListItem>
<ListItemLink href="/settings/about">
<ListItemLink to="/settings/about">
<ListItemIcon>
<InfoIcon />
</ListItemIcon>
Expand Down
4 changes: 2 additions & 2 deletions src/screens/settings/About.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ export default function About() {
<ListItem>
<ListItemText primary="Build time" secondary={buildTime()} />
</ListItem>
<ListItemLink href={about.github}>
<ListItemLink to={about.github}>
<ListItemText primary="Github" secondary={about.github} />
</ListItemLink>
<ListItemLink href={about.discord}>
<ListItemLink to={about.discord}>
<ListItemText primary="Discord" secondary={about.discord} />
</ListItemLink>
</List>
Expand Down
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 href={`${baseURL}/api/v1/backup/export/file`}>
<ListItemLink to={`${baseURL}/api/v1/backup/export/file`}>
<ListItemText
primary="Create Backup"
secondary="Backup library as a Tachiyomi backup"
Expand Down