Skip to content

Commit db6c1fa

Browse files
committed
refactor: simplify links and fix z-index of popper
1 parent 7668bb5 commit db6c1fa

File tree

7 files changed

+14
-13
lines changed

7 files changed

+14
-13
lines changed

.husky/commit-msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
message="$(cat $1)"
2-
regex="^(fix|feat|chore|docs): [a-z].*$"
2+
regex="^(fix|feat|chore|refactor|docs): [a-z].*$"
33

44
if ! [[ $message =~ $regex ]]; then
55
echo "Commit message does not follow Conventional Commits format: <type>: <lowercase message>"

src/app/components/base/context-menu/ContextMenu.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ provide<ContextMenuStore>(ContextMenuStoreKey, {
123123
display: flex;
124124
position: absolute;
125125
pointer-events: none;
126-
z-index: 1;
126+
z-index: var(--context-menu-z-index);
127127
128128
&.visible {
129129
pointer-events: all;

src/app/components/base/link/Link.vue

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<template>
22
<a
3-
v-if="isExternalLink"
3+
v-if="to.startsWith('http')"
44
v-tooltip="{ text: tooltip, position: tooltipPosition }"
5-
:href="href"
5+
:href="to"
66
:class="classes"
77
rel="noopener,noreferrer,nofollow"
88
target="_blank"
@@ -13,8 +13,8 @@
1313
<RouterLink
1414
v-else
1515
v-tooltip="{ text: tooltip, position: tooltipPosition }"
16-
:data-testid="testId ? `${testId}-${name}` : undefined"
17-
:to="href"
16+
:data-testid="testId ? `${testId}-${to}` : undefined"
17+
:to="to"
1818
:class="classes"
1919
>
2020
<component :is="icon" v-if="icon" :class="$style.icon" />
@@ -38,8 +38,7 @@ const props = withDefaults(
3838
custom?: boolean;
3939
tooltip?: string;
4040
tooltipPosition?: Placement;
41-
name?: string;
42-
to?: string;
41+
to: string;
4342
testId?: string;
4443
}>(),
4544
{
@@ -52,13 +51,10 @@ const styles = useCssModule();
5251
const router = useRouter();
5352
const theme = useThemeStyles(() =>
5453
typeof props.color === 'function'
55-
? props.color(router.currentRoute.value.name === props.name)
54+
? props.color(router.currentRoute.value.name === props.to)
5655
: (props.color ?? 'primary')
5756
);
5857
59-
const href = computed(() => (props.name ? router.resolve({ name: props.name }).href : (props.to ?? '')));
60-
const isExternalLink = computed(() => href.value.startsWith('http'));
61-
6258
const classes = computed(() => [
6359
props.class,
6460
styles.link,

src/app/pages/Frame.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
:class="$style.btn"
1616
:color="(currentRoute) => (currentRoute ? 'primary' : 'dimmed')"
1717
:icon="button.icon"
18-
:name="button.name"
18+
:to="button.name"
1919
/>
2020

2121
<div v-if="media !== 'mobile'" style="flex-grow: 1" />

src/directives/v-tooltip/vTooltip.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
box-shadow: var(--tooltip-shadow);
99
transition: opacity var(--transition-s);
1010
opacity: 0;
11+
z-index: var(--tooltip-z-index);
1112

1213
&.show {
1314
opacity: 1;

src/styles/themes/dark.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@
148148
--context-menu-item-background-hover: #00000080;
149149
--context-menu-backdrop: blur(4px) brightness(0.25);
150150
--context-menu-shadow: 0 1px 5px #0c0b0e;
151+
--context-menu-z-index: 2;
151152

152153
--cell-menu-backdrop: blur(3px) brightness(0.3);
153154
--cell-menu-shadow: 0 1px 5px #0c0b0e;
@@ -166,4 +167,5 @@
166167

167168
--tooltip-backdrop: var(--context-menu-backdrop);
168169
--tooltip-shadow: 0 1px 2px #141416;
170+
--tooltip-z-index: 1;
169171
}

src/styles/themes/light.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@
148148
--context-menu-item-background-hover: #0000000d;
149149
--context-menu-backdrop: brightness(10);
150150
--context-menu-shadow: 0 2px 10px #c5c3db;
151+
--context-menu-z-index: 2;
151152

152153
--cell-menu-backdrop: blur(3px) brightness(0.15);
153154
--cell-menu-shadow: 0 1px 2px #46434d;
@@ -166,4 +167,5 @@
166167

167168
--tooltip-backdrop: var(--context-menu-backdrop);
168169
--tooltip-shadow: 0 1px 2px #e0e0e0;
170+
--tooltip-z-index: 1;
169171
}

0 commit comments

Comments
 (0)