mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 12:53:03 -05:00
feat: use API to fetch sponsors
This commit is contained in:
@@ -1,21 +1,22 @@
|
|||||||
---
|
---
|
||||||
import Default from '@astrojs/starlight/components/Hero.astro';
|
import Default from '@astrojs/starlight/components/Hero.astro';
|
||||||
import { Icon } from '@astrojs/starlight/components';
|
|
||||||
import MyIcon from './MyIcon.astro';
|
import MyIcon from './MyIcon.astro';
|
||||||
|
|
||||||
const sponsors = ['ddotx'];
|
|
||||||
|
const sponsorFetch = await fetch('https://ghs.vercel.app/v2/sponsors/tomalaforge');
|
||||||
|
const { sponsors } = await sponsorFetch.json();
|
||||||
---
|
---
|
||||||
|
|
||||||
<div class="sponsor-header button-hover">
|
<div class="sponsor-header button-hover">
|
||||||
<p>Big thanks to the people supporting this project:
|
<p>Big thanks to the people supporting this project:
|
||||||
{sponsors.map((sponsor: string) => (
|
{sponsors.past.map(({username, avatar}) => (
|
||||||
<a href=`https://github.com/${sponsor}`>
|
<a href=`https://github.com/${username}`>
|
||||||
<img
|
<img
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
src={`https://github.com/${sponsor}.png?size=80`}
|
src={avatar}
|
||||||
width="40"
|
width="40"
|
||||||
height="40"
|
height="40"
|
||||||
alt={sponsor}
|
alt={username}
|
||||||
class="avatar"
|
class="avatar"
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user