fix lightbox images layering for icons (#338)
* fix lightbox images layering for icons * refactor icon data lightbox
This commit is contained in:
parent
c1356d77aa
commit
88d35ce2bc
|
@ -20,7 +20,7 @@ img {
|
||||||
}
|
}
|
||||||
|
|
||||||
.articleContent {
|
.articleContent {
|
||||||
img {
|
img:not([data-disable-lightbox='true']) {
|
||||||
cursor: zoom-in;
|
cursor: zoom-in;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -277,7 +277,7 @@ export const FullArticle = (props: Props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleArticleBodyClick = (event) => {
|
const handleArticleBodyClick = (event) => {
|
||||||
if (event.target.tagName === 'IMG') {
|
if (event.target.tagName === 'IMG' && !event.target.dataset['disableLightbox']) {
|
||||||
const src = event.target.src
|
const src = event.target.src
|
||||||
openLightbox(getImageUrl(src))
|
openLightbox(getImageUrl(src))
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,12 @@ export const Icon = (passedProps: IconProps) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div class={clsx('icon', styles.icon, props.class)} style={props.style}>
|
<div class={clsx('icon', styles.icon, props.class)} style={props.style}>
|
||||||
<img src={`/icons/${props.name}.svg`} alt={props.title ?? props.name} class={props.iconClassName} />
|
<img
|
||||||
|
src={`/icons/${props.name}.svg`}
|
||||||
|
alt={props.title ?? props.name}
|
||||||
|
class={props.iconClassName}
|
||||||
|
data-disable-lightbox="true"
|
||||||
|
/>
|
||||||
<Show when={props.counter}>
|
<Show when={props.counter}>
|
||||||
<div class={styles.notificationsCounter}>{props.counter}</div>
|
<div class={styles.notificationsCounter}>{props.counter}</div>
|
||||||
</Show>
|
</Show>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user