@@ -17,6 +17,7 @@ import {
17
17
useCancelWatching ,
18
18
useWatchingProgress ,
19
19
} from ' ~/utils/watching.utils' ;
20
+ import { watchMedia } from ' ~/utils/window.utils' ;
20
21
21
22
defineProps ({
22
23
parentElement: {
@@ -30,13 +31,19 @@ const i18n = useI18n('watching');
30
31
const { isWatching, watching, cancelling } = useWatchingStoreRefs ();
31
32
const { cancel } = useWatchingStore ();
32
33
34
+ const isTiny = watchMedia (' (max-width: 600px)' );
35
+
33
36
const icon = computed (() => (watching .value ?.type === ' movie' ? IconMovie : IconScreen ));
34
37
const title = computed (() => {
35
38
if (! watching .value ) return ' ' ;
36
39
if (isWatchingMovie (watching .value )) return watching .value .movie .title ;
37
- if (isWatchingShow (watching .value )) return watching .value .episode .title ;
40
+ if (isWatchingShow (watching .value )) {
41
+ if (isTiny .value ) return watching .value .show .title ;
42
+ return watching .value .episode .title ;
43
+ }
38
44
return ' ' ;
39
45
});
46
+
40
47
const subtitle = computed (() => {
41
48
if (! watching .value ) return ' ' ;
42
49
if (isWatchingMovie (watching .value )) return watching .value .movie .year ;
@@ -47,11 +54,13 @@ const subtitle = computed(() => {
47
54
const episode = computed (() => {
48
55
if (! watching .value ) return ' ' ;
49
56
if (! isWatchingShow (watching .value )) return ' ' ;
50
- return ` ${i18n (' season' , ' common' , ' tag' )} ${watching .value .episode .season } ${i18n (
57
+ const { season, number } = watching .value .episode ;
58
+ if (! season || ! number ) return ' ' ;
59
+ return ` ${i18n (' season' , ' common' , ' tag' )} ${season } ${i18n (
51
60
' episode' ,
52
61
' common' ,
53
62
' tag' ,
54
- )} ${watching . value . episode . number } ` ;
63
+ )} ${number } ` ;
55
64
});
56
65
57
66
const {
@@ -125,14 +134,14 @@ const onClick = () => {
125
134
<div class =" column" >
126
135
<div class =" top" >
127
136
<span class =" text primary" >{{ title }}</span >
128
- <span class =" text tertiary" >—</span >
129
- <span class =" text secondary" >{{ subtitle }}</span >
137
+ <span class =" text tertiary compact " >—</span >
138
+ <span class =" text secondary compact " >{{ subtitle }}</span >
130
139
<template v-if =" episode " >
131
140
<span class =" text tertiary" >—</span >
132
141
<span class =" text secondary" >{{ episode }}</span >
133
142
</template >
134
143
</div >
135
- <div class =" bottom" >
144
+ <div v-if = " !isTiny " class =" bottom" >
136
145
<span class =" tertiary" >
137
146
{{ type }} {{ action }} {{ i18n('at') }} {{ started }}
138
147
</span >
@@ -141,8 +150,8 @@ const onClick = () => {
141
150
</span >
142
151
<span class =" right" >
143
152
<span class =" text secondary time" >{{ elapsed }}</span >
144
- <span class =" text tertiary" >/</span >
145
- <span class =" text secondary time" >{{ duration }}</span >
153
+ <span class =" text tertiary compact " >/</span >
154
+ <span class =" text secondary time compact " >{{ duration }}</span >
146
155
<NTooltip :show-arrow =" false" :delay =" 260" :to =" parentElement" >
147
156
<span > {{ i18n('cancel', 'common', 'button') }} </span >
148
157
<template #trigger >
@@ -168,6 +177,7 @@ const onClick = () => {
168
177
<style lang="scss" scoped>
169
178
@use ' ~/styles/mixin' as mixin ;
170
179
@use ' ~/styles/z-index' as layers ;
180
+ @use ' ~/styles/layout' as layout ;
171
181
172
182
.wrapper {
173
183
position : relative ;
@@ -201,8 +211,10 @@ const onClick = () => {
201
211
align-items : center ;
202
212
justify-content : space-between ;
203
213
height : 0 ;
214
+ padding-bottom : layout .$safe-area-inset-bottom ;
204
215
overflow : hidden ;
205
216
color : var (--white-70 );
217
+ text-wrap : balance ;
206
218
cursor : pointer ;
207
219
208
220
.left ,
@@ -343,5 +355,11 @@ const onClick = () => {
343
355
}
344
356
}
345
357
}
358
+
359
+ @media (width <= 600px ) {
360
+ .compact {
361
+ display : none ;
362
+ }
363
+ }
346
364
}
347
365
</style >
0 commit comments