Skip to content

Commit 250ffed

Browse files
authored
fix the sponsor link undefined error. (#196)
1 parent bb776f1 commit 250ffed

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

src/components/TeamMember/index.astro

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
---
22
import './index.css';
33
4-
export interface Props {
5-
withSponsor?: boolean;
6-
githubName?: typeof withSponsor extends true ? string : never;
7-
imgSrc: string;
8-
children: any;
9-
}
4+
type Props =
5+
| {
6+
withSponsor: true;
7+
githubName: string;
8+
imgSrc: string;
9+
children: any;
10+
}
11+
| {
12+
withSponsor?: false;
13+
githubName?: never;
14+
imgSrc: string;
15+
children: any;
16+
};
1017
1118
const { withSponsor, githubName, imgSrc } = Astro.props;
1219
---
@@ -35,4 +42,4 @@ const { withSponsor, githubName, imgSrc } = Astro.props;
3542
</a>
3643
)}
3744
</div>
38-
</div>
45+
</div>

src/pages/team.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import TeamMemberName from '../components/TeamMemberName/index.astro';
99
<TeamMember
1010
imgSrc="/andrea.png"
1111
withSponsor
12+
githubName="asturur"
1213
>
1314
<p>
1415
<TeamMemberName name="Andrea Bogazzi" githubName="asturur" /> was born
@@ -127,4 +128,4 @@ import TeamMemberName from '../components/TeamMemberName/index.astro';
127128
</p>
128129
</TeamMember>
129130
</main>
130-
</Layout>
131+
</Layout>

0 commit comments

Comments
 (0)