Skip to content

Commit c467167

Browse files
Fix typescript build error
1 parent e0ed5a0 commit c467167

File tree

6 files changed

+20
-18
lines changed

6 files changed

+20
-18
lines changed

Diff for: resources/js/components/AppHeader.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from '@/co
1616
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
1717
import UserMenuContent from '@/components/UserMenuContent.vue';
1818
import { getInitials } from '@/composables/useInitials';
19-
import type { BreadcrumbItem, NavItem } from '@/types';
19+
import type { BreadcrumbItem, NavItem, SharedData } from '@/types';
2020
import { Link, usePage } from '@inertiajs/vue3';
2121
import { BookOpen, Folder, LayoutGrid, Menu, Search } from 'lucide-vue-next';
2222
import { computed } from 'vue';
@@ -29,7 +29,7 @@ const props = withDefaults(defineProps<Props>(), {
2929
breadcrumbs: () => [],
3030
});
3131
32-
const page = usePage();
32+
const page = usePage<SharedData>();
3333
const auth = computed(() => page.props.auth);
3434
3535
const isCurrentRoute = (url: string) => {

Diff for: resources/js/components/AppSidebarHeader.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defineProps<{
1414
>
1515
<div class="flex items-center gap-2">
1616
<SidebarTrigger class="-ml-1" />
17-
<template v-if="breadcrumbs.length > 0">
17+
<template v-if="breadcrumbs && breadcrumbs.length > 0">
1818
<Breadcrumbs :breadcrumbs="breadcrumbs" />
1919
</template>
2020
</div>

Diff for: resources/js/components/TextLink.vue

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
<script setup lang="ts">
2-
import { Link } from '@inertiajs/vue3';
2+
import { InertiaLinkProps, Link } from '@inertiajs/vue3';
33
4-
interface Props {
5-
href: string;
4+
interface Props extends Pick<InertiaLinkProps, "href" | "method" | "as"> {
65
tabindex?: number;
7-
method?: string;
8-
as?: string;
9-
}
6+
};
107
118
defineProps<Props>();
129
</script>

Diff for: resources/js/components/UserInfo.vue

+2-6
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,22 @@
22
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
33
import { useInitials } from '@/composables/useInitials';
44
import type { User } from '@/types';
5-
import { computed } from 'vue';
65
76
interface Props {
87
user: User;
98
showEmail?: boolean;
109
}
1110
12-
const props = withDefaults(defineProps<Props>(), {
11+
withDefaults(defineProps<Props>(), {
1312
showEmail: false,
1413
});
1514
1615
const { getInitials } = useInitials();
17-
18-
// Compute whether we should show the avatar image
19-
const showAvatar = computed(() => props.user.avatar && props.user.avatar !== '');
2016
</script>
2117

2218
<template>
2319
<Avatar class="h-8 w-8 overflow-hidden rounded-lg">
24-
<AvatarImage v-if="showAvatar" :src="user.avatar" :alt="user.name" />
20+
<AvatarImage v-if="user.avatar && user.avatar !== ''" :src="user.avatar" :alt="user.name" />
2521
<AvatarFallback class="rounded-lg text-black dark:text-white">
2622
{{ getInitials(user.name) }}
2723
</AvatarFallback>

Diff for: resources/js/layouts/auth/AuthSplitLayout.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<script setup lang="ts">
22
import AppLogoIcon from '@/components/AppLogoIcon.vue';
3+
import { SharedData } from '@/types';
34
import { Link, usePage } from '@inertiajs/vue3';
45
5-
const page = usePage();
6+
const page = usePage<SharedData>();
67
const name = page.props.name;
78
const quote = page.props.quote;
89
@@ -20,7 +21,7 @@ defineProps<{
2021
<AppLogoIcon class="mr-2 size-8 fill-current text-white" />
2122
{{ name }}
2223
</Link>
23-
<div v-if="quote" class="relative z-20 mt-auto">
24+
<div v-if="quote && quote" class="relative z-20 mt-auto">
2425
<blockquote class="space-y-2">
2526
<p class="text-lg">&ldquo;{{ quote.message }}&rdquo;</p>
2627
<footer class="text-sm text-neutral-300">{{ quote.author }}</footer>

Diff for: resources/js/pages/Welcome.vue

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<script setup lang="ts">
2+
import { SharedData } from '@/types';
23
import { Head, Link } from '@inertiajs/vue3';
4+
5+
const props = defineProps<SharedData>();
36
</script>
47

58
<template>
@@ -11,7 +14,7 @@ import { Head, Link } from '@inertiajs/vue3';
1114
<header class="not-has-[nav]:hidden mb-6 w-full max-w-[335px] text-sm lg:max-w-4xl">
1215
<nav class="flex items-center justify-end gap-4">
1316
<Link
14-
v-if="$page.props.auth.user"
17+
v-if="props.auth.user"
1518
:href="route('dashboard')"
1619
class="inline-block rounded-sm border border-[#19140035] px-5 py-1.5 text-sm leading-normal text-[#1b1b18] hover:border-[#1915014a] dark:border-[#3E3E3A] dark:text-[#EDEDEC] dark:hover:border-[#62605b]"
1720
>
@@ -214,6 +217,11 @@ import { Head, Link } from '@inertiajs/vue3';
214217
stroke-width="1"
215218
/>
216219
</g>
220+
<!-- Workaround: -->
221+
<!-- 'plus-darker' is a valid value for the mixBlendMode key according to MDN -->
222+
<!-- However, the csstype library, which is used by @vue/runtime-dom, does not support this value. -->
223+
<!-- @see https://developer.mozilla.org/de/docs/Web/CSS/mix-blend-mode -->
224+
<!-- @vue-ignore -->
217225
<g
218226
:style="{ mixBlendMode: 'plus-darker' }"
219227
class="duration-750 starting:translate-y-4 starting:opacity-0 translate-y-0 opacity-100 transition-all delay-300"

0 commit comments

Comments
 (0)