Skip to content

Commit dcc2be7

Browse files
committed
fix(pwa): adds bottom inset to footer
1 parent 125b740 commit dcc2be7

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

src/components/views/checkin/CheckinComponent.vue

+26-8
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
useCancelWatching,
1818
useWatchingProgress,
1919
} from '~/utils/watching.utils';
20+
import { watchMedia } from '~/utils/window.utils';
2021
2122
defineProps({
2223
parentElement: {
@@ -30,13 +31,19 @@ const i18n = useI18n('watching');
3031
const { isWatching, watching, cancelling } = useWatchingStoreRefs();
3132
const { cancel } = useWatchingStore();
3233
34+
const isTiny = watchMedia('(max-width: 600px)');
35+
3336
const icon = computed(() => (watching.value?.type === 'movie' ? IconMovie : IconScreen));
3437
const title = computed(() => {
3538
if (!watching.value) return '';
3639
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+
}
3844
return '';
3945
});
46+
4047
const subtitle = computed(() => {
4148
if (!watching.value) return '';
4249
if (isWatchingMovie(watching.value)) return watching.value.movie.year;
@@ -47,11 +54,13 @@ const subtitle = computed(() => {
4754
const episode = computed(() => {
4855
if (!watching.value) return '';
4956
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(
5160
'episode',
5261
'common',
5362
'tag',
54-
)} ${watching.value.episode.number}`;
63+
)} ${number}`;
5564
});
5665
5766
const {
@@ -125,14 +134,14 @@ const onClick = () => {
125134
<div class="column">
126135
<div class="top">
127136
<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>
130139
<template v-if="episode">
131140
<span class="text tertiary">—</span>
132141
<span class="text secondary">{{ episode }}</span>
133142
</template>
134143
</div>
135-
<div class="bottom">
144+
<div v-if="!isTiny" class="bottom">
136145
<span class="tertiary">
137146
{{ type }} {{ action }} {{ i18n('at') }} {{ started }}
138147
</span>
@@ -141,8 +150,8 @@ const onClick = () => {
141150
</span>
142151
<span class="right">
143152
<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>
146155
<NTooltip :show-arrow="false" :delay="260" :to="parentElement">
147156
<span> {{ i18n('cancel', 'common', 'button') }} </span>
148157
<template #trigger>
@@ -168,6 +177,7 @@ const onClick = () => {
168177
<style lang="scss" scoped>
169178
@use '~/styles/mixin' as mixin;
170179
@use '~/styles/z-index' as layers;
180+
@use '~/styles/layout' as layout;
171181
172182
.wrapper {
173183
position: relative;
@@ -201,8 +211,10 @@ const onClick = () => {
201211
align-items: center;
202212
justify-content: space-between;
203213
height: 0;
214+
padding-bottom: layout.$safe-area-inset-bottom;
204215
overflow: hidden;
205216
color: var(--white-70);
217+
text-wrap: balance;
206218
cursor: pointer;
207219
208220
.left,
@@ -343,5 +355,11 @@ const onClick = () => {
343355
}
344356
}
345357
}
358+
359+
@media (width <= 600px) {
360+
.compact {
361+
display: none;
362+
}
363+
}
346364
}
347365
</style>

0 commit comments

Comments
 (0)