Don’t use disabled Popover

We stop using the disabled `Popover` component. Instead of using the
disabled component it is simpler to just not use the component at all.
This also avoids issues where the toggle button of the `Popover` was
nested inside the button in `src/App/Header/Authenticate.svelte` which
in turn created problems with `.getByRole` selectors in tests.

Because of this change we can also drop the use of `NodeId` in places
where it simply displays the node ID and avatar.

Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
This commit is contained in:
Thomas Scholtes
2023-12-10 12:47:02 +01:00
parent cea5aeb614
commit f2eb867d1f
4 changed files with 15 additions and 26 deletions
+3 -7
View File
@@ -1,8 +1,6 @@
<script lang="ts">
import debounce from "lodash/debounce";
export let disabled: boolean = false;
export let onShow: () => void = () => {};
export let stylePopoverPositionLeft: string | undefined = undefined;
export let stylePopoverPositionTop: string | undefined = undefined;
@@ -11,11 +9,9 @@
let visible: boolean = false;
const setVisible = debounce((value: boolean) => {
if (!disabled) {
visible = value;
if (visible) {
onShow();
}
visible = value;
if (visible) {
onShow();
}
}, 150);
</script>
-2
View File
@@ -7,7 +7,6 @@
export let nodeId: string;
export let alias: string | undefined = undefined;
export let disableTooltip: boolean = false;
export let large: boolean = false;
</script>
@@ -43,7 +42,6 @@
</style>
<HoverPopover
disabled={disableTooltip}
stylePopoverPositionLeft="-4.5rem"
stylePopoverPadding="0.5rem 0.5rem 0.5rem 0.75rem"
stylePopoverPositionTop="-4.5rem">