-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
1,388 additions
and
77 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import type { Meta } from '@storybook/web-components' | ||
import '@reown/appkit-ui/src/composites/wui-alertbar' | ||
import '../../components/gallery-container' | ||
import type { WuiAlertBar } from '@reown/appkit-ui/src/composites/wui-alertbar' | ||
import { html } from 'lit' | ||
import { colorOptions, iconOptions } from '../../utils/PresetUtils' | ||
|
||
type Component = Meta<WuiAlertBar> | ||
|
||
export default { | ||
title: 'Composites/wui-alertbar', | ||
args: { | ||
message: 'Alert', | ||
backgroundColor: 'fg-350', | ||
iconColor: 'fg-325', | ||
icon: 'info' | ||
}, | ||
argTypes: { | ||
backgroundColor: { | ||
options: colorOptions, | ||
control: { type: 'select' } | ||
}, | ||
iconColor: { | ||
options: colorOptions, | ||
control: { type: 'select' } | ||
}, | ||
icon: { | ||
options: iconOptions, | ||
control: { type: 'select' } | ||
} | ||
} | ||
} as Component | ||
|
||
export const Default: Component = { | ||
render: args => html` | ||
<gallery-container width="336"> | ||
<wui-alertbar | ||
iconColor=${args.iconColor} | ||
backgroundColor=${args.backgroundColor} | ||
icon=${args.icon} | ||
message=${args.message} | ||
> | ||
</wui-alertbar> | ||
</gallery-container> | ||
` | ||
} |
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,35 @@ | ||
import { EthersTests } from '../../components/Ethers/EthersTests' | ||
import { AppKitButtons } from '../../components/AppKitButtons' | ||
import { createAppKit } from '@reown/appkit/react' | ||
import { ThemeStore } from '../../utils/StoreUtil' | ||
import { EthersModalInfo } from '../../components/Ethers/EthersModalInfo' | ||
import { EthersAdapter } from '@reown/appkit-adapter-ethers' | ||
import { siweConfig } from '../../utils/SiweUtils' | ||
import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' | ||
|
||
const ethersAdapter = new EthersAdapter() | ||
|
||
const modal = createAppKit({ | ||
adapters: [ethersAdapter], | ||
networks: [arbitrum, mainnet, optimism, polygon, zkSync, sepolia], | ||
defaultNetwork: mainnet, | ||
projectId: '', | ||
features: { | ||
analytics: true, | ||
socials: [] | ||
}, | ||
siweConfig, | ||
debug: true | ||
}) | ||
|
||
ThemeStore.setModal(modal) | ||
|
||
export default function Ethers() { | ||
return ( | ||
<> | ||
<AppKitButtons /> | ||
<EthersModalInfo /> | ||
<EthersTests /> | ||
</> | ||
) | ||
} |
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,37 @@ | ||
import { createAppKit } from '@reown/appkit/react' | ||
import { ThemeStore } from '../../utils/StoreUtil' | ||
import { AppKitButtons } from '../../components/AppKitButtons' | ||
import { siweConfig } from '../../utils/SiweUtils' | ||
import { SiweData } from '../../components/Siwe/SiweData' | ||
import { Ethers5Tests } from '../../components/Ethers/Ethers5Tests' | ||
import { Ethers5ModalInfo } from '../../components/Ethers/Ethers5ModalInfo' | ||
import { Ethers5Adapter } from '@reown/appkit-adapter-ethers5' | ||
import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' | ||
|
||
const ethersAdapter = new Ethers5Adapter() | ||
|
||
const modal = createAppKit({ | ||
adapters: [ethersAdapter], | ||
networks: [arbitrum, mainnet, optimism, polygon, zkSync, sepolia], | ||
defaultNetwork: mainnet, | ||
projectId: '', | ||
features: { | ||
analytics: true, | ||
socials: [] | ||
}, | ||
siweConfig, | ||
debug: true | ||
}) | ||
|
||
ThemeStore.setModal(modal) | ||
|
||
export default function Ethers() { | ||
return ( | ||
<> | ||
<AppKitButtons /> | ||
<Ethers5ModalInfo /> | ||
<SiweData /> | ||
<Ethers5Tests /> | ||
</> | ||
) | ||
} |
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,37 @@ | ||
import { createAppKit } from '@reown/appkit/react' | ||
import { SolanaAdapter } from '@reown/appkit-adapter-solana/react' | ||
|
||
import { ThemeStore } from '../../utils/StoreUtil' | ||
import { solana, solanaDevnet, solanaTestnet } from '@reown/appkit/networks' | ||
import { AppKitButtons } from '../../components/AppKitButtons' | ||
import { ConstantsUtil } from '../../utils/ConstantsUtil' | ||
import { SolanaTests } from '../../components/Solana/SolanaTests' | ||
import { HuobiWalletAdapter, SolflareWalletAdapter } from '@solana/wallet-adapter-wallets' | ||
|
||
const networks = [solana, solanaTestnet, solanaDevnet] | ||
|
||
const solanaWeb3JsAdapter = new SolanaAdapter({ | ||
wallets: [new HuobiWalletAdapter(), new SolflareWalletAdapter()] | ||
}) | ||
|
||
const modal = createAppKit({ | ||
adapters: [solanaWeb3JsAdapter], | ||
networks, | ||
projectId: '', | ||
metadata: ConstantsUtil.Metadata, | ||
features: { | ||
socials: [] | ||
}, | ||
debug: true | ||
}) | ||
|
||
ThemeStore.setModal(modal) | ||
|
||
export default function Solana() { | ||
return ( | ||
<> | ||
<AppKitButtons /> | ||
<SolanaTests /> | ||
</> | ||
) | ||
} |
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,45 @@ | ||
import { createAppKit } from '@reown/appkit/react' | ||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query' | ||
import { WagmiProvider } from 'wagmi' | ||
import { AppKitButtons } from '../../components/AppKitButtons' | ||
import { WagmiTests } from '../../components/Wagmi/WagmiTests' | ||
import { ThemeStore } from '../../utils/StoreUtil' | ||
import { arbitrum, mainnet, optimism, polygon, zkSync, sepolia } from '@reown/appkit/networks' | ||
import { WagmiModalInfo } from '../../components/Wagmi/WagmiModalInfo' | ||
import { WagmiAdapter } from '@reown/appkit-adapter-wagmi' | ||
|
||
const queryClient = new QueryClient() | ||
|
||
const networks = [mainnet, optimism, polygon, zkSync, arbitrum, sepolia] | ||
|
||
const wagmiAdapter = new WagmiAdapter({ | ||
ssr: true, | ||
networks, | ||
projectId: '' | ||
}) | ||
|
||
const modal = createAppKit({ | ||
adapters: [wagmiAdapter], | ||
networks, | ||
defaultNetwork: mainnet, | ||
projectId: '', | ||
features: { | ||
analytics: true, | ||
socials: [] | ||
}, | ||
debug: true | ||
}) | ||
|
||
ThemeStore.setModal(modal) | ||
|
||
export default function Wagmi() { | ||
return ( | ||
<WagmiProvider config={wagmiAdapter.wagmiConfig}> | ||
<QueryClientProvider client={queryClient}> | ||
<AppKitButtons /> | ||
<WagmiModalInfo /> | ||
<WagmiTests /> | ||
</QueryClientProvider> | ||
</WagmiProvider> | ||
) | ||
} |
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 @@ | ||
import { test, type BrowserContext } from '@playwright/test' | ||
import { ModalPage } from './shared/pages/ModalPage' | ||
import { ModalValidator } from './shared/validators/ModalValidator' | ||
|
||
/* eslint-disable init-declarations */ | ||
let modalPage: ModalPage | ||
let modalValidator: ModalValidator | ||
let context: BrowserContext | ||
|
||
// -- Setup -------------------------------------------------------------------- | ||
const debugModeTest = test.extend<{ library: string }>({ | ||
library: ['wagmi', { option: true }] | ||
}) | ||
|
||
debugModeTest.beforeAll(async ({ browser, library }) => { | ||
context = await browser.newContext() | ||
const browserPage = await context.newPage() | ||
|
||
modalPage = new ModalPage(browserPage, library, 'debug-mode') | ||
modalValidator = new ModalValidator(browserPage) | ||
|
||
await modalPage.load() | ||
await modalPage.openConnectModal() | ||
}) | ||
|
||
debugModeTest.afterAll(async () => { | ||
await modalPage.page.close() | ||
}) | ||
|
||
// -- Tests -------------------------------------------------------------------- | ||
debugModeTest('should show alert bar if Project ID is not configured', async () => { | ||
await modalValidator.expectAlertBarText('Project ID Not Configured') | ||
}) |
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
Oops, something went wrong.