fix: added hover event to overline + removed context menu (#393)

This commit is contained in:
Steveplays 2021-11-12 21:20:50 +01:00 committed by GitHub
parent 594693f8d7
commit bef24b7cdd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 2 deletions

View file

@ -70,7 +70,7 @@
rel="apple-touch-startup-image"
/>
</head>
<body ontouchstart="">
<body onContextMenu="return false" ontouchstart="">
<div id="app"></div>
<script type="module" src="/src/main.tsx"></script>
</body>

View file

@ -102,7 +102,7 @@ export function SearchSidebar({ close }: Props) {
<GenericSidebarBase>
<GenericSidebarList>
<SearchBase>
<Overline type="error" onClick={close} block>
<Overline type="error" onClick={close} block hoverEnabled>
« back to members
</Overline>
<Overline type="subtle" block>

View file

@ -5,6 +5,7 @@ import { Text } from "preact-i18n";
import { Children } from "../../types/Preact";
type Props = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children" | "as"> & {
hoverEnabled?: boolean;
error?: string;
block?: boolean;
spaced?: boolean;
@ -15,6 +16,18 @@ type Props = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children" | "as"> & {
const OverlineBase = styled.div<Omit<Props, "children" | "error">>`
display: inline;
transition: 0.2s ease filter;
${(props) =>
props.hoverEnabled &&
css`
&:hover {
filter: brightness(1.2);
cursor: pointer;
transition: 0.2s ease filter;
}
`}
${(props) =>
!props.noMargin &&