-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from RobinNagpal/theme_and_menu
Theme and menu
- Loading branch information
Showing
23 changed files
with
733 additions
and
248 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
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
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
This file was deleted.
Oops, something went wrong.
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,44 @@ | ||
import React from 'react'; | ||
import { withShapeWrapper } from './withShapeWrapper'; | ||
import styled from 'styled-components'; | ||
import { ShapeProps } from '../../types/index'; | ||
|
||
const Container = styled.div` | ||
border-radius: 100%; | ||
box-shadow: 0 0 1px 1px white inset; | ||
box-sizing: border-box; | ||
transition: box-shadow 0.21s ease-in-out; | ||
z-index: 1; | ||
cursor: pointer; | ||
`; | ||
|
||
function Oval(props: ShapeProps) { | ||
const { | ||
annotation: { geometry }, | ||
isMouseOver, | ||
onMouseEnter, | ||
onMouseLeave, | ||
} = props; | ||
if (!geometry) return null; | ||
|
||
return ( | ||
<Container | ||
style={{ | ||
position: 'absolute', | ||
left: `${geometry.x}%`, | ||
top: `${geometry.y}%`, | ||
height: `${geometry.height}%`, | ||
width: `${geometry.width}%`, | ||
border: isMouseOver ? 'solid 1px black' : 'dashed 2px black', | ||
boxShadow: isMouseOver ? '0 0 1px 1px black inset' : '', | ||
backgroundColor: isMouseOver | ||
? 'rgba(128, 128, 128, 0.3)' | ||
: 'rgba(128, 128, 128, 0.05)', | ||
}} | ||
onMouseEnter={onMouseEnter} | ||
onMouseLeave={onMouseLeave} | ||
/> | ||
); | ||
} | ||
|
||
export default withShapeWrapper(Oval); |
Oops, something went wrong.