@@ -9,6 +9,7 @@ import IconListEmpty from '~/components/icons/IconListEmpty.vue';
9
9
import IconPlay from ' ~/components/icons/IconPlay.vue' ;
10
10
import IconPlayFilled from ' ~/components/icons/IconPlayFilled.vue' ;
11
11
import PanelButtonProgress from ' ~/components/views/panel/PanelButtonProgress.vue' ;
12
+ import PanelSelectProgress from ' ~/components/views/panel/PanelSelectProgress.vue' ;
12
13
import {
13
14
PanelButtonsOption ,
14
15
type PanelButtonsOptions ,
@@ -51,15 +52,29 @@ const props = defineProps({
51
52
type: Boolean ,
52
53
required: false ,
53
54
},
55
+ watching: {
56
+ type: Boolean ,
57
+ required: false ,
58
+ },
59
+ watchProgress: {
60
+ type: Number ,
61
+ required: false ,
62
+ },
63
+ checkinLoading: {
64
+ type: Boolean ,
65
+ required: false ,
66
+ },
54
67
});
55
68
56
69
const emit = defineEmits <{
57
70
(e : ' onListUpdate' , value : ListEntity [' id' ], remove : boolean ): void ;
58
71
(e : ' onCollectionUpdate' , value : PanelButtonsOptions , date ? : number ): void ;
59
72
(e : ' onWatchedUpdate' , value : PanelButtonsOptions , date ? : number ): void ;
73
+ (e : ' onCheckin' , cancel : boolean ): void ;
60
74
}>();
61
75
62
- const { watched, collected, activeLoading, activeLists, hasRelease } = toRefs (props );
76
+ const { watched, collected, activeLoading, activeLists, hasRelease, watching } =
77
+ toRefs (props );
63
78
64
79
const onListUpdate = (value : ListEntity [' id' ] | ListEntity [' id' ][]) => {
65
80
const newList = Array .isArray (value ) ? value : [value ];
@@ -123,16 +138,16 @@ const listOptions = computed(
123
138
})),
124
139
);
125
140
126
- onMounted (( ) => {
127
- fetchLists ();
128
- } );
141
+ const onCheckin = ( ) => emit ( ' onCheckin ' , watching . value );
142
+
143
+ onMounted (() => fetchLists () );
129
144
</script >
130
145
131
146
<template >
132
147
<div ref =" root" class =" panel-buttons" >
133
148
<!-- List -->
134
149
<NFlex class =" button-container list" justify =" center" align =" center" >
135
- <PanelButtonProgress
150
+ <PanelSelectProgress
136
151
:options =" listOptions"
137
152
:value =" activeLists"
138
153
:select =" {
@@ -157,12 +172,12 @@ onMounted(() => {
157
172
</NFlex >
158
173
</template >
159
174
{{ i18n(`label__list__${ activeLists?.length ? 'update' : 'add' }`) }}
160
- </PanelButtonProgress >
175
+ </PanelSelectProgress >
161
176
</NFlex >
162
177
163
178
<!-- Collection -->
164
179
<NFlex class =" button-container collection" justify =" center" align =" center" >
165
- <PanelButtonProgress
180
+ <PanelSelectProgress
166
181
:select =" {
167
182
options: collectionOptions,
168
183
}"
@@ -173,12 +188,12 @@ onMounted(() => {
173
188
@on-select =" onCollectionUpdate"
174
189
>
175
190
{{ i18n(`label__collection__${ collected ? 'remove' : 'add' }`) }}
176
- </PanelButtonProgress >
191
+ </PanelSelectProgress >
177
192
</NFlex >
178
193
179
194
<!-- History -->
180
195
<NFlex class =" button-container history" justify =" center" align =" center" >
181
- <PanelButtonProgress
196
+ <PanelSelectProgress
182
197
:select =" {
183
198
options: watchedOptions,
184
199
}"
@@ -188,6 +203,18 @@ onMounted(() => {
188
203
@on-select =" onWatchedUpdate"
189
204
>
190
205
{{ i18n(`label__history__${ watched ? 'remove' : 'add' }`) }}
206
+ </PanelSelectProgress >
207
+ </NFlex >
208
+
209
+ <!-- Check-in -->
210
+ <NFlex class =" button-container checkin" justify =" center" align =" center" >
211
+ <PanelButtonProgress
212
+ :filled =" watching"
213
+ :percentage =" watchProgress"
214
+ :loading =" checkinLoading"
215
+ @click =" onCheckin"
216
+ >
217
+ {{ i18n('checkin', 'common', 'button') }}
191
218
</PanelButtonProgress >
192
219
</NFlex >
193
220
</div >
@@ -207,18 +234,6 @@ onMounted(() => {
207
234
i {
208
235
margin-left : calc (0% - var (--n-icon-margin ));
209
236
}
210
-
211
- & .history {
212
- min-width : 10.125rem ;
213
- }
214
-
215
- & .collection {
216
- min-width : 11.375rem ;
217
- }
218
-
219
- & .list {
220
- min-width : 8.875rem ;
221
- }
222
237
}
223
238
}
224
239
@@ -227,4 +242,10 @@ onMounted(() => {
227
242
gap : 1.25rem 3rem ;
228
243
}
229
244
}
245
+
246
+ @media (width < 660px ) {
247
+ .button-container {
248
+ min-width : 45% ;
249
+ }
250
+ }
230
251
</style >
0 commit comments