https://github.com/dialectlabs/react
https://github.com/dialectlabs/react
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/dialectlabs/react
- Owner: dialectlabs
- License: apache-2.0
- Created: 2022-01-17T05:22:00.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-08-14T15:03:45.000Z (almost 2 years ago)
- Last Synced: 2025-03-27T19:54:36.871Z (about 1 year ago)
- Language: TypeScript
- Homepage: https://react-notifications-solana.vercel.app
- Size: 6.65 MB
- Stars: 43
- Watchers: 3
- Forks: 22
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [Dialect](https://www.dialect.to/) React SDK & UI 💬
  
React components to use Dialect's wallet alerts.
Want to learn how to add Dialect to your dapp? See our [Docs](https://docs.dialect.to/).
### Table of Contents
- [Installation](#Installation)
- [FAQ](#FAQ)
- [Development](#Development)
## Installation
**npm:**
```shell
npm install @dialectlabs/react-ui --save
npm install @dialectlabs/react-sdk-blockchain-solana --save
```
**yarn:**
```shell
yarn add @dialectlabs/react-ui
yarn add @dialectlabs/react-sdk-blockchain-solana
```
## Development
### Prerequisites
- Git
- yarn 1
- Nodejs (>=18)
### Get Started
This repo utilizes [Workspaces](https://docs.npmjs.com/cli/v10/using-npm/workspaces). Publishable packages are located under `packages` directory. `examples` directory contains apps to demonstrate how can Dialect be used.
The simplest way to develop on Dialect's component library and headless react contexts locally is to run one of the demo apps in the `examples/` directory, and ensure you are targeting the local instances of `packages/react-sdk`, `packages/react-ui` and `packages/react-sdk-blockchain-solana`. How to best do this is described below.
Once set up, you'll have live, hot-reloading on changes. Some manual configuration is required to enable this.
#### Enable hot-reloading from an `examples/` app
Choose one of the `examples/` apps you'd like to do development from and then make the following changes in its source. For illustration purposes we choose `examples/notifications-solana`.
For example you want to make changes in `react-ui` library
Run
```shell
yarn run dev:react-ui
```
All of the above changes require restarting the next server and clearing cache (just in case), if you've already started it.
You can now run the example by following the instructions in the next section.
#### Start the examples
To get started, launch example's next dev server:
```shell
yarn install # in root dir
cd examples/notifications-solana
yarn run dev
```
Now you have a hot reload of the packages in the workspace.
### Publishing
1.
```shell
yarn run build:all
pushd packages/react-sdk/
npm publish --access public
popd
pushd packages/react-sdk-blockchain-solana/
npm publish --access public
popd
pushd packages/react-ui/
npm publish --access public
popd
```
2. Update all versions of packages to the new one(e.g. bump react, react-ui version in examples, starters folder)
This project is tested with BrowserStack.