Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transfer-webhook page Implementaion #43

Merged
merged 36 commits into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3003fd6
Feat: bank payout page UI for desktop x9
asapconet Jul 3, 2022
eea4bed
feat: mobile responsiveness [UI] for bank payouts page x9
asapconet Jul 3, 2022
8b0e390
chore: code checks & cleanup
asapconet Jul 4, 2022
2d9ed01
bug: fixed deployment errs [mapping data]
asapconet Jul 5, 2022
70996af
bug: fixed deployment errors [routes]
asapconet Jul 5, 2022
83977fe
feat: partial payment implementation x5
asapconet Aug 21, 2022
ff8b700
Merge branch 'main' of https://github.com/LazerPay-Finance/Lazerpay-d…
asapconet Aug 21, 2022
b986601
Merge branch 'main' of https://github.com/LazerPay-Finance/Lazerpay-d…
asapconet Aug 22, 2022
41a4467
Feat: implementation of transfer-webhooks page x8
asapconet Aug 23, 2022
178cf0d
chore: relocation of webhook files to mdx
asapconet Aug 23, 2022
5f10ed5
Feat: crypto-transfer page UI init without tables and codeSnipets
asapconet Aug 23, 2022
ef6731e
Merge branch 'main' of https://github.com/LazerPay-Finance/Lazerpay-d…
asapconet Aug 25, 2022
ced5d63
chore: file location change
asapconet Aug 25, 2022
d95887f
Feat: ecommerce page implementation
asapconet Aug 23, 2022
b2dd1dd
chore: media query fix
asapconet Aug 24, 2022
df79624
chore: file location changes and fixes on card component
asapconet Aug 25, 2022
971ff43
chore: code cleanup
asapconet Aug 25, 2022
c1e2998
test-payment
Khadeeejah Aug 22, 2022
ca18ddb
new-test-payments
Khadeeejah Aug 25, 2022
f6a6f1b
chore: typographical corrections
asapconet Aug 26, 2022
f09bc68
feat: add table component
Frontend-io Aug 30, 2022
308ea7b
feat: add transfer-webhook page x9.5/10
asapconet Aug 31, 2022
10a246e
chore: minor fix in crypto.mdx file
asapconet Aug 31, 2022
471903a
Merge branch 'main' of https://github.com/LazerPay-Finance/Lazerpay-d…
asapconet Aug 31, 2022
ba0e084
bug: import correction
asapconet Aug 31, 2022
c76ccf2
chore: use-less code cleanup
asapconet Aug 31, 2022
4cf2b1b
Merge branch 'main' into transfer-webhook
Frontend-io Aug 31, 2022
352dd3d
Merge branch 'main' of https://github.com/LazerPay-Finance/Lazerpay-d…
asapconet Aug 31, 2022
ea32a33
bug: fixes on table components
asapconet Aug 31, 2022
fea6ad1
Merge branch 'transfer-webhook' of https://github.com/asapconet/Lazer…
asapconet Aug 31, 2022
c4819bf
chore: fixes in icons files
asapconet Aug 31, 2022
a664af3
Merge branch 'main' of https://github.com/LazerPay-Finance/Lazerpay-d…
asapconet Sep 5, 2022
4af61c3
buggy: codeBlock language and fonts distorted
asapconet Sep 5, 2022
168d3a3
Merge branch 'main' of https://github.com/LazerPay-Finance/Lazerpay-d…
asapconet Sep 5, 2022
942d0e5
bug: fixed code highlightning for codeBlocks
asapconet Sep 6, 2022
1e1a0e8
Merge branch 'main' into transfer-webhook
Frontend-io Sep 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"editor.defaultFormatter": "vscode.json-language-features"
},
"[typescriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
Expand Down
49 changes: 33 additions & 16 deletions components/CodeBlock/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,66 @@ import Prism from 'prismjs'
import 'prismjs/components/prism-jsx.js'
import 'prismjs/plugins/line-numbers/prism-line-numbers.js'
import 'prismjs/plugins/line-numbers/prism-line-numbers.css'
import Styles from './index.module.scss';
import 'prismjs/themes/prism-tomorrow.css'
import Styles from './index.module.scss'
import { snippets } from 'data/snippets'
import classNames from 'classnames'

interface IProps {
id?: string;
req?: string;
lang?: string;
id?: string
req?: string
lang?: string
className?: string
children?: React.ReactNode
}

const Label = ({ label }) => {
export const Label = ({ label }) => {
const options = {
'POST': 'bg-suc-100'
POST: 'bg-suc-100',
}

return (
<div className={classNames(
options[label],
'uppercase text-neu-700 caption-s rounded-8 px-2.5 py-1')}>
<div
className={classNames(
options[label],
'uppercase text-neu-700 caption-s rounded-8 px-2.5 py-1',
)}
>
{label}
</div>
)
};
}

export default function CodeBlock({ id, lang = 'jsx', req = 'POST' }: IProps) {
const codeSnippet = snippets[id] || 'snippet not found';
export default function CodeBlock({
id,
lang,
req = 'POST',
className,
}: IProps) {
const codeSnippet = snippets[id] || 'snippet not found'
// const title = Object.keys(snippets).find(s => s === id);

useEffect(() => {
Prism.highlightAll()
}, [])

return (
<div className={classNames(Styles.CodeBlock, 'flex font-code pb-2 bg-white flex-col')}>
<div
className={classNames(
Styles.CodeBlock,
'flex font-code pb-2 bg-white flex-col',
)}
>
<div className='flex items-center px-10 py-4 space-x-5 bg-neu-50 head rounded-t-8'>
<Label label={req} />
</div>
<code>
<pre className="!my-0 line-numbers">
<code className={classNames(`language-${lang}`)}>{codeSnippet}</code>
<pre className={className + '!my-0 line-numbers'}>
<code className={classNames(`language-${lang || 'jsx'}`)}>
{codeSnippet}
</code>
</pre>
</code>
</div>
)
};
}
20 changes: 15 additions & 5 deletions components/GetstartedCard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import classNames from 'classnames'
import Styles from './index.module.scss'
import { PlainCard } from './Cards'
import LinkedCard from './Cards'
import {
completeYourIntegrationData,
startIntegratingData,
testAndGoData,
} from './data'
import HandsWithPenny from 'public/icons/handsWithPenny'

// 1 Start integrating
export default function GetStarted(): JSX.Element {
Expand All @@ -19,7 +17,15 @@ export default function GetStarted(): JSX.Element {
)}
>
{startIntegratingData.map(({ title, desc, route }) => {
return <LinkedCard icon={true} key={route} title={title} desc={desc} route={route} />
return (
<LinkedCard
icon={true}
key={route}
title={title}
desc={desc}
route={route}
/>
)
})}
</section>
)
Expand All @@ -35,7 +41,9 @@ export function CompleteIntegration(): JSX.Element {
)}
>
{completeYourIntegrationData.map(({ title, desc, route }) => {
return <LinkedCard key={route} title={title} desc={desc} route={route} />
return (
<LinkedCard key={route} title={title} desc={desc} route={route} />
)
})}
</section>
)
Expand All @@ -51,7 +59,9 @@ export function TestAndGoLive(): JSX.Element {
)}
>
{testAndGoData.map(({ title, desc, route }) => {
return <PlainCard key={route} title={title} desc={desc} route={route} />
return (
<LinkedCard key={route} title={title} desc={desc} route={route} />
)
})}
</section>
)
Expand Down
47 changes: 47 additions & 0 deletions components/TransWebhook/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import CodeBlock from 'components/CodeBlock'
import Divider from 'components/Divider'
import LzAlert from 'components/UI/alert'
import LzTable from 'components/UI/table'
import DashboardScreenshot from 'public/icons/dashboardScreenshot'
import React from 'react'

const TransferWebHook = () => {
return (
<>
<div>
<section className='my-8'>
<div className='paragraph-2 my-7'>
You can specify your webhook URL on <code>your dashboard</code> and
where we will send <code>POST</code> request whenever an event
occurs
<p className='my-4'>
Here is how to setup a webhooks on your Lazerpay account
</p>
<ul className='flex flex-col mt-6 space-y-4'>
<li>
<code>1</code> Login to your <code>dashboard</code> and on{' '}
<b>settings</b>
</li>
<li>
<code>2</code> Navigate to the <b>API Keys and WeebHooks tab</b>
</li>
<li>
<code>3</code> Specify your webhook url and click on{' '}
<b>Update</b>
</li>
</ul>
</div>
<DashboardScreenshot />
<LzAlert
className='my-7'
status='info'
content={`When testing, you can get an instant webhook URL by visiting <code>webhook.site.</code> This will allow you
to inspect the received payload without having to write any code or set up a server.`}
/>
</section>
</div>
</>
)
}

export default TransferWebHook
9 changes: 8 additions & 1 deletion components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import LzLink from './UI/link'
import LzAlert from './UI/alert'
import LinkedCard from './GetstartedCard/Cards'
import { PlainCard } from './GetstartedCard/Cards';
import { ShopifyIcon } from './../public/icons/shopify-icon';
import { WordPressIcon } from './../public/icons/wordPress-Icon';
import { WooCommerceIcon } from './../public/icons/wooCommerce-icon';

// Page Components
import FooterWrapper from './Footer'
Expand All @@ -21,8 +24,10 @@ import WhatsNew from './WhatsNew'
import GetStartedCard from './GetstartedCard'
import BankPayouts from './BankPayouts'
import LzInput from './UI/input'
import TestPayments from './TestPayments'
import BinanceIcon from './TestPayments'
import Ecommerce from './UseCases'
import TransferWebHook from './TransWebhook'
import TestPayments from './TestPayments'
import LzTable from './UI/table'
import Webhooks from './Webhooks'

Expand All @@ -46,8 +51,10 @@ export {
LzContainer,
GetStartedCard,
BankPayouts,
BinanceIcon,
TestPayments,
LinkedCard,
TransferWebHook,
PlainCard,
Ecommerce,
Webhooks
Expand Down
24 changes: 13 additions & 11 deletions components/mdx-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import LzAlert from './UI/alert'
import LinkedCard, { PlainCard } from './GetstartedCard/Cards'
import TransferCard from './TransferCard'
import BankPayouts from './BankPayouts'
import TransferWebHook from './TransWebhook'
import TestPayments from './TestPayments'
import Ecommerce from './UseCases'
import LzTable from './UI/table'
Expand All @@ -25,7 +26,7 @@ import Webhooks from './Webhooks'
/** Create a map of the HTML elements */
export const components: Record<string, FC<Record<string, any>>> = {
QuickLinks({ children, ...props }) {
return (<QuickLinks {...props} />)
return <QuickLinks {...props} />
},
AcceptPayments({ children, ...props }) {
return <AcceptPayments {...props} />
Expand All @@ -40,10 +41,10 @@ export const components: Record<string, FC<Record<string, any>>> = {
return <ConnectCommunity />
},
Divider({ children, ...props }) {
return (<Divider {...props} />)
return <Divider {...props} />
},
CodeBlock(props) {
return (<CodeBlock {...props} />)
return <CodeBlock {...props} />
},
Admonition(props) {
return <div {...props} />
Expand All @@ -64,15 +65,15 @@ export const components: Record<string, FC<Record<string, any>>> = {
return <TestAndGoLive />
},
Pagination(IProps) {
return (<Pagination {...IProps} />)
return <Pagination {...IProps} />
},
BankPayouts() {
return <BankPayouts />
},

TestPayments() {
return <TestPayments />
},

LinkedCard(MyProps) {
return <LinkedCard {...MyProps} />
},
Expand All @@ -91,6 +92,9 @@ export const components: Record<string, FC<Record<string, any>>> = {
LzTable({ head, body }) {
return <LzTable body={body} head={head} />
},
TransferWebHook() {
return <TransferWebHook />
},
p(props) {
return <p className='paragraph-2 text-neu-800' {...props} />
},
Expand All @@ -105,7 +109,7 @@ export const components: Record<string, FC<Record<string, any>>> = {
)
},
h2(props) {
return <h2 className="heading-5-s group break-keep-all" {...props} />
return <h2 className='heading-5-s group break-keep-all' {...props} />
},
h3(props) {
return <h3 {...props} />
Expand Down Expand Up @@ -138,14 +142,12 @@ export const components: Record<string, FC<Record<string, any>>> = {
)
},
Alert(props) {
return (
<LzAlert {...props} />
)
}
return <LzAlert {...props} />
},
}

export function useMDX(code: string) {
if (!code) return;
if (!code) return
const MDXComponent = useMDXComponent(code)
return <MDXComponent components={components} />
}
3 changes: 1 addition & 2 deletions content/docs/transfers/get-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ Easily send money out of your account

<TransferCard />

<Divider className='max-w-50 mb-4' />
<Divider className='w-20 mb-4' />

<Pagination/>
Loading