Skip to content

Commit 4e79ce9

Browse files
committed
Change favicon again
1 parent d260e28 commit 4e79ce9

File tree

6 files changed

+20
-10
lines changed

6 files changed

+20
-10
lines changed

src/assets/css/dashboard.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ body {
4646

4747
.url-list li span{
4848
font-weight: 600;
49+
margin-left: 10px;
4950
}
5051

5152
input[type='text'] {

src/components/Favicon.vue

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="container">
3-
<img v-if="faviconValid" class="favicon no-favicon" height="22" :src="NO_FAVICON" />
4-
<img v-else class="favicon" height="30" :src="faviconUrl" />
3+
<img v-if="faviconNotValid" class="favicon no-favicon" height="22" :src="NO_FAVICON" />
4+
<img v-else class="favicon" height="30" :src="favicon" />
55
</div>
66
</template>
77

@@ -17,15 +17,17 @@ import { NO_FAVICON } from '../utils/consts';
1717
import { TypeOfUrl } from '../utils/enums';
1818
1919
const props = defineProps<{
20-
url: string;
20+
favicon: string | undefined;
2121
type: TypeOfUrl;
2222
}>();
2323
24-
const faviconValid = computed(
25-
() => props.url.startsWith('chrome://favicon/') || props.type == TypeOfUrl.Document,
24+
const faviconNotValid = computed(
25+
() =>
26+
props.favicon == undefined ||
27+
props.favicon == '' ||
28+
props.favicon.startsWith('chrome://favicon/') ||
29+
props.type == TypeOfUrl.Document,
2630
);
27-
28-
const faviconUrl = computed(() => `https://www.google.com/s2/favicons?domain=${props.url}&sz=64`);
2931
</script>
3032

3133
<style scoped>

src/components/ListWithTime.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
height="16"
99
@click="editItemFromList(limit.domain, limit.time)"
1010
/>
11-
<Favicon :url="limit.domain" :type="TypeOfUrl.WebSite" /> <span>{{ limit.domain }}</span>
11+
<Favicon :type="TypeOfUrl.WebSite" :favicon="getFavicon(limit.domain)" />
12+
<span>{{ limit.domain }}</span>
1213
<p class="time-value">{{ t('limit.message') }} : {{ getTime(limit.time) }}</p>
1314
</div>
1415
</li>
@@ -40,6 +41,7 @@ export default {
4041

4142
<script lang="ts" setup>
4243
import Favicon from './Favicon.vue';
44+
import { getFavicon } from '../utils/favicon';
4345
import { useNotification } from '@kyvg/vue3-notification';
4446
import { useI18n } from 'vue-i18n';
4547
import { injecStorage } from '../storage/inject-storage';

src/components/TabItem.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="tab-item">
3-
<Favicon :url="item.url" :type="typeOfUrl" />
3+
<Favicon :favicon="item.favicon" :type="typeOfUrl" />
44
<div class="ml-10 flex-grow-2">
55
<div class="first-block">
66
<div :class="listType == TypeOfList.All ? 'w-60' : 'w-80'">

src/components/WhiteList.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
<li v-for="(url, i) of whiteList" :key="i">
66
<div>
77
<img src="../assets/icons/delete.png" height="16" @click="deleteFromWhiteList(url)" />
8-
<Favicon :url="url" :type="TypeOfUrl.WebSite" /> <span>{{ url }}</span>
8+
<Favicon :type="TypeOfUrl.WebSite" :favicon="getFavicon(url)" />
9+
<span>{{ url }}</span>
910
</div>
1011
</li>
1112
</ul>
@@ -35,6 +36,7 @@ export default {
3536

3637
<script lang="ts" setup>
3738
import Favicon from './Favicon.vue';
39+
import { getFavicon } from '../utils/favicon';
3840
import { onMounted, ref } from 'vue';
3941
import { useI18n } from 'vue-i18n';
4042
import { TypeOfUrl } from '../utils/enums';

src/utils/favicon.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function getFavicon(url: string) {
2+
return `https://www.google.com/s2/favicons?domain=${url}&sz=64`;
3+
}

0 commit comments

Comments
 (0)