-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable download button and show tooltip at low zoom levels. [#37 #59] #63
Conversation
@@ -8,15 +8,21 @@ import { useState, useEffect } from "react"; | |||
|
|||
function App() { | |||
const [modeName, setModeName] = useState("theme-dark"); | |||
const [zoom, setZoom] = useState(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new zoom hook, used to update the download button state
@@ -185,6 +191,7 @@ export default function Map({ mode }) { | |||
onClick={onClick} | |||
cursor={cursor} | |||
hash={true} | |||
onZoom={handleZoom} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zoom state is dependent on map's zoom state.
<div className="download-text"> | ||
{loading ? "Downloading..." : "Download Visible"} | ||
} | ||
open={showFloater} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Floater is "controlled", and only is shown when use is hovering over the 'button--download' div element.
The download button is now disabled at zoom levels below 16. A tooltip is provided when hovering over the download button while it is disabled for this reason.
Screen.Recording.2024-06-05.at.2.07.15.PM.mov