-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
134 feat check react component wrapping (#135)
* feat: wrap vechain dapp connect kit in react * revert: create button with modal wrapped * test: wrapped vechain dapp connect kit --------- Co-authored-by: Darren Kelly <[email protected]>
- Loading branch information
1 parent
375c218
commit 0f8d406
Showing
7 changed files
with
48 additions
and
6 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
13 changes: 13 additions & 0 deletions
13
packages/dapp-kit-react/src/Components/VechainDappConnectKit/VechainDappConnectKit.tsx
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,13 @@ | ||
import React from 'react'; | ||
import GlobalFonts from '../../../assets/fonts/fonts'; | ||
import { ThemeProvider } from '../../provider/ThemeProvider'; | ||
import { VechainDappConnectKitWithTheme } from './Wrapped/VechainDappConnectKitWrapped'; | ||
|
||
export const VechainDappConnectKit: React.FC = (): React.ReactElement => { | ||
return ( | ||
<ThemeProvider> | ||
<GlobalFonts /> | ||
<VechainDappConnectKitWithTheme /> | ||
</ThemeProvider> | ||
); | ||
}; |
22 changes: 22 additions & 0 deletions
22
...p-kit-react/src/Components/VechainDappConnectKit/Wrapped/VechainDappConnectKitWrapped.tsx
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,22 @@ | ||
import React, { useMemo } from 'react'; | ||
import { createComponent } from '@lit/react'; | ||
import { VechainDappConnectKit as VechainDappConnectKitVanilla } from '@vechain/dapp-kit-ui'; | ||
import { useThemeSelector } from '../../../provider/ThemeProvider'; | ||
|
||
const VechainDappConnectKitWrapped = () => | ||
createComponent({ | ||
tagName: 'vwk-vechain-dapp-connect-kit', | ||
elementClass: VechainDappConnectKitVanilla, | ||
react: React, | ||
}); | ||
|
||
export const VechainDappConnectKitWithTheme: React.FC = () => { | ||
const { theme } = useThemeSelector(); | ||
|
||
const VechainDappConnectKit = useMemo( | ||
() => VechainDappConnectKitWrapped(), | ||
[], | ||
); | ||
|
||
return <VechainDappConnectKit mode={theme.mode} />; | ||
}; |
1 change: 1 addition & 0 deletions
1
packages/dapp-kit-react/src/Components/VechainDappConnectKit/index.ts
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 @@ | ||
export * from './VechainDappConnectKit'; |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './ConnectWalletButtonWithModal'; | ||
export * from './ConnectWalletModal'; | ||
export * from './SelectWalletModal'; | ||
export * from './VechainDappConnectKit'; |
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