Skip to content

Commit

Permalink
fix: Adjusted home breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
Aldemylla committed May 14, 2024
1 parent 0689061 commit a124603
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions src/components/insights/Layout/Header.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
<template>
<header class="insights-layout-header">
<UnnnicBreadcrumb
v-if="!isInHome"
:crumbs="breadcrumbs"
@crumbClick="$router.push($event.path)"
/>
<h1 class="header__title">
{{ isInHome ? 'Insights' : selectedDashboardLabel }}
</h1>
<section class="header__content">
<UnnnicSelectSmart
v-model="selectedDashboard"
Expand All @@ -33,9 +29,9 @@ export default {
dashboards: [
{
value: 'dashboards',
label: 'Dashboards',
label: 'Insights',
crumbPath: '/',
crumbName: 'Início',
crumbName: 'Insights',
},
{ value: 'human-service', label: 'Atendimento Humano' },
],
Expand All @@ -51,12 +47,15 @@ export default {
return this.selectedDashboard[0]?.label;
},
isInHome() {
return this.selectedDashboardValue === 'dashboards';
},
breadcrumbs() {
return this.dashboards.map(({ value, label, crumbPath, crumbName }) => ({
const { dashboards } = this;
if (this.$route.name === 'home') {
return [
{ path: dashboards[0].crumbPath, name: dashboards[0].crumbName },
];
}
return dashboards.map(({ value, label, crumbPath, crumbName }) => ({
path: crumbPath || `/${value}`,
name: crumbName || label,
}));
Expand Down Expand Up @@ -102,13 +101,6 @@ export default {
display: grid;
gap: $unnnic-spacing-sm;
.header__title {
color: $unnnic-color-neutral-darkest;
font-size: $unnnic-font-size-title-md;
font-weight: $unnnic-font-weight-bold;
font-family: $unnnic-font-family-primary;
line-height: $unnnic-line-height-large * 2;
}
.header__content {
display: flex;
flex-direction: row;
Expand Down

0 comments on commit a124603

Please sign in to comment.