Skip to content

Commit

Permalink
refactor: remove unused routes and components from sidebar navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
djhonantanparreira committed Sep 28, 2024
1 parent c6ed4d8 commit 7d0b533
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 74 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dist
dist-ssr
coverage
*.local
.env

/cypress/videos/
/cypress/screenshots/
Expand Down
1 change: 0 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const snackbarStore = useSnackbarStore()
const route = useRoute()
const sideMenuRoutes = [
'/dashboard',
'/profile',
'/onboarding',
'/products',
Expand Down
13 changes: 7 additions & 6 deletions src/components/dashboard/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<!-- Informação do usuário -->
<v-list class="sidebar-list">
<v-list-item class="user-info">
<v-list-item-avatar>
<v-list-item-avatar style="text-align: -webkit-center">
<a :href="userProfileLink">
<v-img class="user-avatar" :src="avatarUrl" height="84" width="84" alt="Avatar" />
</a>
Expand Down Expand Up @@ -144,6 +144,7 @@
import { ref, computed } from 'vue'
import { useRouter } from 'vue-router'
import { useAuthStore } from '@/stores/auth.js'
import { useProductStore } from '@/stores/product'
import DiscordIcon from '@/components/icons/DiscordIcon.vue'
import imgUrl from '@/assets/logo-white-transparent.png'
import defaultAvatar from '@/assets/default-avatar.png'
Expand All @@ -160,7 +161,7 @@ const logged = computed(() => auth.getName() !== '')
const navigateToHome = () => router.push({ name: 'home' })
const userRole = computed(() => {
return auth.auth.user_type === 'admin' ? 'Admin' : 'Founder'
return auth.auth.user_type === 'Admin' ? 'Admin' : 'Admin'
})
const userProfileLink = computed(() => `/profile`)
Expand All @@ -173,12 +174,12 @@ const logout = () => {
router.push({ name: 'home' })
}
const toggleProducts = () => {
productsExpanded.value = !productsExpanded.value
const navigateToProduct = (uuid) => {
router.push({ name: 'product-by-id', params: { uuid: auth.getProduct().uuid } })
}
const navigateToProduct = (uuid) => {
router.push({ name: 'product', params: { uuid } })
const navigateToSquad = (uuid) => {
router.push({ name: 'squads', params: { uuid: auth.getSquad().uuid } })
}
onMounted(async () => {
Expand Down
9 changes: 0 additions & 9 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ import SquadCreateView from '../views/squad/CreateView.vue'

import { useAuthStore } from '@/stores/auth';

// dashboard
import DashboardView from '@/views/dashboard/DashboardView.vue'


const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
Expand Down Expand Up @@ -136,11 +132,6 @@ const router = createRouter({
name: 'not-found',
component: () => import('../views/NotFoundView.vue')
},
{
path: '/dashboard',
name: 'dashboard',
component: DashboardView
},
]
})

Expand Down
58 changes: 0 additions & 58 deletions src/views/dashboard/DashboardView.vue

This file was deleted.

0 comments on commit 7d0b533

Please sign in to comment.