|
|
|
@ -26,7 +26,7 @@ export default memo(({ onClick, href, className, userId, children, type, addonId
|
|
|
|
|
href={type === 'user' && userId
|
|
|
|
|
? `${window.location.origin}${Constants.Endpoints.USERS}/${userId}`
|
|
|
|
|
: type === 'plugin' || type === 'theme' && addonId
|
|
|
|
|
? `${window.location.origin}vizality/${toPlural(type)}/${addonId}}`
|
|
|
|
|
? `${window.location.origin}/vizality/${toPlural(type)}/${addonId}}`
|
|
|
|
|
: href
|
|
|
|
|
}
|
|
|
|
|
onClick={async evt => {
|
|
|
|
@ -38,9 +38,8 @@ export default memo(({ onClick, href, className, userId, children, type, addonId
|
|
|
|
|
if (!userId && !addonId && !href) {
|
|
|
|
|
if (!onClick) {
|
|
|
|
|
return evt.preventDefault();
|
|
|
|
|
} else {
|
|
|
|
|
onClick(evt);
|
|
|
|
|
}
|
|
|
|
|
return onClick(evt);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -48,7 +47,7 @@ export default memo(({ onClick, href, className, userId, children, type, addonId
|
|
|
|
|
*/
|
|
|
|
|
if (href?.startsWith('#')) {
|
|
|
|
|
evt?.preventDefault?.();
|
|
|
|
|
const selector = document.querySelector(`#${href.substring(1)}`);
|
|
|
|
|
const selector = document.querySelector(`#${href.substring(1) || 'none'}`);
|
|
|
|
|
if (selector) {
|
|
|
|
|
const topOfElement = selector.offsetTop;
|
|
|
|
|
const scroller = document.querySelector('.vz-dashboard-scroller');
|
|
|
|
|