Skip to content

Commit f333597

Browse files
authored
doc: add generous sponsor Marblism (#330)
* doc: add generous sponsor Marblism * remove unused code * fix build error
1 parent 71abf19 commit f333597

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

src/components/Sponsorship.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import React from 'react';
2+
export default function Sponsorship(): JSX.Element {
3+
return (
4+
<div className="flex justify-center w-full">
5+
<div className="flex flex-col text-center xl:w-3/4">
6+
<h2 className="text-2xl md:text-3xl lg:text-4xl pb-20">Our Generous Sponsors</h2>
7+
<div className="flex flex-auto justify-center">
8+
<Sponsor src="/img/logo/marblism-logo.png" name="Marblism" website="https://www.marblism.com/" />
9+
</div>
10+
</div>
11+
</div>
12+
);
13+
}
14+
15+
function Sponsor({ src, name, website }: { src: string; name: string; website: string }): JSX.Element {
16+
const alt = src.split('/').pop()?.split('.')[0] ?? 'logo';
17+
return (
18+
<a href={website} target="_blank" className="no-underline">
19+
<img src={src} className="h-40 object-contain" alt={alt} />
20+
<h2>{name}</h2>
21+
</a>
22+
);
23+
}

src/pages/index.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { description } from '../lib/content';
1010
import styles from './index.module.css';
1111
import FrameworkIntegration from '../components/FrameworkIntegration';
1212
import VOC from '../components/VOCFlat';
13+
import Sponsorship from '../components/Sponsorship';
1314

1415
function Header() {
1516
return (
@@ -79,6 +80,29 @@ function Section({ children, className }: { children: React.ReactNode; className
7980
);
8081
}
8182

83+
function Logo({
84+
src,
85+
darkSrc,
86+
darkModeBrightness,
87+
}: {
88+
src: string;
89+
darkSrc?: string;
90+
darkModeBrightness?: number;
91+
}): JSX.Element {
92+
const alt = src.split('/').pop()?.split('.')[0] ?? 'logo';
93+
return (
94+
<>
95+
<img src={src} className="h-12 object-contain block dark:hidden" alt={alt} />
96+
<img
97+
src={darkSrc ?? src}
98+
className="h-12 object-contain hidden dark:block"
99+
style={darkModeBrightness ? { filter: `brightness(${darkModeBrightness})` } : {}}
100+
alt={alt}
101+
/>
102+
</>
103+
);
104+
}
105+
82106
export default function Home(): JSX.Element {
83107
const { siteConfig } = useDocusaurusContext();
84108
return (
@@ -105,6 +129,9 @@ export default function Home(): JSX.Element {
105129
</Section> */}
106130

107131
<Section className="bg-slate-50">
132+
<Sponsorship />
133+
</Section>
134+
<Section>
108135
<VOC />
109136

110137
<div className="flex justify-center w-full mt-32">

static/img/logo/marblism-logo.png

43.7 KB
Loading

0 commit comments

Comments
 (0)