Skip to content

Commit 949a56e

Browse files
committed
fix astro props usage
1 parent fab9c9d commit 949a56e

File tree

6 files changed

+19
-24
lines changed

6 files changed

+19
-24
lines changed

src/components/UpgradeBadge.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ interface Props extends HTMLAttributes<'a'> {}
77
---
88

99
<div>
10-
<a class="not-content" {...Astro.props}>Tauri 1.0 Upgrade Guide <Icon name="rocket" /></a>
10+
<a class="not-content">Tauri 1.0 Upgrade Guide <Icon name="rocket" /></a>
1111
</div>
1212

1313
<style>

src/components/overrides/Footer.astro

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
import type { Props } from '@astrojs/starlight/props';
32
import Default from '@astrojs/starlight/components/Footer.astro';
43
const year = new Date().getFullYear();
54
---
65

7-
<Default {...Astro.props}><slot /></Default>
6+
<Default><slot /></Default>
87

98
<hr />
109

src/components/overrides/Header.astro

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
---
2-
import type { Props } from '@astrojs/starlight/props';
32
import LanguageSelect from '@astrojs/starlight/components/LanguageSelect.astro';
43
import Search from '@astrojs/starlight/components/Search.astro';
54
import SiteTitle from './SiteTitle.astro';
65
import SocialIcons from '@astrojs/starlight/components/SocialIcons.astro';
76
import ThemeSelect from './ThemeSelect.astro';
87
9-
const curLocale = Astro.props.locale;
10-
8+
const curLocale = Astro.locals.starlightRoute.locale;
9+
const slug = Astro.locals.starlightRoute.entry.slug;
1110
1211
type Link = {
1312
title: string;
@@ -41,10 +40,10 @@ const links: Link[] = [
4140

4241
<div class="header sl-flex">
4342
<div class="full-width sl-flex">
44-
<SiteTitle {...Astro.props} />
43+
<SiteTitle />
4544
</div>
4645
<div class="sl-flex">
47-
<Search {...Astro.props} />
46+
<Search />
4847
</div>
4948
<div class="sl-hidden md:sl-flex right-group">
5049
<div class="desktop">
@@ -57,10 +56,10 @@ const links: Link[] = [
5756
}
5857
</div>
5958
<div class="sl-flex social-icons">
60-
<SocialIcons {...Astro.props} />
59+
<SocialIcons />
6160
</div>
62-
<LanguageSelect {...Astro.props} />
63-
<ThemeSelect {...Astro.props} />
61+
<LanguageSelect />
62+
<ThemeSelect />
6463
</div>
6564
</div>
6665

@@ -136,7 +135,7 @@ body[data-mobile-menu-expanded] header {
136135
</style>
137136

138137
{
139-
Astro.props.entry.slug === '' || Astro.props.locale === Astro.props.entry.slug ?
138+
slug === '' || slug === curLocale ?
140139
<style>
141140
.header {
142141
background-color: transparent;

src/components/overrides/PageFrame.astro

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
---
2-
import MobileMenuToggle from 'virtual:starlight/components/MobileMenuToggle';
3-
import type { Props } from '@astrojs/starlight/props';
2+
import MobileMenuToggle from '@astrojs/starlight/components/MobileMenuToggle.astro';
43
import Sidebar from '@lorenzo_lewis/starlight-utils/components/Sidebar.astro';
54
const { t } = Astro.locals;
5+
const { entry, locale } = Astro.locals.starlightRoute;
66
---
77

88
<div class="page sl-flex">
99
<header class="header"><slot name="header" /></header>
1010
<nav class="sidebar" aria-label={t('sidebarNav.accessibleLabel')}>
11-
<MobileMenuToggle {...Astro.props} />
11+
<MobileMenuToggle />
1212
<div
1313
id="starlight__sidebar"
14-
class={Astro.props.entry.slug === '' || Astro.props.locale === Astro.props.entry.slug
15-
? 'sidebar-pane lp-hide'
16-
: 'sidebar-pane'}
14+
class={entry.slug === '' || locale === entry.slug ? 'sidebar-pane lp-hide' : 'sidebar-pane'}
1715
>
1816
<div class="sidebar-content sl-flex">
19-
<Sidebar {...Astro.props} />
17+
<Sidebar />
2018
</div>
2119
</div>
2220
</nav>

src/components/overrides/SiteTitle.astro

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// https://github.com/withastro/starlight/blob/main/packages/starlight/components/Select.astro
44
// https://github.com/withastro/starlight/blob/main/packages/starlight/components/LanguageSelect.astro
55
6-
import type { Props } from '@astrojs/starlight/props';
76
import Default from '@astrojs/starlight/components/SiteTitle.astro';
87
import { Icon } from '@astrojs/starlight/components';
98
@@ -40,7 +39,7 @@ const links: Link[] = [
4039
---
4140

4241
<>
43-
<Default {...Astro.props}><slot /></Default>
42+
<Default><slot /></Default>
4443

4544
<starlight-select class="mobile">
4645
<label>

src/components/overrides/TableOfContents.astro

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
import TableOfContentsList from './TableOfContents/TableOfContentsList.astro';
3-
import type { Props as BaseProps } from '@astrojs/starlight/props';
3+
import type { StarlightRouteData } from '@astrojs/starlight/route-data';
44
5-
type Props = BaseProps & {
6-
toc: BaseProps['toc'] & {
5+
type Props = StarlightRouteData & {
6+
toc: StarlightRouteData['toc'] & {
77
collapseLevel?: number;
88
};
99
};

0 commit comments

Comments
 (0)