Skip to content

Commit cfcd616

Browse files
committed
Change UI
1 parent b6fe85a commit cfcd616

File tree

5 files changed

+45
-22
lines changed

5 files changed

+45
-22
lines changed

src/components/Dashboad.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ function openChart(type: TypeOfChart) {
5757
</script>
5858

5959
<style scoped>
60-
.main {
61-
width: 80%;
62-
margin: auto;
63-
}
6460
.chart {
6561
margin: 20px 0;
6662
width: 80%;

src/components/Limits.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
{{ t('limitsTip.message') }}
99
</p>
1010
<ListWithTimeComponent :type="ListWithTime.Limits" />
11+
<PromoClearYouTube />
1112
</div>
1213
</template>
1314

@@ -19,6 +20,7 @@ export default {
1920

2021
<script lang="ts" setup>
2122
import ListWithTimeComponent from '../components/ListWithTime.vue';
23+
import PromoClearYouTube from '../components/PromoClearYouTube.vue';
2224
import { ListWithTime } from '../utils/enums';
2325
import { useI18n } from 'vue-i18n';
2426

src/components/Notifications.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
{{ t('notificationTime.description') }}
3333
</p>
3434
<ListWithTimeComponent :type="ListWithTime.Notifications" />
35+
<PromoClearYouTube />
3536
</div>
3637
<div class="settings-item">
3738
<label class="setting-header">{{ t('notificationMessage.message') }}</label>
@@ -73,6 +74,7 @@ import {
7374
import { convertHHMMToSeconds, convertSecondsToHHMM } from '../utils/converter';
7475
import { Time } from '../utils/time';
7576
import ListWithTimeComponent from '../components/ListWithTime.vue';
77+
import PromoClearYouTube from '../components/PromoClearYouTube.vue';
7678
import { ListWithTime } from '../utils/enums';
7779
import Browser from 'webextension-polyfill';
7880
import { Messages } from '../utils/messages';

src/components/PromoClearYouTube.vue

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<template>
22
<div class="review-block" v-if="showReview && canShowPromo">
33
<p>{{ t('promoClearYoutube.message') }}</p>
4-
<img height="15" src="../assets/icons/close.svg" @click="closeBlock()" />
5-
<input type="button" :value="t('promoClearYoutube.description')" @click="openStore()" />
4+
<div class="btn-block">
5+
<img height="15" src="../assets/icons/close.svg" @click="closeBlock()" />
6+
<input type="button" :value="t('promoClearYoutube.description')" @click="openStore()" />
7+
</div>
68
</div>
79
</template>
810

@@ -13,52 +15,59 @@ export default {
1315
</script>
1416

1517
<script lang="ts" setup>
16-
import { computed, ref } from 'vue';
18+
import { ref } from 'vue';
1719
import { useI18n } from 'vue-i18n';
1820
import { injecStorage } from '../storage/inject-storage';
1921
import { StorageParams } from '../storage/storage-params';
2022
import { CHROME_STORE_CLEAR_YOUTUBE_URL } from '../utils/chrome-url';
2123
import { usePromoExtension } from '../compositions/usePromoExtension';
24+
import { computedAsync } from '@vueuse/core';
2225
2326
const { t } = useI18n();
2427
2528
const settingsStorage = injecStorage();
26-
const showReview = ref<boolean>();
29+
const showReview = ref<boolean>(true);
2730
28-
const canShowPromo = computed(async () => await usePromoExtension());
31+
const canShowPromo = computedAsync(async () => await usePromoExtension());
2932
3033
async function closeBlock() {
3134
showReview.value = false;
3235
await settingsStorage.saveValue(StorageParams.PROMO_CLEAR_YOUTUBE, true);
3336
}
3437
3538
async function openStore() {
39+
showReview.value = false;
3640
window.open(CHROME_STORE_CLEAR_YOUTUBE_URL, '_blank');
3741
await settingsStorage.saveValue(StorageParams.PROMO_CLEAR_YOUTUBE, true);
3842
}
3943
</script>
4044

4145
<style scoped>
4246
.review-block {
43-
width: -webkit-fill-available;
44-
position: fixed;
45-
bottom: 0;
46-
padding: 8px 20px;
47+
margin: 20px 0 20px 0;
48+
padding: 10px;
4749
font-size: 14px;
4850
background-color: #efefef;
51+
border-radius: 10px;
52+
min-width: 655px;
53+
}
54+
.review-block .btn-block {
55+
margin: 8px 5px 0 0;
56+
vertical-align: top;
57+
float: right;
4958
}
5059
.review-block input[type='button'] {
51-
margin: 0 20px 0 0;
5260
float: right;
5361
width: auto;
5462
}
5563
.review-block p {
5664
display: inline-block;
57-
margin: 8px;
58-
font-size: 17px;
65+
margin: 0 10px;
66+
font-size: 16px;
67+
width: 70%;
5968
}
6069
.review-block img {
61-
padding: 9px 0 0 0;
70+
margin-left: 8px;
6271
cursor: pointer;
6372
float: right;
6473
}

src/pages/Dashboard.vue

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343
>
4444

4545
<div class="settings-content">
46-
<WhiteList v-if="selectedTab == SettingsTab.WhiteList" />
46+
<div class="main">
47+
<WhiteList v-if="selectedTab == SettingsTab.WhiteList" />
48+
</div>
4749
</div>
4850
</div>
4951

@@ -62,7 +64,9 @@
6264
>
6365

6466
<div class="settings-content">
65-
<Limits v-if="selectedTab == SettingsTab.Limits" />
67+
<div class="main">
68+
<Limits v-if="selectedTab == SettingsTab.Limits" />
69+
</div>
6670
</div>
6771
</div>
6872
<div class="settings-tab">
@@ -80,7 +84,9 @@
8084
>
8185

8286
<div class="settings-content">
83-
<DailyNotifications v-if="selectedTab == SettingsTab.Notifications" />
87+
<div class="main">
88+
<DailyNotifications v-if="selectedTab == SettingsTab.Notifications" />
89+
</div>
8490
</div>
8591
</div>
8692

@@ -99,7 +105,9 @@
99105
>
100106

101107
<div class="settings-content">
102-
<GeneralSettings v-if="selectedTab == SettingsTab.GeneralSettings" />
108+
<div class="main">
109+
<GeneralSettings v-if="selectedTab == SettingsTab.GeneralSettings" />
110+
</div>
103111
</div>
104112
</div>
105113

@@ -118,7 +126,9 @@
118126
>
119127

120128
<div class="settings-content">
121-
<About v-if="selectedTab == SettingsTab.About" />
129+
<div class="main">
130+
<About v-if="selectedTab == SettingsTab.About" />
131+
</div>
122132
</div>
123133
</div>
124134
</div>
@@ -167,6 +177,10 @@ function selectTab(value: SettingsTab) {
167177
</script>
168178

169179
<style scoped>
180+
.main {
181+
width: 80%;
182+
margin: auto;
183+
}
170184
.header-block .title {
171185
vertical-align: top;
172186
margin-top: 15px;

0 commit comments

Comments
 (0)