interface: fix default app tiles linking as anchor

This commit is contained in:
Matilde Park 2020-10-07 00:32:29 -04:00
parent bb2c847e0d
commit 9d5645f8d7

View File

@ -10,7 +10,7 @@ import { Box } from "@tlon/indigo-react";
export default class Tile extends React.Component {
render() {
const { bg, to, p, ...props } = this.props;
let childElement = (
<Box p={typeof p === 'undefined' ? 2 : p} bg={bg} width="100%" height="100%">
{props.children}
@ -18,12 +18,12 @@ export default class Tile extends React.Component {
);
if (to) {
if (routeList.indexOf(to) === -1) {
if (routeList.indexOf(to) !== -1 || to === '/~landscape/home' || to === '/~profile') {
childElement= (<Link to={to}>{childElement}</Link>);
} else {
childElement= (<a href={to}>{childElement}</a>);
}
}
return (