Skip to content

Instantly share code, notes, and snippets.

@steffenkux
Last active September 14, 2023 14:37
Show Gist options
  • Select an option

  • Save steffenkux/a0f8aaaff9470f8d508621edf4fb837a to your computer and use it in GitHub Desktop.

Select an option

Save steffenkux/a0f8aaaff9470f8d508621edf4fb837a to your computer and use it in GitHub Desktop.
dm3 workshop

Create new REACT app

yarn create react-app dm3-demo-app --template typescript

Include dm3 package

cd dm3-demo-app
yarn add dm3-react

Create .env file

create this file in the root of the project

REACT_APP_ADDR_ENS_SUBDOMAIN=".beta-addr.dm3.eth"
REACT_APP_USER_ENS_SUBDOMAIN=".beta-user.dm3.eth"
REACT_APP_DEFAULT_DELIVERY_SERVICE="beta-ds.dm3.eth"
REACT_APP_BACKEND="https://dm3-beta2.herokuapp.com"
REACT_APP_DEFAULT_SERVICE="https://dm3-beta2.herokuapp.com"
REACT_APP_RESOLVER_BACKEND="https://dm3-beta2-resolver.herokuapp.com"

get file: .env

Import dm3 pack into app

open src/App.tsx

// @ts-ignore
import { DM3 } from 'dm3-react';

Add dm3 widget

<DM3
   defaultServiceUrl={process.env.REACT_APP_DEFAULT_SERVICE}
   showAlways={true}
/>

Add some resources

add pictures in public:

favicon.png

image

dm3_logo.png

favicon

Add/Change configurations

   defaultContact={'<ens_name>'}
   showAlways={true/false}
   showContacts={true/false}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment