Skip to content

Commit 761167d

Browse files
committed
fix(panel): remove checkin and fix sizing
1 parent bc99faf commit 761167d

File tree

6 files changed

+58
-111
lines changed

6 files changed

+58
-111
lines changed

src/components/views/panel/MoviePanelButtons.vue

+10-44
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
<script lang="ts" setup>
2-
import { NButton, NFlex, NIcon } from 'naive-ui';
2+
import { NFlex } from 'naive-ui';
33
import { computed, onMounted, type PropType, ref, toRefs } from 'vue';
44
55
import IconCheckedList from '~/components/icons/IconCheckedList.vue';
6-
import IconCloseSmall from '~/components/icons/IconCloseSmall.vue';
76
import IconGrid from '~/components/icons/IconGrid.vue';
87
import IconGridEmpty from '~/components/icons/IconGridEmpty.vue';
98
import IconListEmpty from '~/components/icons/IconListEmpty.vue';
109
import IconPlay from '~/components/icons/IconPlay.vue';
1110
import IconPlayFilled from '~/components/icons/IconPlayFilled.vue';
12-
13-
import IconTrakt from '~/components/icons/IconTrakt.vue';
1411
import PanelButtonProgress from '~/components/views/panel/PanelButtonProgress.vue';
1512
import { usePanelButtons } from '~/components/views/panel/use-panel-buttons';
1613
import {
@@ -38,18 +35,6 @@ const props = defineProps({
3835
type: Boolean,
3936
required: false,
4037
},
41-
checkin: {
42-
type: Boolean,
43-
required: false,
44-
},
45-
checkinProgress: {
46-
type: Number,
47-
required: false,
48-
},
49-
checkinLoading: {
50-
type: Boolean,
51-
required: false,
52-
},
5338
activeLists: {
5439
type: Array as PropType<ListEntity['id'][]>,
5540
required: false,
@@ -104,23 +89,6 @@ onMounted(() => {
10489

10590
<template>
10691
<div ref="root" class="panel-buttons">
107-
<!-- Checkin -->
108-
<NFlex class="button-container checkin" justify="center" align="center">
109-
<NButton round :secondary="!checkin" type="error" :disabled="checkinLoading">
110-
<template #icon>
111-
<NIcon
112-
class="button-icon"
113-
:component="checkin ? IconCloseSmall : IconTrakt"
114-
:style="{
115-
'--trakt-icon-path': 'var(--color-error-lighter)',
116-
'--trakt-icon-circle': 'transparent',
117-
}"
118-
/>
119-
</template>
120-
<span>{{ i18n(`label__${ checkin ? 'cancel_checkin' : 'checkin' }`) }}</span>
121-
</NButton>
122-
</NFlex>
123-
12492
<!-- List -->
12593
<NFlex class="button-container list" justify="center" align="center">
12694
<PanelButtonProgress
@@ -176,7 +144,7 @@ onMounted(() => {
176144
.panel-buttons {
177145
display: flex;
178146
flex-wrap: wrap;
179-
gap: 1.25rem 1rem;
147+
gap: 1.25rem 1.5rem;
180148
align-items: center;
181149
justify-content: center;
182150
width: 100%;
@@ -187,25 +155,23 @@ onMounted(() => {
187155
margin-left: calc(0% - var(--n-icon-margin));
188156
}
189157
190-
&.history,
158+
&.history {
159+
min-width: 10.125rem;
160+
}
161+
191162
&.collection {
192-
min-width: 12.5rem;
163+
min-width: 11.375rem;
193164
}
194165
195-
&.checkin,
196166
&.list {
197-
min-width: 10rem;
167+
min-width: 8.875rem;
198168
}
199169
}
200170
}
201171
202-
@media (width <= 800px) {
172+
@media (width > 800px) {
203173
.panel-buttons {
204-
width: 80%;
205-
206-
.button-container {
207-
flex: 1 1 40%;
208-
}
174+
gap: 1.25rem 3rem;
209175
}
210176
}
211177
</style>

src/components/views/panel/MoviePanelDetails.vue

+18-15
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ const releasedDate = computed(() => {
3636
const releasedTime = computed(() => {
3737
if (!released.value) return;
3838
if (typeof released.value === 'string') return released.value;
39-
return released.value.toLocaleTimeString();
39+
return released.value.toLocaleTimeString(navigator.language, {
40+
hour: '2-digit',
41+
minute: '2-digit',
42+
});
4043
});
4144
4245
const runtime = computed(() => {
@@ -69,6 +72,13 @@ const country = computed(() => {
6972
<template>
7073
<NFlex size="large" class="container" vertical>
7174
<NFlex class="row" size="large">
75+
<!-- Release date -->
76+
<PanelDetail
77+
:label="i18n('released')"
78+
:value="releasedDate"
79+
:skeleton="{ width: '5.125rem' }"
80+
/>
81+
7282
<!-- Year -->
7383
<PanelDetail :label="i18n('year')" :value="year" :skeleton="{ width: '2.25rem' }" />
7484

@@ -78,23 +88,9 @@ const country = computed(() => {
7888
:value="country"
7989
:skeleton="{ width: '2ch' }"
8090
/>
81-
82-
<!-- Status -->
83-
<PanelDetail
84-
:label="i18n('status')"
85-
:value="status"
86-
:skeleton="{ width: '7.5rem' }"
87-
/>
8891
</NFlex>
8992

9093
<NFlex class="row" size="large">
91-
<!-- Release date -->
92-
<PanelDetail
93-
:label="i18n('released_date')"
94-
:value="releasedDate"
95-
:skeleton="{ width: '5.125rem' }"
96-
/>
97-
9894
<!-- Release Time -->
9995
<PanelDetail
10096
:label="i18n('released_time')"
@@ -108,6 +104,13 @@ const country = computed(() => {
108104
:value="runtime"
109105
:skeleton="{ width: '3.75rem' }"
110106
/>
107+
108+
<!-- Status -->
109+
<PanelDetail
110+
:label="i18n('status')"
111+
:value="status"
112+
:skeleton="{ width: '7.5rem' }"
113+
/>
111114
</NFlex>
112115

113116
<NFlex class="lists" vertical size="large">

src/components/views/panel/PanelDetail.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const { openTab } = useExtensionSettingsStore();
7171
}
7272
7373
.detail {
74-
flex: 0 1 30%;
74+
flex: 0 1 31.5%;
7575
7676
&:hover .prefix {
7777
color: var(--white-70);

src/components/views/panel/ShowPanelButtons.vue

+10-43
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
<script lang="ts" setup>
2-
import { NButton, NFlex, NIcon } from 'naive-ui';
2+
import { NFlex } from 'naive-ui';
33
import { computed, onMounted, type PropType, ref, toRefs } from 'vue';
44
55
import IconCheckedList from '~/components/icons/IconCheckedList.vue';
6-
import IconCloseSmall from '~/components/icons/IconCloseSmall.vue';
76
import IconGrid from '~/components/icons/IconGrid.vue';
87
import IconGridEmpty from '~/components/icons/IconGridEmpty.vue';
98
import IconListEmpty from '~/components/icons/IconListEmpty.vue';
109
import IconPlay from '~/components/icons/IconPlay.vue';
1110
import IconPlayFilled from '~/components/icons/IconPlayFilled.vue';
12-
import IconTrakt from '~/components/icons/IconTrakt.vue';
1311
import PanelButtonProgress from '~/components/views/panel/PanelButtonProgress.vue';
1412
1513
import { usePanelButtons } from '~/components/views/panel/use-panel-buttons';
@@ -48,18 +46,6 @@ const props = defineProps({
4846
type: Boolean,
4947
required: false,
5048
},
51-
checkin: {
52-
type: Boolean,
53-
required: false,
54-
},
55-
checkinProgress: {
56-
type: Number,
57-
required: false,
58-
},
59-
checkinLoading: {
60-
type: Boolean,
61-
required: false,
62-
},
6349
activeLists: {
6450
type: Array as PropType<ListEntity['id'][]>,
6551
required: false,
@@ -146,23 +132,6 @@ onMounted(() => {
146132

147133
<template>
148134
<div ref="root" class="panel-buttons">
149-
<!-- Checkin -->
150-
<NFlex class="button-container checkin" justify="center" align="center">
151-
<NButton round :secondary="!checkin" type="error" :disabled="checkinLoading">
152-
<template #icon>
153-
<NIcon
154-
class="button-icon"
155-
:component="checkin ? IconCloseSmall : IconTrakt"
156-
:style="{
157-
'--trakt-icon-path': 'var(--color-error-lighter)',
158-
'--trakt-icon-circle': 'transparent',
159-
}"
160-
/>
161-
</template>
162-
<span>{{ i18n(`label__${ checkin ? 'cancel_checkin' : 'checkin' }`) }}</span>
163-
</NButton>
164-
</NFlex>
165-
166135
<!-- List -->
167136
<NFlex class="button-container list" justify="center" align="center">
168137
<PanelButtonProgress
@@ -229,7 +198,7 @@ onMounted(() => {
229198
.panel-buttons {
230199
display: flex;
231200
flex-wrap: wrap;
232-
gap: 1.25rem 1rem;
201+
gap: 1.25rem 1.5rem;
233202
align-items: center;
234203
justify-content: center;
235204
width: 100%;
@@ -240,25 +209,23 @@ onMounted(() => {
240209
margin-left: calc(0% - var(--n-icon-margin));
241210
}
242211
243-
&.history,
212+
&.history {
213+
min-width: 10.125rem;
214+
}
215+
244216
&.collection {
245-
min-width: 12.5rem;
217+
min-width: 11.375rem;
246218
}
247219
248-
&.checkin,
249220
&.list {
250-
min-width: 10rem;
221+
min-width: 8.875rem;
251222
}
252223
}
253224
}
254225
255-
@media (width <= 800px) {
226+
@media (width > 800px) {
256227
.panel-buttons {
257-
width: 80%;
258-
259-
.button-container {
260-
flex: 1 1 40%;
261-
}
228+
gap: 1.25rem 3rem;
262229
}
263230
}
264231
</style>

src/components/views/panel/ShowPanelDetails.vue

+5-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ const airedDate = computed(() => {
6161
const airedTime = computed(() => {
6262
if (!aired.value) return;
6363
if (typeof aired.value === 'string') return '-';
64-
return aired.value.toLocaleTimeString();
64+
return aired.value.toLocaleTimeString(navigator.language, {
65+
hour: '2-digit',
66+
minute: '2-digit',
67+
});
6568
});
6669
6770
const runtime = computed(() => {
@@ -157,7 +160,7 @@ const ids = computed(() => {
157160
<NFlex class="row" size="large">
158161
<!-- Air date -->
159162
<PanelDetail
160-
:label="i18n('aired_date')"
163+
:label="i18n('aired')"
161164
:value="airedDate"
162165
:skeleton="{ width: '5.125rem' }"
163166
/>

src/i18n/en/panel/panel-buttons.json

+14-6
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,27 @@
1212
"description": "Label for the cancel button in the checkin panel"
1313
},
1414
"panel__buttons__label__history__add": {
15-
"message": "Add to my History",
15+
"message": "Add to History",
1616
"description": "Label for the add to history button in the panel"
1717
},
1818
"panel__buttons__label__history__remove": {
19-
"message": "Remove from History",
19+
"message": "Remove History",
2020
"description": "Label for the remove from history button in the panel"
2121
},
2222
"panel__buttons__label__collection__add": {
23-
"message": "Add to my Collection",
23+
"message": "Add to Collection",
2424
"description": "Label for the add to collection button in the panel"
2525
},
2626
"panel__buttons__label__collection__remove": {
27-
"message": "Remove from Collection",
27+
"message": "Remove Collection",
2828
"description": "Label for the remove from collection button in the panel"
2929
},
3030
"panel__buttons__label__list__add": {
31-
"message": "Add to my List",
31+
"message": "Add to Lists",
3232
"description": "Label for the add to list button in the panel"
3333
},
3434
"panel__buttons__label__list__update": {
35-
"message": "Update my Lists",
35+
"message": "Update Lists",
3636
"description": "Label for the update lists button in the panel"
3737
},
3838
"panel__buttons__label__now": {
@@ -58,5 +58,13 @@
5858
"panel__buttons__label__cancel": {
5959
"message": "Cancel",
6060
"description": "Label for the cancel button in the checkin panel"
61+
},
62+
"panel__buttons__label__collected": {
63+
"message": "Collected",
64+
"description": "Label for the collected button in the checkin panel"
65+
},
66+
"panel__buttons__label__watched": {
67+
"message": "Watched",
68+
"description": "Label for the watched button in the checkin panel"
6169
}
6270
}

0 commit comments

Comments
 (0)