Skip to content

Commit

Permalink
B06022 Add common icons & add optional slot for hApp card view image (#…
Browse files Browse the repository at this point in the history
…70)

* left chevron icon

* fix left chevron

* add chain & clock icons

* wrap happ card image with slot
  • Loading branch information
Paterick authored Oct 5, 2023
1 parent 17e78b1 commit f124476
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/HAppCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
v-if="!isEmpty"
class="happ-card__content"
>
<HAppImage
:happ="happ"
class="happ-card__desktop-image"
/>
<slot name="happ-image">
<HAppImage
:happ="happ"
class="happ-card__desktop-image"
/>
</slot>

<div class="happ-card__details">
<div class="happ-card__name">
Expand Down
39 changes: 39 additions & 0 deletions src/components/icons/ChainIcon.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<template>
<Icon
fill="#313C59"
class="icon"
>
<path d="M16.7142 14.3567l-1.1784-1.1784L16.7142 12c1.3018-1.3018 1.3018-3.4124 0-4.7142s-3.4124-1.3018-4.7142 0l-1.1783 1.1784-1.1784-1.1784 1.1784-1.1783c1.9684-1.9367 5.1342-1.9109 7.0708.0576 1.9144 1.9458 1.9144 5.0674 0 7.0132l-1.1783 1.1784zm-2.3575 2.3575l-1.1784 1.1783c-1.9366 1.9685-5.1023 1.9942-7.0708.0576-1.9684-1.9367-1.9942-5.1024-.0576-7.0708a4.4043 4.4043 0 01.0576-.0576L7.286 9.6433l1.1783 1.1784L7.2858 12c-1.3017 1.3018-1.3017 3.4124 0 4.7142 1.3018 1.3018 3.4124 1.3018 4.7142 0l1.1783-1.1784 1.1784 1.1784zm0-8.25l1.1791 1.1791-5.8925 5.8917-1.1791-1.1783 5.8925-5.8917v-.0008z" />
</Icon>
</template>

<script>
import Icon from './Icon.vue'
export default {
name: 'ChainIcon',
components: {
Icon
},
props: {
disabled: {type: Boolean, default: false },
color: {
type: String,
default: "#606C8B"
}
},
computed: {
fillOpacity () {
return this.disabled ? '0.18' : '1'
}
}
}
</script>


<style scoped>
.icon {
width: 24px;
height: 24px;
}
</style>
53 changes: 53 additions & 0 deletions src/components/icons/ClockIcon.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<template>
<Icon
stroke="#313C59"
fill="transparent"
class="icon"
>
<path
d="M10 17.5a7.5 7.5 0 100-15 7.5 7.5 0 000 15z"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/><path
d="M10 5.8V10l2.5 2.5"
stroke="#313C59"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
/>
</Icon>
</template>

<style scoped>
.icon {
width: 20px;
height: 20px;
}
</style>

<script>
import Icon from './Icon.vue'
export default {
name: 'ClockIcon',
components: {
Icon
},
props: {
disabled: {type: Boolean, default: false },
color: {
type: String,
default: "#606C8B"
}
},
computed: {
fillOpacity () {
return this.disabled ? '0.18' : '1'
}
}
}
</script>


36 changes: 36 additions & 0 deletions src/components/icons/LeftChevronIcon.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<template>
<Icon :fill="color" class='icon' viewbox="0 0 8 8">
<path :fill-opacity="fillOpacity" d="M4.94.94L1.89 4l3.05 3.06L4 8 0 4l4-4 .94.94z" />
</Icon>
</template>

<script>
import Icon from './Icon.vue'
export default {
name: 'LeftChevronIcon',
components: {
Icon
},
props: {
disabled: {type: Boolean, default: false },
color: {
type: String,
default: "#606C8B"
}
},
computed: {
fillOpacity () {
return this.disabled ? '0.18' : '1'
}
}
}
</script>

<style scoped>
.icon {
width: 8px;
height: 8px;
}
</style>

0 comments on commit f124476

Please sign in to comment.