Skip to content

Commit 5076f2a

Browse files
committed
feat(settings): adds link settings card
1 parent b7d7ede commit 5076f2a

16 files changed

+550
-41
lines changed

src/components/common/buttons/TagLink.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const onClick = (e: MouseEvent) => {
2828
<template>
2929
<a
3030
:href="tag?.url"
31-
:title="tag?.title"
31+
:title="tag?.title ?? tag?.url"
3232
:data-tag="JSON.stringify(tag)"
3333
@click="onClick"
3434
>

src/components/container/ContainerComponent.ce.vue

+11
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,17 @@ const root = ref<HTMLElement>();
139139
}
140140
}
141141
142+
.n-popover.n-popconfirm {
143+
@include mixin.hover-background-only(
144+
$from: var(--bg-color-80),
145+
$to: var(--bg-color-90)
146+
);
147+
}
148+
149+
.n-popconfirm .n-popconfirm__action {
150+
justify-content: space-around;
151+
}
152+
142153
.n-notification-container .n-notification,
143154
.n-message-wrapper .n-message,
144155
.n-dropdown-menu,

src/components/icons/IconConfirm.vue

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<template>
2+
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
3+
<path
4+
fill="none"
5+
stroke="currentColor"
6+
stroke-dasharray="24"
7+
stroke-dashoffset="24"
8+
stroke-linecap="round"
9+
stroke-linejoin="round"
10+
stroke-width="2"
11+
d="M5 11L11 17L21 7"
12+
>
13+
<animate fill="freeze" attributeName="stroke-dashoffset" dur="0.4s" values="24;0" />
14+
</path>
15+
</svg>
16+
</template>

src/components/icons/IconPlus.vue

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<template>
2+
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
3+
<g
4+
fill="none"
5+
stroke="currentColor"
6+
stroke-dasharray="18"
7+
stroke-dashoffset="18"
8+
stroke-linecap="round"
9+
stroke-width="2"
10+
>
11+
<path d="M12 5V19">
12+
<animate
13+
fill="freeze"
14+
attributeName="stroke-dashoffset"
15+
begin="0.4s"
16+
dur="0.3s"
17+
values="18;0"
18+
/>
19+
</path>
20+
<path d="M5 12H19">
21+
<animate
22+
fill="freeze"
23+
attributeName="stroke-dashoffset"
24+
dur="0.3s"
25+
values="18;0"
26+
/>
27+
</path>
28+
</g>
29+
</svg>
30+
</template>

src/components/views/panel/MoviePanelDetails.vue

+22-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ import PanelAlias from '~/components/views/panel/PanelAlias.vue';
88
import PanelDetail from '~/components/views/panel/PanelDetail.vue';
99
1010
import PanelLinks from '~/components/views/panel/PanelLinks.vue';
11+
import { useLinksStore } from '~/stores/settings/links.store';
1112
import { useI18n } from '~/utils';
12-
import { capitalizeEachWord } from '~/utils/string.utils';
13+
import { capitalizeEachWord, deCapitalise } from '~/utils/string.utils';
1314
1415
const props = defineProps({
1516
movie: {
@@ -68,6 +69,12 @@ const country = computed(() => {
6869
if (!movie?.value) return;
6970
return movie.value?.country || '-';
7071
});
72+
73+
const { getAlias } = useLinksStore();
74+
const movieId = computed(() => movie?.value?.ids?.trakt.toString());
75+
const alias = getAlias('show', movieId);
76+
const movieAlias = computed(() => alias.value || movie?.value?.title);
77+
const movieTitle = computed(() => deCapitalise(movie?.value?.title));
7178
</script>
7279

7380
<template>
@@ -111,14 +118,15 @@ const country = computed(() => {
111118
:label="i18n('status')"
112119
:value="status"
113120
:skeleton="{ width: '7.5rem' }"
121+
grow
114122
/>
115123
</NFlex>
116124

117125
<!-- Movie name alias -->
118126
<PanelAlias
119127
:id="movie?.ids?.trakt.toString()"
120128
scope="movie"
121-
:placeholder="movie?.title"
129+
:placeholder="movieTitle"
122130
/>
123131

124132
<NFlex class="lists" vertical size="large">
@@ -131,7 +139,12 @@ const country = computed(() => {
131139
/>
132140

133141
<!-- links -->
134-
<PanelLinks :ids="movie?.ids" mode="movie" :title="movie?.title" />
142+
<PanelLinks
143+
:ids="movie?.ids"
144+
mode="movie"
145+
:title="movieTitle"
146+
:alias="movieAlias"
147+
/>
135148
</NFlex>
136149
</NFlex>
137150
</template>
@@ -146,4 +159,10 @@ const country = computed(() => {
146159
.lists {
147160
margin: 0.25rem 0 1.25rem;
148161
}
162+
163+
@media (width < 700px) {
164+
.row {
165+
gap: 0.75rem 0.5rem !important;
166+
}
167+
}
149168
</style>

src/components/views/panel/PersonPanelDetails.vue

+7
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ const socials = computed(() => {
128128
:label="i18n('death')"
129129
:value="death"
130130
:skeleton="{ width: '5.125rem' }"
131+
grow
131132
/>
132133
</NFlex>
133134

@@ -169,4 +170,10 @@ const socials = computed(() => {
169170
.lists {
170171
margin: 1.5rem 0 0.5rem;
171172
}
173+
174+
@media (width < 700px) {
175+
.row {
176+
gap: 0.75rem 0.5rem !important;
177+
}
178+
}
172179
</style>

src/components/views/panel/ShowPanelDetails.vue

+15-10
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,14 @@ const ids = computed(() => {
136136
return show.value?.ids;
137137
});
138138
139-
const title = computed(() =>
140-
deCapitalise(episode?.value?.title ?? season?.value?.title ?? show?.value?.title),
141-
);
142-
143139
const { getAlias } = useLinksStore();
144140
const showId = computed(() => show?.value?.ids?.trakt.toString());
145141
const alias = getAlias('show', showId);
142+
const showAlias = computed(() => alias.value || show?.value?.title);
143+
const showTitle = computed(() => deCapitalise(show?.value?.title));
144+
const title = computed(() =>
145+
deCapitalise(episode?.value?.title ?? season?.value?.title ?? show?.value?.title),
146+
);
146147
</script>
147148

148149
<template>
@@ -186,6 +187,7 @@ const alias = getAlias('show', showId);
186187
<PanelDetail
187188
:label="i18n('status')"
188189
:value="status"
190+
grow
189191
:skeleton="{ width: '7.5rem' }"
190192
/>
191193
</NFlex>
@@ -211,16 +213,13 @@ const alias = getAlias('show', showId);
211213
v-if="mode === 'episode'"
212214
:label="i18n('type')"
213215
:value="episodeType"
216+
grow
214217
:skeleton="{ width: '6.25rem' }"
215218
/>
216219
</NFlex>
217220

218221
<!-- Show name alias -->
219-
<PanelAlias
220-
:id="show?.ids?.trakt.toString()"
221-
scope="show"
222-
:placeholder="show?.title"
223-
/>
222+
<PanelAlias :id="showId" scope="show" :placeholder="showTitle" />
224223

225224
<NFlex class="lists" vertical size="large">
226225
<!-- Genres -->
@@ -237,7 +236,7 @@ const alias = getAlias('show', showId);
237236
:mode="mode"
238237
:season="episode?.season ?? season?.number"
239238
:episode="episode?.number"
240-
:alias="alias"
239+
:alias="showAlias"
241240
:title="title"
242241
/>
243242
</NFlex>
@@ -254,4 +253,10 @@ const alias = getAlias('show', showId);
254253
.lists {
255254
margin: 0.25rem 0 0.5rem;
256255
}
256+
257+
@media (width < 700px) {
258+
.row {
259+
gap: 0.75rem 0.5rem !important;
260+
}
261+
}
257262
</style>

src/components/views/settings/SettingsComponent.vue

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<script lang="ts" setup>
22
import { NAnchor, NAnchorLink, NCard, NLayout, NLayoutSider } from 'naive-ui';
33
4-
import { onDeactivated, type Ref, ref } from 'vue';
4+
import { type Component, onDeactivated, type Ref, ref } from 'vue';
5+
6+
import SettingsLinks from '~/components/views/settings/SettingsLinks.vue';
57
68
import { useI18n } from '~/utils';
79
@@ -10,14 +12,15 @@ const i18n = useI18n('settings');
1012
type Section = {
1113
title: string;
1214
reference: Ref<[InstanceType<typeof NCard>] | undefined>;
15+
component?: Component;
1316
};
1417
1518
const sections: Section[] = [
1619
{ title: 'menu__account', reference: ref() },
17-
{ title: 'menu__cache', reference: ref() },
1820
{ title: 'menu__tabs', reference: ref() },
21+
{ title: 'menu__links', reference: ref(), component: SettingsLinks },
22+
{ title: 'menu__cache', reference: ref() },
1923
{ title: 'menu__logs', reference: ref() },
20-
{ title: 'menu__links', reference: ref() },
2124
];
2225
2326
const focus = ref();
@@ -78,17 +81,18 @@ onDeactivated(() => {
7881
}"
7982
>
8083
<NCard
81-
v-for="section in sections"
84+
v-for="(section, index) in sections"
8285
:id="section.title"
8386
:ref="section.reference"
8487
:key="section.title"
8588
class="card"
8689
:class="{ target: focus?.title === section.title }"
90+
:style="{ '--index': sections.length - index }"
8791
:title="i18n(section.title)"
8892
@mouseenter="onEnter(section)"
8993
@mouseleave="onLeave(section)"
9094
>
91-
card Content
95+
<component :is="section.component" />
9296
</NCard>
9397
</NLayout>
9498
</NLayout>
@@ -107,6 +111,7 @@ onDeactivated(() => {
107111
.card {
108112
@include mixin.hover-background($from: var(--bg-black-50), $to: var(--bg-color-80));
109113
114+
z-index: var(--index);
110115
min-height: 20rem;
111116
112117
&:not(:last-child) {

0 commit comments

Comments
 (0)