improvements to inspector app

This commit is contained in:
Brandon Liu
2022-06-13 16:48:58 +08:00
parent beef7a3ab7
commit 9962b4e344
8 changed files with 241 additions and 138 deletions

View File

@@ -1,12 +1,31 @@
import { useState, useEffect } from "react";
import { styled, globalStyles } from "./stitches.config";
import { PMTiles } from "../../js";
import { GitHubLogoIcon } from "@radix-ui/react-icons";
import Start from "./Start";
import Loader from "./Loader";
const Header = styled("div", {
height: "$4",
display: "flex",
alignItems: "center",
padding: "0 $2 0 $2",
});
const Title = styled("span", {
fontWeight: 500,
cursor: "pointer",
});
const GithubA = styled("a", {
color: "white",
textDecoration: "none",
fontSize: "$1",
});
const GithubLink = styled("span", {
marginLeft: "auto",
});
const GIT_SHA = (import.meta.env.VITE_GIT_SHA || "").substr(0, 8);
@@ -37,8 +56,12 @@ function App() {
return (
<div>
<Header>
<span onClick={clear}>pmtiles viewer</span> | github | toggle |{" "}
{GIT_SHA}
<Title onClick={clear}>PMTiles Viewer</Title>
<GithubLink>
<GithubA href="https://github.com/protomaps/PMTiles" target="_blank">
<GitHubLogoIcon /> {GIT_SHA}
</GithubA>
</GithubLink>
</Header>
{file ? <Loader file={file} /> : <Start setFile={setFile} />}
</div>