Skip to content

Commit

Permalink
add lunarpay extension setup
Browse files Browse the repository at this point in the history
  • Loading branch information
michavie committed Mar 1, 2024
1 parent 977db71 commit b923c61
Show file tree
Hide file tree
Showing 9 changed files with 105 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Extensions (Apps & Widgets) for the DAOs on [peerme.io](https://peerme.io). For
- xBulk: [xbulk.app](https://xbulk.app)
- AshSwap: [ashswap.io](https://ashswap.io) (in progress)
- ArtCPAClub [artcpaclub.com](https://marketplace.artcpaclub.com)
- LunarPay [lunarpay.finance](https://lunarpay.finance) (in progress)

## Create your App

Expand Down
15 changes: 15 additions & 0 deletions dev/public/images/extensions/lunarpay-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import { XBulkExtension } from './extensions/xbulk/register'
import { HatomExtension } from './extensions/hatom/register'
import { ItheumExtension } from './extensions/itheum/register'
import { StakingExtension } from './extensions/staking/register'
import { AshSwapExtension } from './extensions/ashswap/register'
import { CoindripExtension } from './extensions/coindrip/register'
import { LunarPayExtension } from './extensions/lunarpay/register'
import { Sense4fitExtension } from './extensions/sense4fit/register'
import { XExchangeExtension } from './extensions/xexchange/register'
import { PulsarMoneyExtension } from './extensions/pulsarmoney/register'
import { AshSwapExtension } from './extensions/ashswap/register'
import { ArtCpaClubExtension } from './extensions/artcpaclub/register'
import { Sense4fitExtension } from './extensions/sense4fit/register'
import { PulsarMoneyExtension } from './extensions/pulsarmoney/register'

export const Config = (config: ExtensionConfig) => ({
Extensions: [
Expand All @@ -25,6 +26,7 @@ export const Config = (config: ExtensionConfig) => ({
AshSwapExtension(config),
Sense4fitExtension(config),
ArtCpaClubExtension(config),
LunarPayExtension(config),
],

KnowledgeBase: {
Expand Down
22 changes: 22 additions & 0 deletions src/extensions/lunarpay/register.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { App } from './src/App'
import { Contracts } from './src/contracts'
import { ExtensionConfig, ExtensionInfo } from '../../shared/types'

export const LunarPayExtension = (config: ExtensionConfig): ExtensionInfo => ({
Enabled: false,
Name: 'LunarPay',
Description: 'Payments made simple for WEB3 businesses.',
Website: 'https://lunarpay.finance',
Logo: {
Light: '/images/extensions/lunarpay-logo.svg',
Dark: '/images/extensions/lunarpay-logo.svg',
},
Tags: ['defi'],
Contracts: Contracts(config),
AppRoot: App,
WidgetRoots: {},
Developer: {
Name: 'LunarPay',
Website: 'https://lunarpay.finance',
},
})
25 changes: 25 additions & 0 deletions src/extensions/lunarpay/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react'
import { Tab } from '@headlessui/react'
import { PayrollTab } from './payroll/PayrollTab'
import { TabButton } from '../../../shared/ui/elements'
import { faCoins } from '@fortawesome/free-solid-svg-icons'
import { SubscriptionTab } from './subscription/SubscriptionTab'

export const App = () => {
return (
<Tab.Group>
<Tab.List className="flex items-center space-x-2 md:space-x-4 mb-4">
<TabButton icon={faCoins}>Payroll</TabButton>
<TabButton icon={faCoins}>Subscriptions</TabButton>
</Tab.List>
<Tab.Panels>
<Tab.Panel>
<PayrollTab />
</Tab.Panel>
<Tab.Panel>
<SubscriptionTab />
</Tab.Panel>
</Tab.Panels>
</Tab.Group>
)
}
1 change: 1 addition & 0 deletions src/extensions/lunarpay/src/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const Config = {}
14 changes: 14 additions & 0 deletions src/extensions/lunarpay/src/contracts.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Network, ExtensionScInfo, ExtensionConfig } from '../../../shared/types'

const getContractAddress = (network: Network) => {
if (network === 'devnet') return '#'
if (network === 'testnet') return '#'
return '#'
}

export const Contracts = (config: ExtensionConfig): ExtensionScInfo => ({
YourCustomScEndpoint: {
Address: getContractAddress(config.network),
Endpoint: 'yourCustomScEndpoint',
},
})
11 changes: 11 additions & 0 deletions src/extensions/lunarpay/src/payroll/PayrollTab.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react'
import { useApp } from '../../../../shared/hooks/useApp'
import { AppSection } from '../../../../shared/ui/elements'

export function PayrollTab() {
const app = useApp()

console.log(app)

return <AppSection title="Payroll Section">Coming soon.</AppSection>
}
11 changes: 11 additions & 0 deletions src/extensions/lunarpay/src/subscription/SubscriptionTab.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react'
import { useApp } from '../../../../shared/hooks/useApp'
import { AppSection } from '../../../../shared/ui/elements'

export function SubscriptionTab() {
const app = useApp()

console.log(app)

return <AppSection title="Subscription Section">Coming soon.</AppSection>
}

0 comments on commit b923c61

Please sign in to comment.