Skip to content

Commit 3bd9a7a

Browse files
committed
Removed vuex dependancy. Added slot for app logo.
1 parent fe142f4 commit 3bd9a7a

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gewaer/gw-sidebar",
3-
"version": "0.1.1",
3+
"version": "0.2.0",
44
"description": "Base sidebar component for the Gewaer platform.",
55
"main": "./dist/gw-sidebar.umd.min.js",
66
"files": [

src/assets/secondary-logo.png

-3.24 KB
Binary file not shown.

src/index.vue

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
:class="{ 'open' : showSidebar }"
55
class="page-sidebar"
66
data-pages="sidebar"
7-
@mouseenter="$emit('handleSidebar', true)"
8-
@mouseleave="$emit('handleSidebar', false)"
7+
@mouseenter="$emit('handle-sidebar', true)"
8+
@mouseleave="$emit('handle-sidebar', false)"
99
>
1010
<div class="sidebar-header">
1111
<router-link :to="{ name: 'dashboard'}" class="app-secondary-logo">
12-
<img src="./assets/secondary-logo.png">
12+
<slot name="app-logo">
13+
<img src="https://mc-canvas.s3.amazonaws.com/gewaer-logo-sidebar.png">
14+
</slot>
1315
</router-link>
1416
<div class="menu-icon d-none d-lg-inline-block">
1517
<img src="./assets/hamburguer-menu.png">
@@ -22,7 +24,7 @@
2224
<span class="title">Dashboard</span>
2325
</router-link>
2426
<span class="icon-thumbnail">
25-
<i class="fa fa-pie-chart"/>
27+
<i class="fa fa-pie-chart" />
2628
</span>
2729
</li>
2830
<template v-if="resources">
@@ -37,14 +39,12 @@
3739
</li>
3840
</template>
3941
</ul>
40-
<div class="clearfix"/>
42+
<div class="clearfix" />
4143
</div>
4244
</div>
4345
</template>
4446

4547
<script>
46-
import { mapState } from "vuex";
47-
4848
export default {
4949
name: "GwSidebar",
5050
filters: {
@@ -53,15 +53,19 @@ export default {
5353
}
5454
},
5555
props: {
56+
resources: {
57+
type: Array,
58+
default() {
59+
return [];
60+
},
61+
validator(options) {
62+
return options.every(option => option.name && option.slug);
63+
}
64+
},
5665
showSidebar: {
5766
type: Boolean,
5867
default: false
5968
}
60-
},
61-
computed: {
62-
...mapState({
63-
resources: state => state.Application.resources
64-
})
6569
}
6670
};
6771
</script>

0 commit comments

Comments
 (0)