0.0.29 • Published 25 days ago

@namehash/nameguard-react v0.0.29

Weekly downloads
-
License
-
Repository
-
Last release
25 days ago

@namehash/nameguard-react

Usage

These components can be used to interface with NameGuard with React.

Search

The <Search /> contains its own state for the chat modal and settings, the settings can be changed inside the search modal.

import { Search, SearchModal, SettingsModal } from "@namehash/nameguard-react";

export default () => (
  <>
    <Search />
    <SettingsModal />
    <SearchModal />
  </>
);

Report

If you want to load a report for an ENS name, just pass the name prop with your value.

import { Report } from "@namehash/nameguard-react";

export default () => <Report name="notrab.eth" />;

If you want to customize any of the settings used to with NameParser, you can pass an optional settings prop.

import { Report, NameParserSettings } from "@namehash/nameguard-react";

const settings: NameParserSettings = {
  // attemptEnsNormalization: true,
  // assumedTld: "eth",
  trimWhitespace: true,
};

export default () => <Report name="notrab.eth" settings={settings} />;

So that the chat modal can be presented, you need to pass the store.

import { Report, useChatModalStore } from "@namehash/nameguard-react";

export default () => (
  <Report name="notrab.eth" chatModalStore={useChatModalStore} />
);
0.0.30

4 days ago

0.0.27

26 days ago

0.0.28

26 days ago

0.0.29

25 days ago

0.0.26

3 months ago

0.0.25

3 months ago

0.0.23

3 months ago

0.0.24

3 months ago

0.0.21

3 months ago

0.0.22

3 months ago

0.0.20

4 months ago

0.0.16

4 months ago

0.0.17

4 months ago

0.0.18

4 months ago

0.0.19

4 months ago

0.0.14

4 months ago

0.0.13

5 months ago

0.0.12

5 months ago

0.0.11

5 months ago

0.0.10

5 months ago

0.0.9

5 months ago

0.0.8

5 months ago

0.0.7

6 months ago

0.0.6

6 months ago

0.0.5

6 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago