forked from activist-org/activist
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
activist-org#830 add UI for organization group sub pages
- Loading branch information
1 parent
6aaa197
commit 91348aa
Showing
28 changed files
with
617 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<template> | ||
<div class="h-fit w-full"> | ||
<TabGroup @change="changeTab" manual :default-index="defaultIndex"> | ||
<TabList class="flex flex-row"> | ||
<Tab v-for="selector in selectors" :key="selector.id" class="w-full"> | ||
<NuxtLink | ||
class="focus-brand flex w-full items-center justify-center rounded-none border-[1px] border-light-text px-3 py-1 dark:border-dark-text" | ||
:class="{ | ||
'bg-light-menu-selection text-light-layer-1 hover:bg-light-menu-selection/90 dark:bg-dark-menu-selection dark:text-dark-layer-1 dark:hover:bg-dark-menu-selection/90': | ||
selector.id == props.selectedRoute, | ||
'bg-light-layer-2 text-light-text hover:bg-light-highlight dark:bg-dark-layer-2 dark:text-dark-text dark:hover:bg-dark-highlight': | ||
selector.id != props.selectedRoute, | ||
}" | ||
:to="localePath(selector.routeURL)" | ||
> | ||
<div class="md:hidden"> | ||
<Icon | ||
v-if="selector.iconName" | ||
:name="selector.iconName" | ||
size="1em" | ||
/> | ||
</div> | ||
<p :class="{ 'hidden md:block': selector.iconName }"> | ||
{{ selector.label }} | ||
</p> | ||
</NuxtLink> | ||
</Tab> | ||
</TabList> | ||
</TabGroup> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { Tab, TabGroup, TabList } from "@headlessui/vue"; | ||
import type { SubPageSelector } from "~/types/sub-page-selector"; | ||
const props = defineProps<{ | ||
selectors: SubPageSelector[]; | ||
selectedRoute: number; | ||
}>(); | ||
const localePath = useLocalePath(); | ||
const nuxtApp = useNuxtApp(); | ||
const router = useRouter(); | ||
const defaultIndex = computed(() => { | ||
return props.selectors.findIndex((selector) => selector.selected) || 0; | ||
}); | ||
function changeTab(index: number) { | ||
const selectedRoute = props.selectors[index]?.routeURL; | ||
if (selectedRoute) { | ||
router.push(nuxtApp.$localePath(selectedRoute)); | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.