MenuToggle moved to separate component
This commit is contained in:
1 parent
fbcf204642
commit
4d7fc57934
2 files changed
+1
-1
No files matched your search
@@ -1,79 +0,0 @@
|
||||
import * as React from 'react'
|
||||
import cx from 'classnames'
|
||||
|
||||
export interface IMenuToggleProps {
|
||||
style?: React.CSSProperties
|
||||
open: boolean
|
||||
position: 'left' | 'right'
|
||||
onClick: () => void
|
||||
}
|
||||
|
||||
export const MenuToggle: React.FC<IMenuToggleProps> = props => {
|
||||
return (
|
||||
<div
|
||||
className={cx(props.position, {
|
||||
open: props.open,
|
||||
close: !props.open,
|
||||
})}
|
||||
style={props.style}
|
||||
>
|
||||
<style jsx>{`
|
||||
div {
|
||||
--hmenu-margin: 6px;
|
||||
--hmenu-icon-width: 32px;
|
||||
--hmenu-icon-height: 32px;
|
||||
|
||||
position: absolute;
|
||||
height: var(--hmenu-icon-height);
|
||||
margin: var(--hmenu-margin);
|
||||
}
|
||||
|
||||
div.right {
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
div.left {
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
a {
|
||||
display: block;
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
|
||||
width: var(--hmenu-icon-width);
|
||||
height: var(--hmenu-icon-height);
|
||||
background-size: 100%;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
div.open a {
|
||||
background-image: url(/static/graphics/hmenu-close-b.png);
|
||||
}
|
||||
|
||||
div.open a:hover {
|
||||
background-image: url(/static/graphics/hmenu-close-hover-b.png);
|
||||
}
|
||||
|
||||
div.close a {
|
||||
background-image: url(/static/graphics/hmenu-b.png);
|
||||
}
|
||||
|
||||
div.close a:hover {
|
||||
background-image: url(/static/graphics/hmenu-hover-b.png);
|
||||
}
|
||||
`}</style>
|
||||
|
||||
<a
|
||||
href="#"
|
||||
onClick={props.onClick}
|
||||
></a>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as React from 'react'
|
||||
import cx from 'classnames'
|
||||
import { getPathWithNoTrailingSlash } from '../../lib/url'
|
||||
import { MenuToggle } from './MenuToggle'
|
||||
import { MenuToggle } from '../MenuToggle'
|
||||
import { useScreenType } from '../../hooks/useScreenType'
|
||||
import { MenuItem } from './MenuItem'
|
||||
import { Overlay } from '../Overlay'
|
||||
|
||||
Reference in new issue
Block a user