-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: tutorials implement invitations #154
Conversation
I'm not sure if we want that. We had some hard time configuring Storybooks, the fact that there is a webpack with a hidden config inside the storybooks is not helping. So maybe it will be better to keep the tutorials app as lean as possible. |
persistent: true, | ||
}, | ||
swarm: { | ||
signal: REACT_APP_SWARM_SIGNAL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The app is going to silently not work if the user forgots to take care of .env
file.
Maybe it would be a good idea to throw an error if REACT_APP_SWARM_SIGNAL
is not present, or provide a default?
A default would be wss://apollo3.kube.moon.dxos.network/dxos/signal
(note: not apollo1 which is not there atm)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that's why apollo1
was not working for me. Great then. Yup, I agree with you, I'll add that sanity check of the variable to #158 to work on it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User (developer) config should be via a YML file. The SDK should read this file and augment it.
No constants (e.g., apollo1, 2, 3) should be in code.
We should not introduce ENV variables for individual properties (it becomes really complicated). If we need something like that then we COULD have the .env point to a different config file.
This is a first step of #158 |
}; | ||
|
||
// Hook to redeem an invitation Code and provide the PIN authentication if needed. | ||
export function useInvitationRedeemer ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** */
comment.
Use arrow functions.
import React, { useState, useEffect } from 'react'; | ||
|
||
import { makeStyles } from '@material-ui/core'; | ||
import Button from '@material-ui/core/Button'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move to?
import {
A,
B,
C
} from '.../core'
const [inviteRequestTime, setInviteRequestTime] = useState<number>(); | ||
|
||
const [contacts] = useContacts(); | ||
const invitableContacts = contacts?.filter((c) => !members.some((m) => m.publicKey.toHex() === c.publicKey.toHex())); // contacts not already in this party |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Contacts not already in this party." (Capitalized, period)
persistent: true, | ||
}, | ||
swarm: { | ||
signal: REACT_APP_SWARM_SIGNAL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User (developer) config should be via a YML file. The SDK should read this file and augment it.
No constants (e.g., apollo1, 2, 3) should be in code.
We should not introduce ENV variables for individual properties (it becomes really complicated). If we need something like that then we COULD have the .env point to a different config file.
@@ -35,7 +35,7 @@ import { Client } from '@dxos/client'; | |||
|
|||
const client = new Client({ | |||
swarm: { | |||
signal: 'wss://apollo1.kube.moon.dxos.network/dxos/signal' | |||
signal: 'wss://apollo3.kube.moon.dxos.network/dxos/signal' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to figure out how to deal with constants for tutorials.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we want to change the tutorial and make the user run his own signal server locally?
We could completely get rid of this constant.
cp .env.example .env | ||
``` | ||
|
||
Next, edit the `.env` file, and set `REACT_APP_SWAM_SIGNAL` variable as: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, all config from the YML file.
1. Run the local signal server | ||
|
||
```bash | ||
npx @dxos/signal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create TODO for someone: this should be @dxos/signal-server
Please add BASIC storybooks for any components that are added here. |
About the code style suggestions - If possible, these should be expressed as rules in our eslint config. We use that config everywhere so that the code style is consistent in every repo. |
Intention
Integrate invitations flow into the tutorials task-app
Take the necessary components from
react-appkit
and replicate them intoreact-ux
Description
React Client
invite.js
file into a Typescript file and adjust corresponding typings.React UX
Replicate the following components from
react-appkit
intoreact-ux
:RedeemDialog
DialogHeading
PartySharingDialog
BotDialog
MemberAvatar
Theme
Extract the following components into their own file:
Replicate the following hooks from
react-appkit
intoreact-ux
:Update
compilerOptions
to point toes2019
to supportArray.flat
method.Tutorials Tasks App
Implement
PartySharingDialog
andRedeemDialog
in order to support invitationsAdd
REACT_APP_SWARM_SIGNAL
environment variable in the tasks-app to be able to customize it.Remove sentry commented stuff
Add documentation to be able to use a local signal server to test invitations
Leave a comment of open issue related StrictMode and some MaterialUI components: Tutorials - React StrictMode triggers warnings #157
Open tasks
Make Braneframe use
PartySharingDialog
andRedeemDialog
fromreact-ux
instead of their own copy of the componentsTidy up existing documentation and prepare a proper walkthrough of the tutorials app
Implement Storybooks within the tutorials app?