Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
- ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Install Node.js on ${{ matrix.os }}
uses: actions/setup-node@v2
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: 'npm'
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.17.1
24
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,39 @@
# `@fabric/react`
Fabric integration for React applications.

Install peers (no Hub package required — Hub can depend on this library later):

```sh
npm install @fabric/react @fabric/core @fabric/http react react-dom semantic-ui-react
```

## Platform behavior

**`Bridge`** is a React class in this package. It uses `@fabric/http` **`Remote`** for the WebSocket client, `@fabric/core` **`Message`** / **`Key`** for wire signing, keeps a **JSON-Patch**–ready **`globalState`**, and exposes the same **static `Bridge.fabric`** helpers (formatting, envelopes, peer identity, safe logging, message type constants) as named exports from the package root.

WebRTC mesh behavior from the production Hub UI is **not** ported yet: `initializeWebRTC`, `reconnectWebRTC`, and related methods are stubs or no-ops until implemented here. Chat submission (`submitChatMessage`) is stubbed until the full identity pipeline is wired.

```jsx
import { Bridge, formatSatsDisplay, createEnvelope } from '@fabric/react';

formatSatsDisplay(50_000);
Bridge.fabric.format.formatSatsDisplay(50_000);
createEnvelope('Demo', { hello: 'world' });
```

## Quick Start
```js
import React from 'react';

```jsx
import React, { Component } from 'react';
import { Container, Header } from 'semantic-ui-react';

import { Bridge } from '@fabric/react';

class App extends Component {
render () {
return (
<Container>
<Bridge />
<Header>
<h1>Hello, world!</h1>
</Header>
Expand Down
144 changes: 0 additions & 144 deletions components/FabricBridge.js

This file was deleted.

Loading
Loading