Skip to content

Commit f08bc4c

Browse files
authored
add Premium Sponsors (tauri-apps#243)
1 parent 617780c commit f08bc4c

File tree

4 files changed

+65
-5
lines changed

4 files changed

+65
-5
lines changed

src/pages/partners.js

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import useDocusaurusContext from '@docusaurus/useDocusaurusContext'
66
const Avatar = ({ name, tags, image, description, link }) => {
77
const context = useDocusaurusContext()
88
const { siteConfig = {} } = context
9-
9+
const isContribute = tags.includes("contribute");
1010
return (
1111
<div className="col col--4 margin-bottom--lg">
1212
<div
@@ -47,14 +47,35 @@ const Avatar = ({ name, tags, image, description, link }) => {
4747
</li>
4848
))}
4949
</ul>
50-
<small className="avatar__subtitle">{description}</small>
50+
<p
51+
style={{
52+
paddingTop: isContribute ? "1em" : "0",
53+
fontSize: "0.9em",
54+
fontWeight: isContribute ? "bolder" : "lighter",
55+
display: "-webkit-box",
56+
height: "5em",
57+
lineHeight: "1.3em",
58+
overflow: "hidden",
59+
textOverflow: "ellipsis",
60+
'-webkit-line-clamp': "4",
61+
'-webkit-box-orient': "vertical",
62+
}}
63+
>
64+
{description}
65+
</p>
5166
</div>
5267
</div>
5368
</div>
5469
<div className="card__footer">
5570
<a href={link} target="_blank">
56-
<button className="button button--secondary">
57-
{siteConfig.themeConfig.t.global.discover}
71+
<button className={isContribute ?
72+
"button button--primary" :
73+
"button button--secondary"
74+
}>
75+
{isContribute ?
76+
siteConfig.themeConfig.t.global.contribute :
77+
siteConfig.themeConfig.t.global.discover
78+
}
5879
</button>
5980
</a>
6081
</div>
@@ -69,6 +90,21 @@ function Partners() {
6990
const context = useDocusaurusContext()
7091
const { siteConfig = {} } = context
7192

93+
const premium_sponsors = [
94+
{
95+
name: <>1Password</>,
96+
link: 'https://1password.com',
97+
tags: ['security', 'privacy'],
98+
image: imgPath + '1P_logo_256px.png',
99+
},
100+
{
101+
name: <>Your Company</>,
102+
link: 'https://opencollective.com/tauri/contribute/sponsor-11057/checkout',
103+
tags: ['contribute', 'open collective'],
104+
image: imgPath + 'OpenCollective_logo.svg',
105+
}
106+
]
107+
72108
const sponsors = [
73109
{
74110
name: <>Digital Ocean</>,
@@ -213,6 +249,20 @@ function Partners() {
213249
<h1 className="text--center margin-bottom--xl">
214250
{siteConfig.themeConfig.t.pages.partners.partnersLabel}
215251
</h1>
252+
<section>
253+
<h2>Premium Sponsors</h2>
254+
<div className="row">
255+
{premium_sponsors.map((sponsor, index) => {
256+
const item = {
257+
...sponsor,
258+
description:
259+
siteConfig.themeConfig.t.pages.partners.premium_sponsors[index]
260+
.description,
261+
}
262+
return <Avatar {...item} key={index} />
263+
})}
264+
</div>
265+
</section>
216266
<section>
217267
<h2>Sponsors</h2>
218268
<div className="row">
47.7 KB
Loading
Lines changed: 1 addition & 0 deletions
Loading

translations/en.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,14 @@
210210
},
211211
"partners": {
212212
"partnersLabel": "Partners",
213+
"premium_sponsors": [
214+
{
215+
"description": "A password manager, digital vault, form filler and secure digital wallet. 1Password remembers all your passwords for you to help keep account information safe."
216+
},
217+
{
218+
"description": "Become a premium sponsor to help the Tauri development."
219+
}
220+
],
213221
"sponsors": [
214222
{
215223
"description": "This project's infrastructure is supported in part by Digital Ocean. Click the button here to visit the Digital Ocean website and get $100 credit that you can use within 60 days."
@@ -302,6 +310,7 @@
302310
"editPage": "Edit this page"
303311
},
304312
"global": {
305-
"discover": "Discover"
313+
"discover": "Discover",
314+
"contribute": "Contribute"
306315
}
307316
}

0 commit comments

Comments
 (0)