-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move MapViewControl to inside the map
- Loading branch information
1 parent
68e3975
commit 3788bd3
Showing
2 changed files
with
47 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from "react" | ||
import PropTypes from "prop-types" | ||
import styled from "styled-components" | ||
import Button from "../button" | ||
import { POSITIVE } from "../../utils/constants" | ||
|
||
const ControlBox = styled.div` | ||
display: inline-block; | ||
text-align: right; | ||
position: absolute; | ||
left: 5px; | ||
bottom: 0px; | ||
margin-bottom: 5px; | ||
font-weight: ${props => (props.checked ? 600 : 400)}; | ||
font-family: "Titillium Web", sans-serif; | ||
` | ||
|
||
export const MapViewControl = ({ onClick, is3DViewEnabled }) => ( | ||
<ControlBox> | ||
<Button action={onClick} mode={POSITIVE} noBorder> | ||
Switch to {is3DViewEnabled ? "2D" : "3D"} map view | ||
</Button> | ||
</ControlBox> | ||
) | ||
|
||
MapViewControl.propTypes = { | ||
onClick: PropTypes.func, | ||
is3DViewEnabled: PropTypes.bool.isRequired, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters