- 
                Notifications
    
You must be signed in to change notification settings  - Fork 16
 
add Bitcoin Connect #343
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
base: master
Are you sure you want to change the base?
add Bitcoin Connect #343
Changes from 1 commit
8b30faf
              4147141
              c5e5284
              d9c9251
              7a704fc
              1c6baf8
              2d6e093
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import React from 'react'; | ||
| import { Button } from '@getalby/bitcoin-connect-react'; | ||
| 
     | 
||
| interface BitcoinButtonProps { | ||
| isDisabled: boolean; | ||
| } | ||
| 
     | 
||
| const BitcoinButton: React.FC<BitcoinButtonProps> = ({ isDisabled }) => { | ||
| const handleConnect = () => { | ||
| if (!isDisabled) { | ||
| alert('Connected!'); | ||
                
       | 
||
| 
     | 
||
| } | ||
| }; | ||
| 
     | 
||
| return ( | ||
| <div className="bitcoin-connect-container"> | ||
| <div style={{ opacity: isDisabled ? 0.5 : 1, pointerEvents: isDisabled ? 'none' : 'auto' }}> | ||
| <Button onConnect={handleConnect} /> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
| 
     | 
||
| export default BitcoinButton; | ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -11,3 +11,4 @@ | |
| .about { | ||
| text-align: center; | ||
| } | ||
| 
     | 
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| 
          
            
          
           | 
    @@ -17,6 +17,9 @@ import { RelayGroup } from 'core/relay/group'; | |||||
| import { useReadonlyMyPublicKey } from 'hooks/useMyPublicKey'; | ||||||
| import { useEffect, useState } from 'react'; | ||||||
| import { exportDB } from 'dexie-export-import'; | ||||||
| import BitcoinButton from 'components/BitcoinConnect/BitcoinButton'; | ||||||
| 
     | 
||||||
| 
     | 
||||||
| 
     | 
||||||
| export default function Preference() { | ||||||
| const myPublicKey = useReadonlyMyPublicKey(); | ||||||
| 
          
            
          
           | 
    @@ -98,7 +101,7 @@ export default function Preference() { | |||||
| duration: 0, | ||||||
| }); | ||||||
| 
     | 
||||||
| // Function to close the loading message when called | ||||||
| 
     | 
||||||
| const closeLoadingMessage = () => { | ||||||
| message.destroy(key); | ||||||
| }; | ||||||
| 
          
            
          
           | 
    @@ -159,6 +162,16 @@ export default function Preference() { | |||||
| Zap Amount | ||||||
| </List.Item> | ||||||
| 
     | 
||||||
| 
     | 
||||||
| <List.Item | ||||||
| actions={[ | ||||||
| 
     | 
||||||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 
        Suggested change
       
    
 this should fixed the compiled error  | 
||||||
| <BitcoinButton isDisabled={!myPublicKey || myPublicKey.length === 0} />, | ||||||
| ]} | ||||||
| > | ||||||
| Bitcoin Connect | ||||||
| </List.Item> | ||||||
| 
     | 
||||||
| <Divider orientation="left">Database</Divider> | ||||||
| <List.Item | ||||||
| actions={[ | ||||||
| 
          
            
          
           | 
    ||||||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -162,3 +162,14 @@ | |
| text-overflow: ellipsis; | ||
| white-space: nowrap; | ||
| } | ||
| 
     | 
||
| :root { | ||
| --bc-color-brand: rgb(89,128,34); | ||
                
       | 
||
| 
     | 
||
| 
     | 
||
| } | ||
| 
     | 
||
| .bitcoinConnectContainer { | ||
| --bc-color-brand: var(--bc-color-brand); | ||
| 
     | 
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be undone, right?