feat(sidebar): add Support section with external links
Add a Support group at the bottom of the sidebar with Share feedback, Earn 30% referral (affiliates), Stay updated (X) and Documentation. Share feedback and Documentation move out of the user menu into this section. Adds the referral/stay_updated labels in all three locales.
This commit is contained in:
parent
04f6a60ee7
commit
d97304fb74
6 changed files with 69 additions and 27 deletions
|
|
@ -58,5 +58,7 @@
|
|||
'share_feedback' => 'Share feedback',
|
||||
'last_updates' => 'Last Updates',
|
||||
'docs' => 'Documentation',
|
||||
'referral' => 'Earn 30% referral',
|
||||
'stay_updated' => 'Stay updated',
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -58,5 +58,7 @@
|
|||
'share_feedback' => 'Dar feedback',
|
||||
'last_updates' => 'Últimas actualizaciones',
|
||||
'docs' => 'Documentación',
|
||||
'referral' => 'Gana 30% de comisión',
|
||||
'stay_updated' => 'Mantente al día',
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -58,5 +58,7 @@
|
|||
'share_feedback' => 'Enviar feedback',
|
||||
'last_updates' => 'Últimas Atualizações',
|
||||
'docs' => 'Documentação',
|
||||
'referral' => 'Ganhe 30% de indicação',
|
||||
'stay_updated' => 'Fique por dentro',
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -4,13 +4,17 @@ import {
|
|||
IconAffiliate,
|
||||
IconAlertTriangle,
|
||||
IconBolt,
|
||||
IconBook,
|
||||
IconBrandX,
|
||||
IconCalendar,
|
||||
IconChartBar,
|
||||
IconChevronRight,
|
||||
IconClock,
|
||||
IconFileCheck,
|
||||
IconFileText,
|
||||
IconGift,
|
||||
IconHash,
|
||||
IconMessageCircle,
|
||||
IconPhoto,
|
||||
IconPencil,
|
||||
IconPlus,
|
||||
|
|
@ -22,6 +26,7 @@ import { computed } from 'vue';
|
|||
|
||||
import { create as createPost, index as postsIndex } from '@/actions/App/Http/Controllers/App/PostController';
|
||||
import NavMain from '@/components/NavMain.vue';
|
||||
import NavSupport from '@/components/NavSupport.vue';
|
||||
import NavUser from '@/components/NavUser.vue';
|
||||
import { Avatar } from '@/components/ui/avatar';
|
||||
import { Button } from '@/components/ui/button';
|
||||
|
|
@ -144,6 +149,29 @@ const workspaceNavItems = computed<NavItem[]>(() => [
|
|||
: []),
|
||||
]);
|
||||
|
||||
const supportNavItems = computed<NavItem[]>(() => [
|
||||
{
|
||||
title: trans('sidebar.support.share_feedback'),
|
||||
href: 'https://github.com/trypost-it/trypost/discussions',
|
||||
icon: IconMessageCircle,
|
||||
},
|
||||
{
|
||||
title: trans('sidebar.support.referral'),
|
||||
href: 'https://affiliates.trypost.it/',
|
||||
icon: IconGift,
|
||||
},
|
||||
{
|
||||
title: trans('sidebar.support.stay_updated'),
|
||||
href: 'https://x.com/trypostit',
|
||||
icon: IconBrandX,
|
||||
},
|
||||
{
|
||||
title: trans('sidebar.support.docs'),
|
||||
href: 'https://trypost.it/docs',
|
||||
icon: IconBook,
|
||||
},
|
||||
]);
|
||||
|
||||
const switchWorkspace = (workspaceId: string) => {
|
||||
router.post(switchMethod.url(workspaceId), {}, {
|
||||
preserveScroll: true,
|
||||
|
|
@ -217,6 +245,7 @@ const handleCreateWorkspace = () => {
|
|||
<NavMain v-if="currentWorkspace" :items="mainNavItems" />
|
||||
<NavMain v-if="currentWorkspace" :items="postsNavItems" :label="$t('sidebar.groups.posts')" />
|
||||
<NavMain v-if="currentWorkspace && workspaceNavItems.length" :items="workspaceNavItems" :label="$t('sidebar.groups.workspace')" />
|
||||
<NavSupport v-if="currentWorkspace" :items="supportNavItems" :label="$t('sidebar.groups.support')" />
|
||||
</SidebarContent>
|
||||
|
||||
<SidebarFooter>
|
||||
|
|
|
|||
34
resources/js/components/NavSupport.vue
Normal file
34
resources/js/components/NavSupport.vue
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<script setup lang="ts">
|
||||
import {
|
||||
SidebarGroup,
|
||||
SidebarGroupLabel,
|
||||
SidebarMenu,
|
||||
SidebarMenuButton,
|
||||
SidebarMenuItem,
|
||||
} from '@/components/ui/sidebar';
|
||||
import { toUrl } from '@/lib/utils';
|
||||
import { type NavItem } from '@/types';
|
||||
|
||||
interface Props {
|
||||
items: NavItem[];
|
||||
label: string;
|
||||
}
|
||||
|
||||
defineProps<Props>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<SidebarGroup class="px-2 py-0">
|
||||
<SidebarGroupLabel>{{ label }}</SidebarGroupLabel>
|
||||
<SidebarMenu>
|
||||
<SidebarMenuItem v-for="item in items" :key="item.title">
|
||||
<SidebarMenuButton as-child :tooltip="item.title">
|
||||
<a :href="toUrl(item.href)" target="_blank" rel="noopener noreferrer">
|
||||
<component :is="item.icon" />
|
||||
<span>{{ item.title }}</span>
|
||||
</a>
|
||||
</SidebarMenuButton>
|
||||
</SidebarMenuItem>
|
||||
</SidebarMenu>
|
||||
</SidebarGroup>
|
||||
</template>
|
||||
|
|
@ -2,9 +2,7 @@
|
|||
import { Link, router, usePage } from '@inertiajs/vue3';
|
||||
import {
|
||||
IconLanguage,
|
||||
IconLifebuoy,
|
||||
IconLogout,
|
||||
IconMessageCircle,
|
||||
IconUser,
|
||||
} from '@tabler/icons-vue';
|
||||
import { loadLanguageAsync } from 'laravel-vue-i18n';
|
||||
|
|
@ -106,31 +104,6 @@ const handleLogout = () => {
|
|||
</DropdownMenuSub>
|
||||
</DropdownMenuGroup>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuGroup>
|
||||
<DropdownMenuItem :as-child="true">
|
||||
<a
|
||||
class="block w-full cursor-pointer"
|
||||
href="https://github.com/trypost-it/trypost/discussions"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<IconMessageCircle class="size-4" />
|
||||
{{ $t('sidebar.support.share_feedback') }}
|
||||
</a>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem :as-child="true">
|
||||
<a
|
||||
class="block w-full cursor-pointer"
|
||||
href="https://trypost.it/docs"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<IconLifebuoy class="size-4" />
|
||||
{{ $t('sidebar.support.docs') }}
|
||||
</a>
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuGroup>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuItem :as-child="true">
|
||||
<Link
|
||||
class="block w-full cursor-pointer"
|
||||
|
|
|
|||
Loading…
Reference in a new issue