-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
283abdf
commit b38ff52
Showing
3 changed files
with
69 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { useEffect, useState } from 'react' | ||
import { OpenSponsorsUrl } from '../env.ts' | ||
|
||
export const useOSSSponsors = () => { | ||
const [sponsors, setSponsors] = useState< | ||
{ name: string; website: string; logo: string; logoDark: string }[] | ||
>([]) | ||
|
||
useEffect(() => { | ||
const fetchData = async () => { | ||
const response = await fetch(OpenSponsorsUrl) | ||
const data = await response.json() | ||
setSponsors(data.sponsors || []) | ||
} | ||
fetchData() | ||
}, []) | ||
|
||
return sponsors | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
import 'vite/client' | ||
|
||
export const ViteAuthDomain = import.meta.env.VITE_AUTH_DOMAIN | ||
// @ts-ignore | ||
export const OpenSponsorsUrl = import.meta.env.VITE_OPEN_SPONSORS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters