This directory contains the source code and tooling for the front-end for the Astria bridge.
config-overrides.js
- used byreact-app-rewired
to override CRA's default webpack configpublic/index.html
- html meta stuff, import styles and fonts
- define React root element
src/index.tsx
- React application setup
- import styles
- ConfigContextProvider is here to provide config to App
src/App.tsx
- main application component
- define routes
- rest of context providers, e.g. notifications, rainbowkit, etc
src/setupTests.tsx
- most jest mocks defined here (some mocks defined in individual test files)
- browser global mocks defined here
src/testHelpers.tsx
- helper functions for testingsrc/components
- More general React components for the app, e.g. Navbar, Dropdown, CopyToClipboardButton, etcsrc/config
- Configuration for the web appsrc/config/chainConfigs
- Celestia and Astria chain informationsrc/config/contexts
- Config context and context providersrc/config/hooks
- Custom hook to make config easy to usesrc/config/env.ts
- Environment variable definitions plus utilities for consuming themsrc/config/index.ts
- AppConfig and exports
src/features
- Organizes components, contexts, hooks, services, types, and utils for different featuressrc/features/CosmosWallet
- User for interacting with Keplr walletsrc/features/EthWallet
- Used for interacting with EVM walletssrc/features/Notifications
- Used for displaying notifications and toasts
src/pages
- React components for each page
src/pages/Layout.tsx
- page layout component using
<Outlet />
- contains
<Navbar />
,<Notification />
- page layout component using
src/styles
- all style definitions
- using scss
- using bulma css framework
# install npm deps and run web app locally
just web init-env
just web install
just web run
# build web app static files
just web build
- How to add new chain configs for a new environment (e.g. you want to add new
chain configs for "mainnet")
-
create file that will contain the config values
touch web/src/config/chainConfigs/ChainConfigsMainnet.ts
-
import new configs in
astria-bridge-web-app/web/src/config/chainConfigs/index.ts
, while renaming themimport { evmChains as mainnetEvmChains, ibcChains as mainnetIbcChains, } from "./ChainConfigsMainnet";
-
add entry to
EVM_CHAIN_CONFIGS
const ENV_CHAIN_CONFIGS = { local: { evm: localEvmChains, ibc: localIbcChains }, dusk: { evm: duskEvmChains, ibc: duskIbcChains }, dawn: { evm: dawnEvmChains, ibc: dawnIbcChains }, mainnet: { evm: mainnetEvmChains, ibc: mainnetIbcChains }, } as const;
-