Skip to content

Commit 1ad86b3

Browse files
committed
feat(router): create about route
1 parent 4c64f6d commit 1ad86b3

File tree

14 files changed

+63
-10
lines changed

14 files changed

+63
-10
lines changed

src/components/common/navbar/NavbarComponent.vue

+5-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ const activableRoutes = [...routes, Route.Settings];
4141
const activeRoute = computed(() => {
4242
const _name = route.name?.toString();
4343
if (!_name) return;
44-
return activableRoutes.find(r => r === _name) ?? routes.find(r => _name.startsWith(r));
44+
return (
45+
activableRoutes.find(r => r === _name) ??
46+
routes.find(r => _name.startsWith(r)) ??
47+
Route.Settings
48+
);
4549
});
4650
4751
const isHover = ref(false);

src/components/common/navbar/NavbarSettingsDopdown.vue

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { computed, defineProps, h, ref } from 'vue';
66
import { useRouter } from 'vue-router';
77
88
import type { DropdownProps } from 'naive-ui';
9+
910
import type { Component } from 'vue';
1011
1112
import type { ArrayElement } from '~/utils/typescript.utils';
@@ -14,6 +15,7 @@ import IconAccount from '~/components/icons/IconAccount.vue';
1415
import IconAccountAdd from '~/components/icons/IconAccountAdd.vue';
1516
import IconCog from '~/components/icons/IconCog.vue';
1617
import IconExternalLink from '~/components/icons/IconExternalLink.vue';
18+
import IconLightbulb from '~/components/icons/IconLightbulb.vue';
1719
import IconLogOut from '~/components/icons/IconLogOut.vue';
1820
1921
import { Route } from '~/router';
@@ -78,6 +80,7 @@ const toOption = (
7880
const options = computed<DropdownProps['options']>(() => {
7981
const baseOptions: DropdownProps['options'] = [
8082
toOption('settings', IconCog),
83+
toOption('about', IconLightbulb),
8184
{ type: 'divider', key: 'external-links' },
8285
toOption('trakt', IconExternalLink),
8386
{ type: 'divider', key: 'session-divider' },
@@ -108,10 +111,11 @@ const loadUser = async (account: string) => {
108111
};
109112
110113
const onSelect: DropdownProps['onSelect'] = async (key: string, { label }) => {
111-
console.info('Selected:', key);
112114
switch (key) {
113115
case 'settings':
114116
return router.push(Route.Settings);
117+
case 'about':
118+
return router.push(Route.About);
115119
case 'trakt':
116120
return createTab({
117121
url: ExternaLinks.trakt[TraktService.isStaging ? 'staging' : 'production'],
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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="46"
7+
stroke-dashoffset="46"
8+
stroke-linecap="round"
9+
stroke-linejoin="round"
10+
stroke-width="2"
11+
d="M12 17H9V14.1973C7.2066 13.1599 6 11.2208 6 9C6 5.68629 8.68629 3 12 3C15.3137 3 18 5.68629 18 9C18 11.2208 16.7934 13.1599 15 14.1973V17z"
12+
>
13+
<animate fill="freeze" attributeName="stroke-dashoffset" dur="0.4s" values="46;0" />
14+
</path>
15+
<rect width="6" height="0" x="9" y="20"
16+
fill="currentColor" rx="1">
17+
<animate
18+
fill="freeze"
19+
attributeName="height"
20+
begin="0.5s"
21+
dur="0.2s"
22+
values="0;2"
23+
/>
24+
</rect>
25+
</svg>
26+
</template>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<script lang="ts" setup>
2+
// TODO
3+
</script>
4+
5+
<template>
6+
<span>This is a about component</span>
7+
</template>
8+
9+
<style lang="scss" scoped>
10+
// TODO
11+
</style>

src/components/views/calendar/index.ts

-1
This file was deleted.

src/components/views/history/index.ts

-1
This file was deleted.

src/components/views/login/index.ts

-1
This file was deleted.

src/components/views/progress/index.ts

-1
This file was deleted.

src/components/views/settings/index.ts

-1
This file was deleted.

src/components/views/watchlist/index.ts

-1
This file was deleted.

src/i18n/en/navbar/navbar-settings.json

+4
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,9 @@
1414
"navbar__settings__trakt": {
1515
"message": "Trakt",
1616
"description": "Open trakt website."
17+
},
18+
"navbar__settings__about": {
19+
"message": "About",
20+
"description": "About page."
1721
}
1822
}

src/i18n/en/route/route.json

+4
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,9 @@
2222
"route__settings": {
2323
"message": "Settings",
2424
"description": "Settings and options route name"
25+
},
26+
"route__about": {
27+
"message": "About",
28+
"description": "About page route name"
2529
}
2630
}

src/router/routes.ts

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export enum Route {
77
Progress = 'progress',
88
Search = 'search',
99
Settings = 'settings',
10+
About = 'about',
1011
Login = 'login',
1112
}
1213

@@ -108,4 +109,9 @@ export const routes: RouteRecordRaw[] = [
108109
name: Route.Settings,
109110
component: () => import('../components/views/settings/SettingsComponent.vue'),
110111
},
112+
{
113+
path: `/${Route.About}`,
114+
name: Route.About,
115+
component: () => import('../components/views/about/AboutComponent.vue'),
116+
},
111117
];

src/services/trakt.service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ export class TraktService {
346346
show: {
347347
async watched(showId: string | number, cacheOption?: BaseCacheOption) {
348348
const response = await TraktService.traktClient.shows.progress.watched.cached(
349-
{ id: showId, specials: true, count_specials: false },
349+
{ id: showId, specials: true, count_specials: true },
350350
undefined,
351351
cacheOption,
352352
);
@@ -355,7 +355,7 @@ export class TraktService {
355355

356356
async collection(showId: string | number, cacheOption?: BaseCacheOption) {
357357
const response = await TraktService.traktClient.shows.progress.collection.cached(
358-
{ id: showId, specials: true, count_specials: false },
358+
{ id: showId, specials: true, count_specials: true },
359359
undefined,
360360
cacheOption,
361361
);

0 commit comments

Comments
 (0)