Linter fixes

This commit is contained in:
kvakazyambra 2022-10-18 00:01:19 +03:00
parent 7cfd9d4fd0
commit 313e675654
2 changed files with 3 additions and 5 deletions

View File

@ -1,7 +1,9 @@
.popup { .popup {
background: #fff; background: #fff;
border: 2px solid #000; border: 2px solid #000;
@include font-size(1.6rem); @include font-size(1.6rem);
padding: 2.4rem 2.4rem 2.4rem 1.6rem; padding: 2.4rem 2.4rem 2.4rem 1.6rem;
position: absolute; position: absolute;
z-index: 10; z-index: 10;

View File

@ -12,10 +12,6 @@ interface PopupProps {
export const Popup = (props: PopupProps) => { export const Popup = (props: PopupProps) => {
const { getModal } = useModalStore() const { getModal } = useModalStore()
const wrapClick = (ev: Event) => {
if ((ev.target as HTMLElement).classList.contains('popup')) hideModal()
}
onMount(() => { onMount(() => {
window.addEventListener('keydown', (e: KeyboardEvent) => { window.addEventListener('keydown', (e: KeyboardEvent) => {
if (e.key === 'Escape') hideModal() if (e.key === 'Escape') hideModal()
@ -29,7 +25,7 @@ export const Popup = (props: PopupProps) => {
return ( return (
<Show when={visible()}> <Show when={visible()}>
<div class={clsx(style.popup, props.class)} onClick={wrapClick}> <div class={clsx(style.popup, props.class)}>
{props.children} {props.children}
</div> </div>
</Show> </Show>