Update maps and tokens to have thumbnails and removed loading of all files on load

This commit is contained in:
Mitchell McCaffrey
2021-02-08 16:53:56 +11:00
parent b9993e1a0b
commit 24e64f9d32
16 changed files with 418 additions and 137 deletions
+7 -2
View File
@@ -7,7 +7,12 @@ import useDataSource from "../../hooks/useDataSource";
import { tokenSources, unknownSource } from "../../tokens";
function ListToken({ token, className }) {
const imageSource = useDataSource(token, tokenSources, unknownSource);
const isDefault = token.type === "default";
const tokenSource = useDataSource(
isDefault ? token : token.thumbnail,
tokenSources,
unknownSource
);
const imageRef = useRef();
// Stop touch to prevent 3d touch gesutre on iOS
@@ -16,7 +21,7 @@ function ListToken({ token, className }) {
return (
<Box my={2} mx={3} sx={{ width: "48px", height: "48px" }}>
<Image
src={imageSource}
src={tokenSource}
ref={imageRef}
className={className}
sx={{
+6 -1
View File
@@ -17,7 +17,12 @@ function TokenTile({
canEdit,
badges,
}) {
const tokenSource = useDataSource(token, defaultTokenSources, unknownSource);
const isDefault = token.type === "default";
const tokenSource = useDataSource(
isDefault ? token : token.thumbnail,
defaultTokenSources,
unknownSource
);
return (
<Tile