Skip to content

Commit

Permalink
feat: better home page link style
Browse files Browse the repository at this point in the history
  • Loading branch information
asartalo committed Aug 28, 2021
1 parent d07492a commit a488e76
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
15 changes: 15 additions & 0 deletions src/elements/LinkRouter.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* eslint-disable jsx-a11y/anchor-is-valid */
import React from 'react';
import { Link as RouterLink } from 'react-router-dom';
import Link from '@material-ui/core/Link';

interface LinkRouterProps {
to: string,
children: React.ReactNode,
}

export default function LinkRouter({ children, to }: LinkRouterProps): JSX.Element {
return (
<Link component={RouterLink} to={to}>{children}</Link>
);
}
6 changes: 4 additions & 2 deletions src/pages/main/MainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import React from 'react';
import { Link } from 'react-router-dom';
import {
List, ListItem, ListItemText, Container,
Link as MuiLink,
Typography,
Paper,
makeStyles,
} from '@material-ui/core';
import Hero from '../../components/Hero';
import Footer from './Footer';
import LinkRouter from '../../elements/LinkRouter';

const paperStyles = makeStyles((theme) => ({
wrapper: {
Expand Down Expand Up @@ -40,15 +42,15 @@ const MainPage = (): JSX.Element => {
<List className={classes.list}>
<ListItem>
<ListItemText secondary="Generate a printable calendar for the month">
<Link to="/calendar">Calendar</Link>
<LinkRouter to="/calendar">Calendar</LinkRouter>
</ListItemText>
</ListItem>
</List>
<Typography variant="h4" component="h2">Worksheets</Typography>
<List className={classes.list} aria-label="Worksheets">
<ListItem>
<ListItemText>
<Link to="/addition-fill-the-blanks">Addition: Fill the Blanks</Link>
<LinkRouter to="/addition-fill-the-blanks">Addition: Fill the Blanks</LinkRouter>
</ListItemText>
</ListItem>
</List>
Expand Down

0 comments on commit a488e76

Please sign in to comment.