Skip to content

Commit

Permalink
[#10] add gear icons to page header
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreezag committed Aug 26, 2023
1 parent 5d61b41 commit 6e29eb3
Showing 1 changed file with 34 additions and 10 deletions.
44 changes: 34 additions & 10 deletions components/PageHeader/PageHeader.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
<template>
<header class="page-header">
<div class="page-header__title"><slot />&nbsp</div>

<button
v-if="buttonTitle"
class="page-header__btn-clear"
@click="buttonClick"
>
{{ buttonTitle }}
</button>
<div class="page-header__title"><slot />&nbsp;</div>

<div class="page-header__controls">
<button class="page-header__btn-icon" @click="handleClickGear">
<IconSvg name="gear" />
</button>

<button class="page-header__btn-icon" @click="handleClickFilter">
<IconSvg name="gear" />
</button>

<button
v-if="buttonTitle"
class="page-header__btn-clear"
@click="handleClear"
>
{{ buttonTitle }}
</button>
</div>
</header>
</template>

<script lang="ts">
import { defineComponent } from "vue";
import IconSvg from "~/components/IconSvg/IconSvg.vue";
export default defineComponent({
components: { IconSvg },
props: {
title: {
type: String,
Expand All @@ -32,9 +44,11 @@ export default defineComponent({
},
},
methods: {
buttonClick() {
handleClear() {
this.$emit("delete", true);
},
handleClickGear() {},
handleClickFilter() {},
},
});
</script>
Expand All @@ -47,7 +61,17 @@ export default defineComponent({
.page-header__title {
}
.page-header__controls {
@apply flex flex-row;
}
.page-header__btn-clear {
@apply px-3 py-1 text-xs bg-red-800 text-white rounded-sm hover:bg-red-700 transition transition-all duration-300;
}
.page-header__btn-icon {
@apply transition transition-all duration-300 fill-current text-white mr-3 hover:text-blue-500 transition-all duration-300;
width: 24px;
}
</style>

0 comments on commit 6e29eb3

Please sign in to comment.