fix: settings navigation (#1389)
This commit is contained in:
parent
c28c95e36c
commit
85be61a316
|
@ -9,6 +9,7 @@ const props = defineProps<{
|
||||||
disabled?: boolean
|
disabled?: boolean
|
||||||
external?: true
|
external?: true
|
||||||
large?: true
|
large?: true
|
||||||
|
match?: boolean
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
@ -39,7 +40,7 @@ useCommand({
|
||||||
:to="to"
|
:to="to"
|
||||||
:external="external"
|
:external="external"
|
||||||
exact-active-class="text-primary"
|
exact-active-class="text-primary"
|
||||||
:class="disabled ? 'op25 pointer-events-none ' : ''"
|
:class="disabled ? 'op25 pointer-events-none ' : match ? 'text-primary' : ''"
|
||||||
block w-full group focus:outline-none
|
block w-full group focus:outline-none
|
||||||
:tabindex="disabled ? -1 : null"
|
:tabindex="disabled ? -1 : null"
|
||||||
@click="to ? $scrollToTop() : undefined"
|
@click="to ? $scrollToTop() : undefined"
|
||||||
|
|
|
@ -32,12 +32,14 @@ const isRootPath = computedEager(() => route.name === 'settings')
|
||||||
icon="i-ri:user-line"
|
icon="i-ri:user-line"
|
||||||
:text="$t('settings.profile.label')"
|
:text="$t('settings.profile.label')"
|
||||||
to="/settings/profile"
|
to="/settings/profile"
|
||||||
|
:match="$route.path.startsWith('/settings/profile/')"
|
||||||
/>
|
/>
|
||||||
<SettingsItem
|
<SettingsItem
|
||||||
command
|
command
|
||||||
icon="i-ri-compasses-2-line"
|
icon="i-ri-compasses-2-line"
|
||||||
:text="$t('settings.interface.label')"
|
:text="$t('settings.interface.label')"
|
||||||
to="/settings/interface"
|
to="/settings/interface"
|
||||||
|
:match="$route.path.startsWith('/settings/interface/')"
|
||||||
/>
|
/>
|
||||||
<SettingsItem
|
<SettingsItem
|
||||||
v-if="isHydrated && currentUser"
|
v-if="isHydrated && currentUser"
|
||||||
|
@ -45,30 +47,35 @@ const isRootPath = computedEager(() => route.name === 'settings')
|
||||||
icon="i-ri:notification-badge-line"
|
icon="i-ri:notification-badge-line"
|
||||||
:text="$t('settings.notifications_settings')"
|
:text="$t('settings.notifications_settings')"
|
||||||
to="/settings/notifications"
|
to="/settings/notifications"
|
||||||
|
:match="$route.path.startsWith('/settings/notifications/')"
|
||||||
/>
|
/>
|
||||||
<SettingsItem
|
<SettingsItem
|
||||||
command
|
command
|
||||||
icon="i-ri-globe-line"
|
icon="i-ri-globe-line"
|
||||||
:text="$t('settings.language.label')"
|
:text="$t('settings.language.label')"
|
||||||
to="/settings/language"
|
to="/settings/language"
|
||||||
|
:match="$route.path.startsWith('/settings/language/')"
|
||||||
/>
|
/>
|
||||||
<SettingsItem
|
<SettingsItem
|
||||||
command
|
command
|
||||||
icon="i-ri-equalizer-line"
|
icon="i-ri-equalizer-line"
|
||||||
:text="$t('settings.preferences.label')"
|
:text="$t('settings.preferences.label')"
|
||||||
to="/settings/preferences"
|
to="/settings/preferences"
|
||||||
|
:match="$route.path.startsWith('/settings/preferences/')"
|
||||||
/>
|
/>
|
||||||
<SettingsItem
|
<SettingsItem
|
||||||
command
|
command
|
||||||
icon="i-ri-group-line"
|
icon="i-ri-group-line"
|
||||||
:text="$t('settings.users.label')"
|
:text="$t('settings.users.label')"
|
||||||
to="/settings/users"
|
to="/settings/users"
|
||||||
|
:match="$route.path.startsWith('/settings/users/')"
|
||||||
/>
|
/>
|
||||||
<SettingsItem
|
<SettingsItem
|
||||||
command
|
command
|
||||||
icon="i-ri:information-line"
|
icon="i-ri:information-line"
|
||||||
:text="$t('settings.about.label')"
|
:text="$t('settings.about.label')"
|
||||||
to="/settings/about"
|
to="/settings/about"
|
||||||
|
:match="$route.path.startsWith('/settings/about/')"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</MainContent>
|
</MainContent>
|
||||||
|
|
Loading…
Reference in a new issue