|
1 | 1 | import { useTheme } from 'next-themes'
|
2 | 2 |
|
3 |
| -const sponsors = { |
4 |
| - family: { |
5 |
| - dark: 'https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/family-dark.svg', |
6 |
| - light: |
7 |
| - 'https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/family-light.svg', |
| 3 | +const sponsors = [ |
| 4 | + { |
| 5 | + id: 'family', |
| 6 | + name: 'Family', |
| 7 | + href: 'https://twitter.com/family', |
| 8 | + logo: { |
| 9 | + dark: 'https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/family-dark.svg', |
| 10 | + light: |
| 11 | + 'https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/family-light.svg', |
| 12 | + }, |
8 | 13 | },
|
9 |
| - context: { |
10 |
| - dark: 'https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/context-dark.svg', |
11 |
| - light: |
12 |
| - 'https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/context-light.svg', |
| 14 | + { |
| 15 | + id: 'context', |
| 16 | + name: 'Context', |
| 17 | + href: 'https://twitter.com/context', |
| 18 | + logo: { |
| 19 | + dark: 'https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/context-dark.svg', |
| 20 | + light: |
| 21 | + 'https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/context-light.svg', |
| 22 | + }, |
13 | 23 | },
|
14 |
| -} as const |
| 24 | + { |
| 25 | + id: 'walletconnect', |
| 26 | + name: 'WalletConnect', |
| 27 | + href: 'https://walletconnect.com', |
| 28 | + logo: { |
| 29 | + dark: 'https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/walletconnect-dark.svg', |
| 30 | + light: |
| 31 | + 'https://raw.githubusercontent.com/wagmi-dev/.github/main/content/sponsors/walletconnect-light.svg', |
| 32 | + }, |
| 33 | + }, |
| 34 | +] as const |
15 | 35 |
|
16 | 36 | export function Sponsors() {
|
17 | 37 | const { resolvedTheme } = useTheme()
|
18 | 38 | const mode = (resolvedTheme ?? 'dark') as 'dark' | 'light'
|
19 | 39 | return (
|
20 | 40 | <div className="flex my-5 gap-2">
|
21 |
| - <a href="https://twitter.com/family"> |
22 |
| - <picture> |
23 |
| - <img |
24 |
| - alt="family logo" |
25 |
| - src={sponsors.family[mode]} |
26 |
| - width="auto" |
27 |
| - className="h-12" |
28 |
| - /> |
29 |
| - </picture> |
30 |
| - </a> |
31 |
| - <a href="https://twitter.com/context"> |
32 |
| - <picture> |
33 |
| - <img |
34 |
| - alt="context logo" |
35 |
| - src={sponsors.context[mode]} |
36 |
| - width="auto" |
37 |
| - className="h-12" |
38 |
| - /> |
39 |
| - </picture> |
40 |
| - </a> |
| 41 | + {sponsors.map((sponsor) => ( |
| 42 | + <a href={sponsor.href} key={sponsor.id}> |
| 43 | + <picture> |
| 44 | + <img |
| 45 | + alt={sponsor.name} |
| 46 | + src={sponsor.logo[mode]} |
| 47 | + width="auto" |
| 48 | + className="h-12" |
| 49 | + /> |
| 50 | + </picture> |
| 51 | + </a> |
| 52 | + ))} |
41 | 53 | </div>
|
42 | 54 | )
|
43 | 55 | }
|
0 commit comments