Skip to content
This repository was archived by the owner on Mar 8, 2024. It is now read-only.

Commit debca33

Browse files
authored
Landing page for PayID docs site (#123)
1 parent d61f8f4 commit debca33

66 files changed

Lines changed: 1770 additions & 31 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@
1919
npm-debug.log*
2020
yarn-debug.log*
2121
yarn-error.log*
22+
yarn.lock

docs/home.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
id: home
3+
title: Home
4+
hide_title: true
5+
sidebar_label: Home
6+
hide_table_of_contents: true
7+
custom_edit_url: null
8+
---
9+
10+
import Home from '../src/components/home'
11+
12+
<Home />

docusaurus.config.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ function getSentryDSN() {
6161
}
6262

6363
module.exports = {
64+
baseUrl: '',
6465
title: 'PayID Developer Documentation and Reference Guides',
6566
tagline:
6667
"Learn how to implement and deploy PayID on your payment network with our documentation library. You'll find API reference, standards and technical white papers.",
@@ -101,8 +102,9 @@ module.exports = {
101102
{
102103
href: 'https://github.com/payid-org/payid',
103104
position: 'right',
104-
className: 'header-github-link',
105+
className: 'github-button header-github-link',
105106
'aria-label': 'GitHub repository',
107+
label: 'GitHub repository',
106108
},
107109
],
108110
},
@@ -130,7 +132,7 @@ module.exports = {
130132
{
131133
docs: {
132134
routeBasePath: '/',
133-
homePageId: 'getting-started',
135+
homePageId: 'home',
134136
sidebarPath: require.resolve('./sidebars.js'),
135137
editUrl:
136138
'https://github.com/payid-org/payid-documentation/tree/master',
@@ -162,4 +164,9 @@ module.exports = {
162164
},
163165
],
164166
],
167+
customFields: {
168+
developerUrl: `${getPayIDURL()}/use-cases`,
169+
sandboxUrl: `${getPayIDURL()}/sandbox`,
170+
discordUrl: 'https://chat.payid.org/',
171+
},
165172
}

sidebars.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = {
22
docs: [
33
{
44
type: 'doc',
5-
id: 'welcome-to-payid',
5+
id: 'home',
66
},
77
{
88
type: 'category',

src/components/banners.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
export default [
2+
{
3+
text:
4+
'A full-featured cryptocurrency wallet with borrowing, lending, and exchange capabilities',
5+
logo: '/img/docs/home/logo/crypto.svg',
6+
logoWhite: '/img/docs/home/logo/crypto-white.svg',
7+
banner: '/img/docs/home/banners/crypto.png',
8+
},
9+
{
10+
text: 'A simple platform that offers the easiest way to get a PayID.',
11+
logo: '/img/docs/home/logo/payme-plus.svg',
12+
logoWhite: '/img/docs/home/logo/payme-plus-white.svg',
13+
banner: '/img/docs/home/banners/payme-plus.png',
14+
},
15+
{
16+
text:
17+
'An XRP-first digital assets exchange that is focused on delivering best-in-class customer security',
18+
logo: '/img/docs/home/logo/bitrue.svg',
19+
logoWhite: '/img/docs/home/logo/bitrue-white.svg',
20+
banner: '/img/docs/home/banners/bitrue.png',
21+
},
22+
{
23+
text:
24+
'A hardware wallet in the form of a credit card that can send, store, and receive digital assets',
25+
logo: '/img/docs/home/logo/tangem.svg',
26+
logoWhite: '/img/docs/home/logo/tangem-white.svg',
27+
banner: '/img/docs/home/banners/tangem.png',
28+
},
29+
{
30+
text:
31+
'A fully regulated cryptocurrency exchange that is available in 190+ countries',
32+
logo: '/img/docs/home/logo/coin-field.svg',
33+
logoWhite: '/img/docs/home/logo/coin-field-white.svg',
34+
banner: '/img/docs/home/banners/coin-field.png',
35+
},
36+
]

src/components/contact.tsx

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
import React, { useState, useCallback, useMemo } from 'react'
2+
3+
// Copied from payid code: common/community.tsx
4+
const emailRegex = /^[a-zA-Z0-9.!#$%&*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/
5+
const isValidEmail = (val: string | undefined): boolean => {
6+
return !!(val && emailRegex.test(val))
7+
}
8+
9+
const contact = () => {
10+
const [email, setEmail] = useState<string>('')
11+
const [errorMsg, setErrorMsg] = useState<string>('')
12+
const [success, setSuccess] = useState<boolean>(false)
13+
const [submitting, setSubmitting] = useState<boolean>(false)
14+
15+
const handleInputChange = ({
16+
target: { value },
17+
}: {
18+
target: { value: string }
19+
}) => {
20+
setEmail(value)
21+
setErrorMsg('')
22+
}
23+
24+
const validEmail = useMemo(() => {
25+
return isValidEmail(email)
26+
}, [email])
27+
28+
const handleSubmit = useCallback(() => {
29+
setErrorMsg('')
30+
if (isValidEmail(email)) {
31+
// TODO: Update tracking to Segment
32+
if (typeof window !== 'undefined') {
33+
if (typeof window.heap !== 'undefined') {
34+
window.heap.track('newsletter', { email })
35+
}
36+
if (typeof window.gtag !== 'undefined') {
37+
window.gtag('event', 'conversion', {
38+
send_to: 'AW-877332159/jdvuCLLdpdQBEL-NrKID',
39+
})
40+
window.gtag('event', 'conversion', {
41+
send_to: 'AW-616173950/7ehtCOKFvNYBEP6i6KUC',
42+
})
43+
}
44+
}
45+
46+
const formData = `email=${email}`
47+
48+
setSubmitting(true)
49+
fetch('https://go.ripple.com/l/105572/2020-06-15/cspx4n', {
50+
mode: 'no-cors',
51+
method: 'POST',
52+
body: formData,
53+
headers: {
54+
'Content-Type': 'application/x-www-form-urlencoded',
55+
},
56+
})
57+
.then(() => {
58+
setEmail('')
59+
setErrorMsg('')
60+
setSuccess(true)
61+
})
62+
.catch((err) => {
63+
setErrorMsg('Error sending email.')
64+
console.error(err)
65+
})
66+
.finally(() => {
67+
setSubmitting(false)
68+
})
69+
70+
fetch(
71+
`https://script.google.com/macros/s/AKfycbyT7zjGQMQKaSrE9ef1NuvAFGKGUc8cnnUGSFo7V5Q6HWeBx-DL/exec?${formData}`,
72+
{
73+
mode: 'no-cors',
74+
},
75+
).catch(() => {})
76+
} else {
77+
setErrorMsg('Invalid email.')
78+
}
79+
}, [email, setErrorMsg, setEmail, setSuccess, setSubmitting])
80+
81+
return (
82+
<div className="newsletter">
83+
<label className="title">Sign Up for the Newsletter</label>
84+
<div className="input-group">
85+
<form
86+
onSubmit={(e) => {
87+
e.preventDefault()
88+
handleSubmit()
89+
}}
90+
>
91+
{!success && (
92+
<>
93+
<input
94+
type="text"
95+
placeholder="Email"
96+
className="text-input email-input"
97+
value={email}
98+
onChange={handleInputChange}
99+
disabled={submitting}
100+
/>
101+
<button
102+
type="submit"
103+
disabled={!validEmail || submitting}
104+
className={`button contact-btn ${
105+
!validEmail ? 'disabled' : ''
106+
}`}
107+
>
108+
Contact Us
109+
</button>
110+
</>
111+
)}
112+
</form>
113+
{success && (
114+
<div className="alert alert--success margin-vert--sm" role="alert">
115+
Successfully subscribed!
116+
</div>
117+
)}
118+
{errorMsg && (
119+
<div className="alert alert--danger margin-vert--sm" role="alert">
120+
{errorMsg}
121+
</div>
122+
)}
123+
</div>
124+
</div>
125+
)
126+
}
127+
128+
export default contact

src/components/developers.ts

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
export default [
2+
{
3+
logo: '/img/docs/home/logo/briskid.svg',
4+
whiteLogo: '/img/docs/home/logo/briskid-white.svg',
5+
title: 'Brisk ID',
6+
description:
7+
'allows anyone with a mobile phone to create and manage a PayID.',
8+
userLogo: '/img/docs/home/developers/briskid.svg',
9+
userName: 'Leighton Scarlett,',
10+
userdetail: 'Founder',
11+
link: 'https://devpost.com/software/briskid',
12+
},
13+
{
14+
logo: '/img/docs/home/logo/kyc-crypto.svg',
15+
whiteLogo: '/img/docs/home/logo/kyc-crypto-white.svg',
16+
title: 'Verified PayID',
17+
description: 'decentralized saved identities assigned to PayID.',
18+
userLogo: '/img/docs/home/developers/kyc-crypto.svg',
19+
userName: 'Tobias Graf,',
20+
userdetail: 'CEO KYC.Crypto',
21+
link: 'https://devpost.com/software/verified-payid',
22+
},
23+
{
24+
logo: '/img/docs/home/logo/insta-pay.svg',
25+
whiteLogo: '/img/docs/home/logo/insta-pay-white.svg',
26+
title: 'Instapay',
27+
description:
28+
'the fastest, easiest payment app for all financial transactions.',
29+
userLogo: '/img/docs/home/developers/insta-pay.svg',
30+
userName: 'Jayshree Anandakumar,',
31+
userdetail: 'Founder',
32+
link: 'https://devpost.com/software/instapay',
33+
},
34+
{
35+
logo: '/img/docs/home/logo/xnd.svg',
36+
whiteLogo: '/img/docs/home/logo/xnd-white.svg',
37+
title: 'XND',
38+
description:
39+
'a wallet that can perform cross-chain transfers directly to a PayID.',
40+
userLogo: '/img/docs/home/developers/xnd.svg',
41+
userName: 'Anirudha Bose,',
42+
userdetail: 'Backend Developer',
43+
link: 'https://devpost.com/software/xnd',
44+
},
45+
{
46+
logo: '/img/docs/home/logo/x-payments.svg',
47+
whiteLogo: '/img/docs/home/logo/x-payments-white.svg',
48+
title: 'Xpayments.me',
49+
description: 'a central gateway for cryptocurrency payment information.',
50+
userLogo: '/img/docs/home/developers/x-payments.svg',
51+
userName: 'Roshan Pawar,',
52+
userdetail: 'Founder',
53+
link: 'https://devpost.com/software/xpayments-me',
54+
},
55+
{
56+
logo: '/img/docs/home/logo/upay.svg',
57+
whiteLogo: '/img/docs/home/logo/upay-white.svg',
58+
title: 'Upay',
59+
description:
60+
'get paid for your online services by anyone anywhere in the world.',
61+
userLogo: '/img/docs/home/developers/upay.svg',
62+
userName: 'Konstantin Shkut,',
63+
userdetail: 'Founder',
64+
link: 'https://devpost.com/software/u-pay',
65+
},
66+
{
67+
logo: '/img/docs/home/logo/payid-validator.svg',
68+
whiteLogo: '/img/docs/home/logo/payid-validator-white.svg',
69+
title: 'PayID Validator',
70+
description:
71+
'a tool for performing checks to validate PayID response headers.',
72+
userLogo: '/img/docs/home/developers/payid-validator.svg',
73+
userName: 'Robert Swarthout,',
74+
userdetail: 'Founder',
75+
link: 'https://devpost.com/software/payid-validator',
76+
},
77+
{
78+
logo: '/img/docs/home/logo/zero-games.svg',
79+
whiteLogo: '/img/docs/home/logo/zero-games-white.svg',
80+
title: '0Games',
81+
description: 'a peer-to-peer 0% fee video game crypto-marketplace.',
82+
userLogo: '/img/docs/home/developers/zero-games.svg',
83+
userName: 'Aymeric Bethencourt,',
84+
userdetail: 'Founder',
85+
link: 'https://devpost.com/software/0games',
86+
},
87+
{
88+
logo: '/img/docs/home/logo/unisend.svg',
89+
whiteLogo: '/img/docs/home/logo/unisend-white.svg',
90+
title: 'Unisend',
91+
description: 'app to send money internationally for free using PayID.',
92+
userLogo: '/img/docs/home/developers/unisend.svg',
93+
userName: 'Drew Patel,',
94+
userdetail: 'Backend Developer',
95+
link: 'https://devpost.com/software/temp-project-name-duso2p',
96+
},
97+
]

0 commit comments

Comments
 (0)