SRCL is an open-source React component and style repository that helps you build web applications, desktop applications, and static websites with terminal aesthetics. Its modular, easy-to-use components emphasize precise monospace character spacing and line heights, enabling you to quickly copy and paste implementations while maintaining a clean, efficient codebase.
This update includes significant changes focusing on a Bitcoin wallet implementation, as well as new modal components.
- A new
BTCWalletcomponent has been added, demonstrating a practical use case of the SRCL library. - This component features:
- Display of wallet balance, value in USD/EUR, and Bitcoin price.
- Integration with external APIs (CoinGecko, Blockcypher/Blockstream/Mempool) for fetching price and wallet data.
- Conversion tool for satoshis to USD/EUR.
- Display of recent transactions with modal detail views.
- Settings for currency, visibility, and auto-refresh.
- Basic wallet management (add/edit/select).
- Local storage for persisting settings and wallets.
- It utilizes several SRCL components:
ActionBar,ActionButton,AlertBanner,BlockLoader,Button,Card,Divider,RowSpaceBetween,Text,Input,Navigation,Badge,Row,Checkbox,ButtonGroup,Grid,Table,TableRow,TableColumn,ModalTrigger,ModalStack. - Demonstrates a complex component relying on fetching and managing data, state, and user preferences.
- Added modal components:
ModalTransaction.tsx: Displays details of a Bitcoin transaction.ModalNewWallet.tsx: Provides a form to add a new wallet.
- These modals utilize SRCL components like
Card,Text,Button,Input,Divider,ActionBar, andActionButton. - They showcase the modal management using
@components/page/ModalContext.
- New files under
components/examples:BTCWallet.tsx
- New files under
components/modals:ModalTransaction.tsxModalNewWallet.tsxModalTransaction.module.scssModalNewWallet.module.scss
- The
EmptyState.tsxcomponent and module.scss file were created in the components directory. actionListItemwas imported from components instead of root in app/page.tsx.- The
api.tsfile was updated with improved error handling, and API fallback logic. - All relative imports were updated.
- Updated
fetchPriceWithFallbackto use both CoinGecko and Binance APIs for price fetching with a fallback mechanism. - Added a
fetchWalletDataWithFallbackfunction that attempts multiple blockchain explorers (Blockcypher, Blockstream, Mempool) to fetch wallet information. - Implements retry logic for API calls.
- Modified to include the
BTCWalletcomponent within the main page layout. - Updated imports for the changed structure of the components.
- Added several new themes with light/dark mode variations:
theme-black-pink: A light and dark theme with a pinkish-violet accent.theme-orange: An orange theme with light and dark variantstheme-slate: A monochrome theme with light and dark variants
- Themes are automatically applied based on the user's system preference for light/dark mode.
npm install
npm run devGo to http://localhost:10000 in your browser of choice.
We use Vercel for hosting.
If you need to run node script without running the server, use this example to get started
npm run script exampleIf you have questions ping me on Twitter, @wwwjim. Or you can ping @internetxstudio.