-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from getAlby/feat/react-wrapper
feat: add react wrapper package
- Loading branch information
Showing
19 changed files
with
3,831 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Bitcoin Connect React | ||
|
||
A React wrapper for Bitcoin Connect | ||
|
||
## Development | ||
|
||
`yarn install` | ||
`yarn dev` | ||
|
||
### Viewing changes | ||
|
||
Run `yarn link` then in `../demos/react` run `yarn link @getalby/bitcoin-connect-react`. The component changes can be seen in the demo app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"name": "@getalby/bitcoin-connect-react", | ||
"version": "1.0.0", | ||
"type": "module", | ||
"source": "src/index.ts", | ||
"main": "./dist/index.cjs", | ||
"module": "./dist/index.module.js", | ||
"unpkg": "./dist/index.umd.js", | ||
"types": "./dist/index.d.ts", | ||
"exports": { | ||
"require": "./dist/index.cjs", | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.modern.js" | ||
}, | ||
"license": "MIT", | ||
"files": [ | ||
"dist/**/*" | ||
], | ||
"scripts": { | ||
"dev": "microbundle --globals react=React --jsx React.createElement --jsxFragment React.Fragment --jsxImportSource react watch", | ||
"build": "microbundle --globals react=React --jsx React.createElement --jsxFragment React.Fragment --jsxImportSource react" | ||
}, | ||
"dependencies": { | ||
"@getalby/lightning-wallet-connect": "^1.0.14" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "^18.2.21", | ||
"microbundle": "^0.15.1" | ||
}, | ||
"peerDependencies": { | ||
"react": "^18.2.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
import '@getalby/lightning-wallet-connect'; | ||
import {ComponentProps} from '../types/ComponentProps'; | ||
import {useCoreEvents} from '../hooks/useCoreEvents'; | ||
|
||
type ButtonProps = ComponentProps & {}; | ||
|
||
export const Button: React.FC<ButtonProps> = (props) => { | ||
useCoreEvents(props); | ||
|
||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
return <lwc-button />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
import '@getalby/lightning-wallet-connect'; | ||
import {ComponentProps} from '../types/ComponentProps'; | ||
import {useCoreEvents} from '../hooks/useCoreEvents'; | ||
|
||
type ModalProps = ComponentProps & {}; | ||
|
||
export const Modal: React.FC<ModalProps> = (props) => { | ||
useCoreEvents(props); | ||
|
||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
return <lwc-modal />; | ||
}; |
Oops, something went wrong.