Skip to content

Commit 65e6dfd

Browse files
committed
dependencies: using @heroicons/vue for icons instead of svgs directly
1 parent 9b4ac9b commit 65e6dfd

17 files changed

+88
-254
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
},
3535
"dependencies": {
3636
"@cfworker/json-schema": "^1.12.0",
37+
"@heroicons/vue": "^1.0.6",
3738
"typescript": "^4.5.5",
3839
"urlcat": "^2.0.4",
3940
"vue": "^3.2.29",

src/options/OptionView.vue

+3
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,15 @@
100100
>
101101
<LoadingIcon
102102
v-if="displayLoading"
103+
class="icon"
103104
/>
104105
<ErrorIcon
105106
v-if="displayError"
107+
class="icon"
106108
/>
107109
<SuccessIcon
108110
v-if="displaySuccess"
111+
class="icon"
109112
/>
110113
</div>
111114
</form>

src/popup/App.vue

-1
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,4 @@ export default {
6464
color: white;
6565
}
6666
}
67-
6867
</style>

src/popup/components/AddBar.vue

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<div class="icons">
1414
<AddIcon
1515
v-if="displayButton"
16+
class="icon"
1617
@click="submit"
1718
/>
1819
<LoadingIcon
@@ -32,7 +33,7 @@
3233
import LoadingIcon from '../../shared/components/icons/LoadingIcon.vue'
3334
import SuccessIcon from '../../shared/components/icons/SuccessIcon.vue'
3435
import ErrorIcon from '../../shared/components/icons/ErrorIcon.vue'
35-
import AddIcon from './icons/AddIcon.vue'
36+
import { PlusIcon } from '@heroicons/vue/solid'
3637
import { useStore } from 'vuex'
3738
import { computed, ref } from 'vue'
3839
@@ -42,7 +43,7 @@ export default {
4243
LoadingIcon,
4344
ErrorIcon,
4445
SuccessIcon,
45-
AddIcon,
46+
AddIcon: PlusIcon,
4647
},
4748
setup () {
4849
const store = useStore()
@@ -102,6 +103,7 @@ export default {
102103
overflow: hidden;
103104
text-overflow: ellipsis;
104105
white-space: nowrap;
106+
line-height: 0;
105107
}
106108
107109
input.add-url {

src/popup/components/IconBar.vue

+12-6
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,37 @@
1515
</div>
1616
<div id="center">
1717
<RefreshIcon
18+
class="icon icon-big icon-pointer"
19+
:is-loading="isLoading"
1820
@click="refresh"
1921
/>
2022
</div>
2123
<div id="right">
22-
<AddIcon
23-
class="add-icon-big"
24+
<PlusIcon
25+
class="icon icon-big"
2426
@click="toggleShowAddBar"
2527
/>
2628
<CogWheelIcon
29+
class="icon icon-big"
2730
@click="openSettingsPage"
2831
/>
2932
</div>
3033
</div>
3134
</template>
3235

3336
<script>
34-
import AddIcon from './icons/AddIcon.vue'
37+
import { PlusIcon, CogIcon } from '@heroicons/vue/solid'
3538
import RefreshIcon from './icons/RefreshIcon.vue'
36-
import CogWheelIcon from './icons/CogWheelIcon.vue'
3739
import browser from 'webextension-polyfill'
3840
import { useStore } from 'vuex'
3941
import { computed } from 'vue'
4042
4143
export default {
4244
name: 'IconBar',
4345
components: {
44-
AddIcon,
46+
PlusIcon,
4547
RefreshIcon,
46-
CogWheelIcon,
48+
CogWheelIcon: CogIcon,
4749
},
4850
setup () {
4951
const store = useStore()
@@ -86,6 +88,10 @@ export default {
8688
border-radius: 0.25rem;
8789
align-items: center;
8890
91+
#left, #center, #right {
92+
line-height: 0;
93+
}
94+
8995
div#left {
9096
justify-self: start;
9197
}

src/popup/components/InstanceItem.vue

+8-9
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@
3737
class="instance-icon-bar-viewers"
3838
title="current number of viewers"
3939
>
40-
<ViewerIcon />
40+
<UsersIcon class="icon" />
4141
{{ instance.viewer }}
4242
</div>
4343
<div
4444
v-if="instance.online"
4545
class="instance-icon-bar-uptime"
4646
title="uptime"
4747
>
48-
<UptimeIcon />
48+
<ClockIcon class="icon" />
4949
{{ instance.onlineSince.hour }}h {{ instance.onlineSince.minute }}m
5050
</div>
5151
</div>
@@ -65,7 +65,8 @@
6565
class="instance-hidden-icon-bar"
6666
>
6767
<div class="instance-icon-bar-remove">
68-
<RemoveIcon
68+
<TrashIcon
69+
class="icon"
6970
@click="toggleRemove"
7071
/>
7172
</div>
@@ -86,19 +87,17 @@
8687

8788
<script>
8889
import stripHtml from '../../shared/util/stripHtml'
89-
import ViewerIcon from './icons/ViewerIcon.vue'
90-
import UptimeIcon from './icons/UptimeIcon.vue'
91-
import RemoveIcon from './icons/RemoveIcon.vue'
90+
import { UsersIcon, ClockIcon, TrashIcon } from '@heroicons/vue/solid'
9291
import ChevronIcon from './icons/ChevronIcon.vue'
9392
import { ref, toRefs, computed } from 'vue'
9493
import { useStore } from 'vuex'
9594
9695
export default {
9796
name: 'InstanceItem',
9897
components: {
99-
ViewerIcon,
100-
UptimeIcon,
101-
RemoveIcon,
98+
UsersIcon,
99+
ClockIcon,
100+
TrashIcon,
102101
ChevronIcon,
103102
},
104103
props: {

src/popup/components/icons/AddIcon.vue

-45
This file was deleted.

src/popup/components/icons/ChevronIcon.vue

+8-21
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,24 @@
11
<template>
2-
<svg
3-
xmlns="http://www.w3.org/2000/svg"
4-
class="chevron-icon"
2+
<Chevron
3+
class="icon chevron-icon"
54
:class="`chevron-icon-${orientation}`"
6-
viewBox="0 0 20 20"
7-
fill="currentColor"
8-
@click="emitClick"
9-
>
10-
<path
11-
fill-rule="evenodd"
12-
d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
13-
clip-rule="evenodd"
14-
/>
15-
</svg>
5+
/>
166
</template>
177

188
<script>
9+
import { ChevronDownIcon } from '@heroicons/vue/solid'
10+
1911
export default {
2012
name: 'ChevronIcon',
13+
components: {
14+
Chevron: ChevronDownIcon,
15+
},
2116
props: {
2217
orientation: {
2318
type: String,
2419
default: 'down',
2520
},
2621
},
27-
emits: [
28-
'click',
29-
],
30-
methods: {
31-
emitClick () {
32-
this.$emit('click')
33-
},
34-
},
3522
}
3623
</script>
3724

src/popup/components/icons/RefreshIcon.vue

+8-28
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,24 @@
11
<template>
2-
<svg
3-
id="refresh"
4-
class="refresh-icon"
5-
xmlns="http://www.w3.org/2000/svg"
6-
viewBox="0 0 20 20"
7-
fill="currentColor"
2+
<Refresh
83
:class="{'animate-spin':isLoading }"
9-
@click="emitClick"
10-
>
11-
<path
12-
fill-rule="evenodd"
13-
d="M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z"
14-
clip-rule="evenodd"
15-
/>
16-
</svg>
4+
/>
175
</template>
186

197
<script>
8+
import { RefreshIcon } from '@heroicons/vue/solid'
9+
2010
export default {
2111
name: 'RefreshIcon',
22-
emits: [
23-
'click',
24-
],
25-
methods: {
26-
emitClick () {
27-
this.$emit('click')
28-
},
12+
components: {
13+
Refresh: RefreshIcon,
2914
},
15+
props: { isLoading: Boolean },
3016
}
3117
</script>
3218

3319
<style lang="scss">
34-
/* class="w-6 h-6 cursor-pointer" */
35-
.refresh-icon {
36-
width: 1.5rem;
37-
height: 1.5rem;
38-
cursor: pointer;
39-
}
4020
41-
.refresh-icon.animate-spin {
21+
.animate-spin {
4222
animation: spin 1s linear infinite;
4323
}
4424

src/popup/components/icons/RemoveIcon.vue

-39
This file was deleted.

src/popup/components/icons/UptimeIcon.vue

-28
This file was deleted.

0 commit comments

Comments
 (0)