Skip to content

Commit

Permalink
Use Link for internal links instead of anchor (#80)
Browse files Browse the repository at this point in the history
closes #79

Signed-off-by: Sean Sundberg <[email protected]>
  • Loading branch information
seansund authored Sep 23, 2023
1 parent a909136 commit d1a9c96
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/DemoTile/DemoTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// @ts-ignore
import React, { Component } from 'react';
import './DemoTile.scss';
import {Link} from "react-router-dom";

export interface DemoTileProps {
title: string
Expand All @@ -14,6 +15,7 @@ export interface DemoTileState {

export class DemoTile extends Component<DemoTileProps, DemoTileState> {


render() {
if (this.props.href.startsWith('http')) {
return (
Expand All @@ -28,13 +30,13 @@ export class DemoTile extends Component<DemoTileProps, DemoTileState> {
}

return (
<a className="demoTileLink" href={this.props.href}>
<Link className="demoTileLink" to={this.props.href}>
<div className="demoTile">
<div className="demoTileContent">
{this.props.title}
</div>
</div>
</a>
</Link>
)
}
}

0 comments on commit d1a9c96

Please sign in to comment.