From fb857607dbacb89ccd41a467f8637dc1625f68be Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Tue, 7 Apr 2020 18:18:08 +1000 Subject: [PATCH] Added simplebar for more consistent scroll bars between mac and windows --- package.json | 1 + src/components/Tokens.js | 36 ++++++++++++++------------------ src/index.css | 4 ++++ src/index.js | 3 +++ yarn.lock | 44 ++++++++++++++++++++++++++++++++++++++-- 5 files changed, 65 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index 55285f4..9d29099 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "react-scripts": "3.4.0", "shortid": "^2.2.15", "simple-peer": "^9.6.2", + "simplebar-react": "^2.1.0", "socket.io-client": "^2.3.0", "theme-ui": "^0.3.1" }, diff --git a/src/components/Tokens.js b/src/components/Tokens.js index befd695..6980da5 100644 --- a/src/components/Tokens.js +++ b/src/components/Tokens.js @@ -1,6 +1,7 @@ import React, { useState } from "react"; -import { Flex, Box } from "theme-ui"; +import { Box } from "theme-ui"; import shortid from "shortid"; +import SimpleBar from "simplebar-react"; import * as tokens from "../tokens"; @@ -22,32 +23,25 @@ function Tokens({ onCreateMapToken }) { return ( <> - - + + {Object.entries(tokens).map(([id, image]) => ( - + ))} - - + + - +