diff --git a/src/components/InsightsCard.vue b/src/components/InsightsCard.vue
index ecf6169e..ffd8d6b6 100644
--- a/src/components/InsightsCard.vue
+++ b/src/components/InsightsCard.vue
@@ -1,12 +1,12 @@
-
+
+
+
\ No newline at end of file
diff --git a/src/layouts/InsightsLayout/index.vue b/src/layouts/InsightsLayout/index.vue
index 7b3242e0..ec35d1ae 100644
--- a/src/layouts/InsightsLayout/index.vue
+++ b/src/layouts/InsightsLayout/index.vue
@@ -69,6 +69,9 @@ $topbarHeight: 88px;
height: 100%;
background-color: $unnnic-color-neutral-white;
+
+ overflow-y: auto;
+ overflow-x: hidden;
}
}
}
diff --git a/src/main.js b/src/main.js
index 64dda46e..b5f9467a 100644
--- a/src/main.js
+++ b/src/main.js
@@ -1,6 +1,7 @@
import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
+import store from './store';
import VueApexCharts from 'vue3-apexcharts';
@@ -12,7 +13,8 @@ import './styles/global.scss';
const app = createApp(App);
app.use(router);
+app.use(store);
app.use(Unnnic);
app.use(VueApexCharts);
-app.mount('#app');
+app.mount('#app');
\ No newline at end of file
diff --git a/src/router/index.js b/src/router/index.js
index ecb5c01c..6ea92e68 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -1,4 +1,5 @@
import { createRouter, createWebHistory } from 'vue-router';
+import store from '@/store';
import Home from '@/views/insights/Home/index.vue';
import Dashboards from '@/views/dashboards/Home/index.vue';
import Dashboard from '@/views/dashboards/Dashboard/index.vue';
@@ -42,3 +43,10 @@ const router = createRouter({
});
export default router;
+
+router.beforeEach((to, from, next) => {
+ if (to.name !== 'home') {
+ store.dispatch('sidebar/updateChartVisibility', false);
+ }
+ next();
+});
\ No newline at end of file
diff --git a/src/store/index.js b/src/store/index.js
new file mode 100644
index 00000000..507bc35d
--- /dev/null
+++ b/src/store/index.js
@@ -0,0 +1,10 @@
+import { createStore } from 'vuex';
+import sidebar from './modules/sidebar';
+
+const store = createStore({
+ modules: {
+ sidebar,
+ },
+});
+
+export default store;
\ No newline at end of file
diff --git a/src/store/modules/sidebar.js b/src/store/modules/sidebar.js
new file mode 100644
index 00000000..0eb9bcf5
--- /dev/null
+++ b/src/store/modules/sidebar.js
@@ -0,0 +1,16 @@
+export default {
+ namespaced: true,
+ state: {
+ chartVisible: false,
+ },
+ mutations: {
+ setChartVisibility(state, isVisible) {
+ state.chartVisible = isVisible;
+ },
+ },
+ actions: {
+ updateChartVisibility({ commit }, isVisible) {
+ commit('setChartVisibility', isVisible);
+ },
+ },
+ };
\ No newline at end of file
diff --git a/src/views/insights/Home/index.vue b/src/views/insights/Home/index.vue
index 14e8b86a..a569631b 100644
--- a/src/views/insights/Home/index.vue
+++ b/src/views/insights/Home/index.vue
@@ -11,6 +11,14 @@
/>
2150
@@ -41,14 +49,18 @@ @@ -114,6 +137,7 @@ export default { grid-template-rows: repeat(2, 3fr); grid-column-gap: $unnnic-spacing-sm; grid-row-gap: $unnnic-spacing-sm; + height: 100%; .card { background-color: $unnnic-color-neutral-lightest; display: flex; @@ -121,6 +145,7 @@ export default { gap: $unnnic-spacing-sm; text-align: right; padding: $unnnic-spacing-md; + justify-content: center; &__title { font-size: 40px;