Made the add map icon larger and changed to select map

This commit is contained in:
Mitchell McCaffrey
2020-04-23 18:01:40 +10:00
parent 25b215d4e4
commit 6f0df1c674
7 changed files with 59 additions and 51 deletions

View File

@@ -0,0 +1,41 @@
import React, { useState } from "react";
import { IconButton } from "theme-ui";
import SelectMapModal from "../../modals/SelectMapModal";
import SelectMapIcon from "../../icons/SelectMapIcon";
function SelectMapButton({ onMapChange }) {
const [isAddModalOpen, setIsAddModalOpen] = useState(false);
function openModal() {
setIsAddModalOpen(true);
}
function closeModal() {
setIsAddModalOpen(false);
}
function handleDone(map, mapState) {
if (map) {
onMapChange(map, mapState);
}
closeModal();
}
return (
<>
<IconButton
aria-label="Select Map"
title="Select Map"
onClick={openModal}
>
<SelectMapIcon />
</IconButton>
<SelectMapModal
isOpen={isAddModalOpen}
onRequestClose={closeModal}
onDone={handleDone}
/>
</>
);
}
export default SelectMapButton;