mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 19:01:08 +00:00
simplify opening a new viewer tab
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import { styled, globalStyles } from "./stitches.config";
|
import { styled, globalStyles } from "./stitches.config";
|
||||||
import { PMTiles } from "../../js/index";
|
import { PMTiles } from "../../js/index";
|
||||||
import { GitHubLogoIcon } from "@radix-ui/react-icons";
|
import { GitHubLogoIcon } from "@radix-ui/react-icons";
|
||||||
@@ -14,9 +14,10 @@ const Header = styled("div", {
|
|||||||
padding: "0 $2 0 $2",
|
padding: "0 $2 0 $2",
|
||||||
});
|
});
|
||||||
|
|
||||||
const Title = styled("span", {
|
const Title = styled("a", {
|
||||||
fontWeight: 500,
|
fontWeight: 500,
|
||||||
cursor: "pointer",
|
color: "unset",
|
||||||
|
textDecoration: "none",
|
||||||
});
|
});
|
||||||
|
|
||||||
const GithubA = styled("a", {
|
const GithubA = styled("a", {
|
||||||
@@ -88,7 +89,8 @@ function App() {
|
|||||||
}
|
}
|
||||||
}, [file]);
|
}, [file]);
|
||||||
|
|
||||||
let clear = () => {
|
let clear = (event: React.MouseEvent<HTMLAnchorElement>) => {
|
||||||
|
event.preventDefault();
|
||||||
setFile(undefined);
|
setFile(undefined);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -99,7 +101,7 @@ function App() {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Header>
|
<Header>
|
||||||
<Title onClick={clear}>PMTiles Viewer</Title>
|
<Title href="/" onClick={clear}>PMTiles Viewer</Title>
|
||||||
<GithubLink>
|
<GithubLink>
|
||||||
<GithubA href="https://github.com/protomaps/PMTiles" target="_blank">
|
<GithubA href="https://github.com/protomaps/PMTiles" target="_blank">
|
||||||
<GitHubLogoIcon /> {GIT_SHA}
|
<GitHubLogoIcon /> {GIT_SHA}
|
||||||
|
|||||||
Reference in New Issue
Block a user